Package com.ibm.di.api.jmx.mbeans
Class DIServer
- java.lang.Object
-
- com.ibm.di.api.jmx.mbeans.BaseAdmin
-
- com.ibm.di.api.jmx.mbeans.DIServer
-
- All Implemented Interfaces:
BaseAdminMBean,BaseMBean,DIServerMBean
public class DIServer extends BaseAdmin implements DIServerMBean
This class implements methods exposed through JMX layer for manipulating TDI Server.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMBEAN_TYPEType of the MBean.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcheckInAndLeaveCheckedOut(MetamergeConfig aConfiguration, java.lang.String aRelativePath)Checks in the specified configuration and leaves it checked out.voidcheckInConfiguration(MetamergeConfig aConfiguration, java.lang.String aRelativePath)Saves the specified configuration and releases the lock.voidcheckInConfiguration(MetamergeConfig aConfiguration, java.lang.String aRelativePath, boolean aEncrypt)Encrypts and saves the specified configuration and releases the lock.MetamergeConfigcheckOutConfiguration(java.lang.String aRelativePath)Checks out the specified configuration.MetamergeConfigcheckOutConfiguration(java.lang.String aRelativePath, java.lang.String aPassword)Checks out the specified password protected configuration.javax.management.ObjectNamecheckOutConfigurationAndLoad(java.lang.String aRelativePath)Checks out the specified configuration and starts a temporary Config Instance on the Server.javax.management.ObjectNamecheckOutConfigurationAndLoad(java.lang.String aRelativePath, java.lang.String aPassword)Checks out the specified configuration and starts a temporary Config Instance on the Server.javax.management.ObjectNamecreateNewConfigInstance(java.lang.String aConfigUrl)Deprecated.javax.management.ObjectNamecreateNewConfigInstance(java.lang.String aConfigUrl, java.lang.String aPassword)Deprecated.MetamergeConfigcreateNewConfiguration(java.lang.String aRelativePath, boolean aOverwrite)Creates a new empty configuration and immediately checks it out.javax.management.ObjectNamecreateNewConfigurationAndLoad(java.lang.String aRelativePath, boolean aOverwrite)Creates a new empty configuration, immediately checks it out and loads a temporary Config Instance on the Server.java.lang.StringgetId()Reads attribute "Id".java.lang.StringgetType()Reads attribute "Type".booleanisConfigurationCheckedOut(java.lang.String aRelativePath)Checks if the specified configuration is checked out on the Server.booleanisSSLon()Checks if the SSL on the server is turned on.java.util.ArrayListlistAllConfigurations()Returns a list of the file names of all configurations in the directory subtree of the Server configuration codebase folder.java.util.ArrayListlistConfigurations(java.lang.String aRelativePath)Returns a list of the file names of all configurations in the specified folder.java.util.ArrayListlistFolders(java.lang.String aRelativePath)Returns a list of the child folders of the specified folder.booleanreleaseConfigurationLock(java.lang.String aRelativePath)Administratively releases the lock of the specified configuration.voidsendCustomNotification(java.lang.String aType, java.lang.String aId, java.lang.Object aData)Sends a custom, user defined notification to all registered listeners.voidshutDownServer()Shuts down the TDI Server.voidshutDownServer(java.lang.Integer aExitCode)Shuts down the TDI Server with the specified exit code.javax.management.ObjectNamestartConfigInstance(java.lang.String aConfigUrl)Starts a new Config Instance on the Server with the configuration given.javax.management.ObjectNamestartConfigInstance(java.lang.String aConfigUrl, java.lang.Boolean aKeepAlive, java.lang.String aPassword)Starts a new Config Instance on the Server with the configuration given.booleanundoCheckOut(java.lang.String aRelativePath)Releases the lock on the specified configuration, thus aborting all changes being done.-
Methods inherited from class com.ibm.di.api.jmx.mbeans.BaseAdmin
getCurrentUserId, getKeyPropertyList
-
-
-
-
Field Detail
-
MBEAN_TYPE
public static final java.lang.String MBEAN_TYPE
Type of the MBean.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DIServer
public DIServer(Session aSession)
Class constructor- Parameters:
aSession- com.ibm.di.api.local.Session
-
-
Method Detail
-
getType
public java.lang.String getType()
Reads attribute "Type".getType()andgetId()are used in a common schema for object names for all MBeans in the management package. The key properties part of the object name of each MBean is defined as"type=" + getType() + ",id=" + getId(), for example "type=AssemblyLine,id=Hello".
-
getId
public java.lang.String getId() throws DIExceptionReads attribute "Id". The "Id" value should be different for different MBeans of the same type.getType()andgetId()are used in a common schema for object names for all MBeans in the management package. The key properties part of the object name of each MBean is defined as"type=" + getType() + ",id=" + getId(), for example "type=AssemblyLine,id=Hello".- Specified by:
getIdin interfaceBaseMBean- Returns:
- the Id of this MBean.
- Throws:
DIException- if an error occurs while obtaining MBean's Id.
-
startConfigInstance
public javax.management.ObjectName startConfigInstance(java.lang.String aConfigUrl) throws DIExceptionStarts a new Config Instance on the Server with the configuration given.- Specified by:
startConfigInstancein interfaceDIServerMBean- Parameters:
aConfigUrl- The URL where the configuration file is loaded from.- Returns:
- ObjectName generated from the configuration ID.
- Throws:
DIException- if an error occurs on starting the new Config Instance.
-
startConfigInstance
public javax.management.ObjectName startConfigInstance(java.lang.String aConfigUrl, java.lang.Boolean aKeepAlive, java.lang.String aPassword) throws DIExceptionStarts a new Config Instance on the Server with the configuration given.- Specified by:
startConfigInstancein interfaceDIServerMBean- Parameters:
aConfigUrl- The URL where the configuration file is loaded from.aKeepAlive- Whentruethe Config Instance will stay alive even when no threads are running, whenfalsethe Config Instance will automatically terminate when its last thread terminates.aPassword- Specify the password of the configuration when it is password-protected; specifynullwhen the configuration is not password-protected.- Returns:
- ObjectName generated from the configuration ID.
- Throws:
DIException- if an error occurs on starting the new Config Instance.
-
createNewConfigInstance
@Deprecated public javax.management.ObjectName createNewConfigInstance(java.lang.String aConfigUrl) throws DIExceptionDeprecated.- Specified by:
createNewConfigInstancein interfaceDIServerMBean- Parameters:
aConfigUrl- The URL of the new configuration file to be created.- Throws:
DIException- if an error occurs while creating the new Config Instance.
-
createNewConfigInstance
@Deprecated public javax.management.ObjectName createNewConfigInstance(java.lang.String aConfigUrl, java.lang.String aPassword) throws DIExceptionDeprecated.- Specified by:
createNewConfigInstancein interfaceDIServerMBean- Parameters:
aConfigUrl- The URL of the new configuration file to be created.aPassword- If this parameter is notnull, the new configuration will be protected with the given password.- Throws:
DIException- if an error occurs while creating the new Config Instance.
-
shutDownServer
public void shutDownServer() throws DIExceptionShuts down the TDI Server.- Specified by:
shutDownServerin interfaceDIServerMBean- Throws:
DIException- if an error occurs while shutting down the server.
-
shutDownServer
public void shutDownServer(java.lang.Integer aExitCode) throws DIExceptionShuts down the TDI Server with the specified exit code.- Specified by:
shutDownServerin interfaceDIServerMBean- Parameters:
aExitCode- the exit code used to shut down TDI Server.- Throws:
DIException- if an error occurs while shutting down the server.
-
isSSLon
public boolean isSSLon() throws DIExceptionChecks if the SSL on the server is turned on.- Specified by:
isSSLonin interfaceDIServerMBean- Returns:
- true if SSL is enabled on server
- Throws:
DIException- if an error occurs while retrieving the information.
-
releaseConfigurationLock
public boolean releaseConfigurationLock(java.lang.String aRelativePath) throws DIExceptionAdministratively releases the lock of the specified configuration. This call can be only executed by users with the admin role.- Specified by:
releaseConfigurationLockin interfaceDIServerMBean- Parameters:
aRelativePath- The path to the configuration relative to the Server configuration codebase folder.- Returns:
- true if the configuration lock has been release, false otherwise.
- Throws:
DIException- If an error occurs during releasing the lock.
-
undoCheckOut
public boolean undoCheckOut(java.lang.String aRelativePath) throws DIExceptionReleases the lock on the specified configuration, thus aborting all changes being done. This call can only be executed from a user that has previously checked out the configuration and only if the configuration lock has not timed out.- Specified by:
undoCheckOutin interfaceDIServerMBean- Parameters:
aRelativePath- The path to the configuration relative to the Server configuration codebase folder.- Returns:
- true if the undo operation is successful, false otherwise.
- Throws:
DIException- If an error occurs during releasing the lock.
-
listConfigurations
public java.util.ArrayList listConfigurations(java.lang.String aRelativePath) throws DIExceptionReturns a list of the file names of all configurations in the specified folder. The configurations file paths returned are relative to the Server configuration codebase folder.- Specified by:
listConfigurationsin interfaceDIServerMBean- Parameters:
aRelativePath- A folder relative to the Server configuration codebase folder.- Returns:
- A list with the file names of all configurations in the specified folder.
- Throws:
DIException- If an error occurs while retrieving configurations.
-
listFolders
public java.util.ArrayList listFolders(java.lang.String aRelativePath) throws DIExceptionReturns a list of the child folders of the specified folder.- Specified by:
listFoldersin interfaceDIServerMBean- Parameters:
aRelativePath- A folder relative to the Server configuration codebase folder.- Returns:
- A list of the child folders of the specified folder.
- Throws:
DIException- If an error occurs while retrieving child folder.
-
listAllConfigurations
public java.util.ArrayList listAllConfigurations() throws DIExceptionReturns a list of the file names of all configurations in the directory subtree of the Server configuration codebase folder. The configurations file paths returned are relative to the TDI Server configuration codebase folder.- Specified by:
listAllConfigurationsin interfaceDIServerMBean- Returns:
- A list of the file names of all configurations from the whole configuration codebase directory subtree.
- Throws:
DIException- If an error occurs while retrieving configurations.
-
checkOutConfiguration
public MetamergeConfig checkOutConfiguration(java.lang.String aRelativePath) throws DIException
Checks out the specified configuration. Returns the MetamergeConfig object representing the configuration and locks that configuration on the Server.- Specified by:
checkOutConfigurationin interfaceDIServerMBean- Parameters:
aRelativePath- The path to the configuration relative to the Server configuration codebase folder.- Returns:
- The MetamergeConfig object representing the specified configuration.
- Throws:
DIException- If an error occurs while checking out the configuration.
-
checkOutConfiguration
public MetamergeConfig checkOutConfiguration(java.lang.String aRelativePath, java.lang.String aPassword) throws DIException
Checks out the specified password protected configuration. Returns the MetamergeConfig object representing the configuration and locks that configuration on the Server.- Specified by:
checkOutConfigurationin interfaceDIServerMBean- Parameters:
aRelativePath- The path to the configuration relative to the Server configuration codebase folder.aPassword- Specify the password for password protected configurations.- Returns:
- The MetamergeConfig object representing the specified configuration.
- Throws:
DIException- If an error occurs while checking out the configuration.
-
checkInConfiguration
public void checkInConfiguration(MetamergeConfig aConfiguration, java.lang.String aRelativePath) throws DIException
Saves the specified configuration and releases the lock. If a temporary ConfigInstance has been started on check out, it will be stopped as well.- Specified by:
checkInConfigurationin interfaceDIServerMBean- Parameters:
aConfiguration- The MetamergeConfig object representing the configuration to be checked in.aRelativePath- The path of the configuration relative to the Server configuration codebase folder.- Throws:
DIException- If an error occurs while checking in the configuration.
-
checkInConfiguration
public void checkInConfiguration(MetamergeConfig aConfiguration, java.lang.String aRelativePath, boolean aEncrypt) throws DIException
Encrypts and saves the specified configuration and releases the lock. If a temporary Config Instance has been started on check out, it will be stopped as well.- Specified by:
checkInConfigurationin interfaceDIServerMBean- Parameters:
aConfiguration- The MetamergeConfig object representing the configuration to be checked in.aRelativePath- The path of the configuration relative to the Server configuration codebase folder.aEncrypt- If set to true, the configuration will be encrypted on the Server.- Throws:
DIException- If an error occurs while checking in the configuration.
-
checkInAndLeaveCheckedOut
public void checkInAndLeaveCheckedOut(MetamergeConfig aConfiguration, java.lang.String aRelativePath) throws DIException
Checks in the specified configuration and leaves it checked out. The timeout for the lock on the configuration is reset.- Specified by:
checkInAndLeaveCheckedOutin interfaceDIServerMBean- Parameters:
aConfiguration- The MetamergeConfig object representing the configuration to be checked in.aRelativePath- The path of the configuration relative to the Server configuration codebase folder.- Throws:
DIException- If an error occurs while checking in the configuration.
-
createNewConfiguration
public MetamergeConfig createNewConfiguration(java.lang.String aRelativePath, boolean aOverwrite) throws DIException
Creates a new empty configuration and immediately checks it out. If a configuration with the specified path already exists and the aOverwrite parameter is set to false the operation will fail and an Exception will be thrown.- Specified by:
createNewConfigurationin interfaceDIServerMBean- Parameters:
aRelativePath- The path of the new configuration file relative to the Server configuration codebase folder.aOverwrite- Specify whether to overwrite or not an already existing configuration file.- Returns:
- The MetamergeConfig object representing the newly created configuration.
- Throws:
DIException- If an error occurs while creating the new configuration.
-
checkOutConfigurationAndLoad
public javax.management.ObjectName checkOutConfigurationAndLoad(java.lang.String aRelativePath, java.lang.String aPassword) throws DIExceptionChecks out the specified configuration and starts a temporary Config Instance on the Server.- Specified by:
checkOutConfigurationAndLoadin interfaceDIServerMBean- Parameters:
aRelativePath- The path to the configuration relative to the Server configuration codebase folder.aPassword- Specify the password for password protected configurations.- Returns:
- The ConfigInstance Object Name for the temporary ConfigIsntance started on the Server.
- Throws:
DIException- If an error occurs while checking out the configuration.
-
checkOutConfigurationAndLoad
public javax.management.ObjectName checkOutConfigurationAndLoad(java.lang.String aRelativePath) throws DIExceptionChecks out the specified configuration and starts a temporary Config Instance on the Server.- Specified by:
checkOutConfigurationAndLoadin interfaceDIServerMBean- Parameters:
aRelativePath- The path to the configuration relative to the Server configuration codebase folder.- Returns:
- The ConfigInstance Object Name for the temporary ConfigIsntance started on the Server.
- Throws:
DIException- If an error occurs while checking out the configuration.
-
createNewConfigurationAndLoad
public javax.management.ObjectName createNewConfigurationAndLoad(java.lang.String aRelativePath, boolean aOverwrite) throws DIExceptionCreates a new empty configuration, immediately checks it out and loads a temporary Config Instance on the Server. If a configuration with the specified path already exists and the aOverwrite parameter is set to false the operation will fail and an Exception will be thrown.- Specified by:
createNewConfigurationAndLoadin interfaceDIServerMBean- Parameters:
aRelativePath- The path of the new configuration file relative to the Server configuration codebase folder.aOverwrite- Specify whether to overwrite or not an already existing configuration file.- Returns:
- The ConfigInstance Object Name for the temporary ConfigIsntance started on the Server.
- Throws:
DIException- If an error occurs while creating the new configuration.
-
isConfigurationCheckedOut
public boolean isConfigurationCheckedOut(java.lang.String aRelativePath) throws DIExceptionChecks if the specified configuration is checked out on the Server.- Specified by:
isConfigurationCheckedOutin interfaceDIServerMBean- Parameters:
aRelativePath- The path to the configuration relative to the Server configuration codebase folder.- Returns:
- true if the specified configuration is checked out, false otherwise.
- Throws:
DIException- If an error occurs while checking the configuration.
-
sendCustomNotification
public void sendCustomNotification(java.lang.String aType, java.lang.String aId, java.lang.Object aData) throws DIExceptionSends a custom, user defined notification to all registered listeners.- Specified by:
sendCustomNotificationin interfaceDIServerMBean- Parameters:
aType- Notification type, will be automatically prefixed with "user."aId- Notification ID, usually identifies the object this event originated from.aData- Custom user data. Make sure the object passed is serializable if you want to send this event notification in a remote context.- Throws:
DIException- If an error occurs while sending the notification.
-
-