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.String
MBEAN_TYPE
Type of the MBean.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
checkInAndLeaveCheckedOut(MetamergeConfig aConfiguration, java.lang.String aRelativePath)
Checks in the specified configuration and leaves it checked out.void
checkInConfiguration(MetamergeConfig aConfiguration, java.lang.String aRelativePath)
Saves the specified configuration and releases the lock.void
checkInConfiguration(MetamergeConfig aConfiguration, java.lang.String aRelativePath, boolean aEncrypt)
Encrypts and saves the specified configuration and releases the lock.MetamergeConfig
checkOutConfiguration(java.lang.String aRelativePath)
Checks out the specified configuration.MetamergeConfig
checkOutConfiguration(java.lang.String aRelativePath, java.lang.String aPassword)
Checks out the specified password protected configuration.javax.management.ObjectName
checkOutConfigurationAndLoad(java.lang.String aRelativePath)
Checks out the specified configuration and starts a temporary Config Instance on the Server.javax.management.ObjectName
checkOutConfigurationAndLoad(java.lang.String aRelativePath, java.lang.String aPassword)
Checks out the specified configuration and starts a temporary Config Instance on the Server.javax.management.ObjectName
createNewConfigInstance(java.lang.String aConfigUrl)
Deprecated.javax.management.ObjectName
createNewConfigInstance(java.lang.String aConfigUrl, java.lang.String aPassword)
Deprecated.MetamergeConfig
createNewConfiguration(java.lang.String aRelativePath, boolean aOverwrite)
Creates a new empty configuration and immediately checks it out.javax.management.ObjectName
createNewConfigurationAndLoad(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.String
getId()
Reads attribute "Id".java.lang.String
getType()
Reads attribute "Type".boolean
isConfigurationCheckedOut(java.lang.String aRelativePath)
Checks if the specified configuration is checked out on the Server.boolean
isSSLon()
Checks if the SSL on the server is turned on.java.util.ArrayList
listAllConfigurations()
Returns a list of the file names of all configurations in the directory subtree of the Server configuration codebase folder.java.util.ArrayList
listConfigurations(java.lang.String aRelativePath)
Returns a list of the file names of all configurations in the specified folder.java.util.ArrayList
listFolders(java.lang.String aRelativePath)
Returns a list of the child folders of the specified folder.boolean
releaseConfigurationLock(java.lang.String aRelativePath)
Administratively releases the lock of the specified configuration.void
sendCustomNotification(java.lang.String aType, java.lang.String aId, java.lang.Object aData)
Sends a custom, user defined notification to all registered listeners.void
shutDownServer()
Shuts down the TDI Server.void
shutDownServer(java.lang.Integer aExitCode)
Shuts down the TDI Server with the specified exit code.javax.management.ObjectName
startConfigInstance(java.lang.String aConfigUrl)
Starts a new Config Instance on the Server with the configuration given.javax.management.ObjectName
startConfigInstance(java.lang.String aConfigUrl, java.lang.Boolean aKeepAlive, java.lang.String aPassword)
Starts a new Config Instance on the Server with the configuration given.boolean
undoCheckOut(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 DIException
Reads 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:
getId
in 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 DIException
Starts a new Config Instance on the Server with the configuration given.- Specified by:
startConfigInstance
in 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 DIException
Starts a new Config Instance on the Server with the configuration given.- Specified by:
startConfigInstance
in interfaceDIServerMBean
- Parameters:
aConfigUrl
- The URL where the configuration file is loaded from.aKeepAlive
- Whentrue
the Config Instance will stay alive even when no threads are running, whenfalse
the Config Instance will automatically terminate when its last thread terminates.aPassword
- Specify the password of the configuration when it is password-protected; specifynull
when 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 DIException
Deprecated.- Specified by:
createNewConfigInstance
in 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 DIException
Deprecated.- Specified by:
createNewConfigInstance
in 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 DIException
Shuts down the TDI Server.- Specified by:
shutDownServer
in interfaceDIServerMBean
- Throws:
DIException
- if an error occurs while shutting down the server.
-
shutDownServer
public void shutDownServer(java.lang.Integer aExitCode) throws DIException
Shuts down the TDI Server with the specified exit code.- Specified by:
shutDownServer
in 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 DIException
Checks if the SSL on the server is turned on.- Specified by:
isSSLon
in 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 DIException
Administratively releases the lock of the specified configuration. This call can be only executed by users with the admin role.- Specified by:
releaseConfigurationLock
in 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 DIException
Releases 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:
undoCheckOut
in 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 DIException
Returns 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:
listConfigurations
in 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 DIException
Returns a list of the child folders of the specified folder.- Specified by:
listFolders
in 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 DIException
Returns 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:
listAllConfigurations
in 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:
checkOutConfiguration
in 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:
checkOutConfiguration
in 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:
checkInConfiguration
in 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:
checkInConfiguration
in 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:
checkInAndLeaveCheckedOut
in 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:
createNewConfiguration
in 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 DIException
Checks out the specified configuration and starts a temporary Config Instance on the Server.- Specified by:
checkOutConfigurationAndLoad
in 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 DIException
Checks out the specified configuration and starts a temporary Config Instance on the Server.- Specified by:
checkOutConfigurationAndLoad
in 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 DIException
Creates 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:
createNewConfigurationAndLoad
in 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 DIException
Checks if the specified configuration is checked out on the Server.- Specified by:
isConfigurationCheckedOut
in 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 DIException
Sends a custom, user defined notification to all registered listeners.- Specified by:
sendCustomNotification
in 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.
-
-