com.ibm.di.api.local
Interface Session

All Known Implementing Classes:
SessionImpl

public interface Session

This is the local Session interface which provides various methods which could be used with the started TDI Server.


Method Summary
 void addEventListener(DIEventListener aListener, String aTypeFilter, String aIdFilter)
          Registers an Event Listener with the Session.
 void checkInAndLeaveCheckedOut(MetamergeConfig configuration, String relativePathOrSolutionName)
          Checks in the specified configuration and leaves it checked out.
 void checkInConfiguration(MetamergeConfig configuration, String relativePathOrSolutionName)
          Saves the specified configuration and releases the lock.
 void checkInConfiguration(MetamergeConfig configuration, String relativePathOrSolutionName, boolean encrypt)
          Encrypts and saves the specified configuration and releases the lock.
 MetamergeConfig checkOutConfiguration(String relativePathOrSolutionName)
          Checks out the specified configuration.
 MetamergeConfig checkOutConfiguration(String relativePathOrSolutionName, String password)
          Checks out the specified password protected configuration.
 ConfigInstance checkOutConfigurationAndLoad(String relativePathOrSolutionName)
          Checks out the specified configuration and starts a temporary Config Instance on the Server.
 ConfigInstance checkOutConfigurationAndLoad(String relativePathOrSolutionName, String password)
          Checks out the specified configuration and starts a temporary Config Instance on the Server.
 ConfigInstance createNewConfigInstance(String aConfigUrl)
          Deprecated. Not supported. Creates and starts a new Config Instance with an empty configuration.
 ConfigInstance createNewConfigInstance(String aConfigUrl, String aPassword)
          Deprecated. Not supported. Creates and starts a new Config Instance with an empty configuration.
 MetamergeConfig createNewConfiguration(String aRelativePath, boolean aOverwrite)
          Creates a new empty configuration and immediately checks it out.
 ConfigInstance createNewConfigurationAndLoad(String aRelativePath, boolean aOverwrite)
          Creates a new empty configuration, immediately checks it out and loads a temporary Config Instance on the Server.
 void deleteConfiguration(String relativePathOrSolutionName)
          Delete a file from the configuration codebase folder.
 AssemblyLine[] getAssemblyLines()
          Returns started AssemblyLines corresponding to the currently started configurations.
 String getConfigFolderPath()
          Gets the value of the api.config.folder property as a complete path.
 ConfigInstance getConfigInstance(String aConfigId)
          Returns configuration instance corresponding to a specific configuration ID.
 ConfigInstance[] getConfigInstances()
          Returns all currently started configuration instances.
 SecurityRegistry getSecurityRegistry()
          Returns information about the restrictions the current user has.
 ServerInfo getServerInfo()
          Retrieves the Server information.
 SystemLog getSystemLog()
          Returns information about the System logging.
 SystemQueue getSystemQueue()
          Gets the SystemQueue Server API object
 TombstoneManager getTombstoneManager()
          Returns the TombstoneManager object.
 Object invokeCustom(String aCustomClassName, String aMethodName, Object[] aParams)
          Invokes the specified method from the specified class.
 Object invokeCustom(String aCustomClassName, String aMethodName, Object[] aParamsValue, String[] aParamsClass)
          Invokes the specified method from the specified class.
 boolean isConfigurationCheckedOut(String relativePathOrSolutionName)
          Checks if the specified configuration is checked out on the Server.
 boolean isSSLon()
          Checks if current session is over SSL.
 ArrayList<String> listAllConfigurations()
          Returns a list of all configurations in the directory subtree of the Server configuration codebase folder.
 ArrayList<String> listConfigurations(String aRelativePath)
          Returns a list of all configurations in the specified folder.
 ArrayList<String> listFolders(String aRelativePath)
          Returns a list of the child folders of the specified folder.
 boolean releaseConfigurationLock(String relativePathOrSolutionName)
          Administratively releases the lock of the specified configuration.
 boolean removeEventListener(DIEventListener aListener)
          Unregisters an Event Listener with the Session.
 void sendCustomNotification(String aType, String aId, Object aData)
          Sends a custom, user defined notification to all registered listeners.
 void shutDownServer()
          Shuts down the TDI server.
 void shutDownServer(int aExitCode)
          Shuts down the TDI Server with the specified exit code.
 void shutDownServer(int aExitCode, boolean sync)
          Shuts down the TDI Server with the specified exit code, after stopping all AssemblyLines and waiting a while for them to finish.
 ConfigInstance startConfigInstance(String configPathOrSolutionName)
          Starts a new Config Instance on the Server with the configuration given.
 ConfigInstance startConfigInstance(String configPathOrSolutionName, boolean keepAlive, String password)
          Starts a new Config Instance on the Server with the configuration given.
 ConfigInstance startConfigInstance(String configPathOrSolutionName, boolean keepAlive, String password, String runName, String overrideProps)
          Starts a new Config Instance on the Server with the configuration given.
 ConfigInstance startConfigInstance(String configPathOrSolutionName, boolean keepAlive, String password, String runName, String overrideProps, LogListener logListener)
          Starts a new Config Instance on the Server with the configuration given.
 ConfigInstance startTempConfigInstance(String xmlConfig, boolean keepAlive, String runName, String overrideProps)
          Start a configuration instance which has no associated configuration file.
 ConfigInstance startTempConfigInstance(String xmlConfig, boolean keepAlive, String runName, String overrideProps, LogListener logListener)
          Start a configuration instance which has no associated configuration file.
 boolean undoCheckOut(String relativePathOrSolutionName)
          Releases the lock on the specified configuration, thus aborting all changes being done.
 

Method Detail

getServerInfo

ServerInfo getServerInfo()
                         throws DIException
Retrieves the Server information.

Returns:
ServerInfo object representing the information gathered from the Server.
Throws:
DIException - if an error occurs while retrieving the Server information.

getConfigInstances

ConfigInstance[] getConfigInstances()
                                    throws DIException
Returns all currently started configuration instances.

Example:

        var session = (new com.ibm.di.api.local.impl.SessionFactoryImpl).createSession();
        var ci = session.getConfigInstances();
        for (i=0; i<ci.length; i++) {
        task.logmsg("Config instance: " + ci[i]);
        
        } 
 

Returns:
ConfigInstance array each value representing currently started configuration instance.
Throws:
DIException - if an error occurs while retrieving the information about the currently started configuration instances.

getConfigInstance

ConfigInstance getConfigInstance(String aConfigId)
                                 throws DIException
Returns configuration instance corresponding to a specific configuration ID.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 var cID = "testconfig.xml";
 var ci = session.getConfigInstance(cID);
 //do something with ci
 
 

Parameters:
aConfigId - the ID of the wanted configuration.
Returns:
ConfigInstance object corresponding to the specified configuration ID or null if the configuration ID is not found in the list of currently started configurations.
Throws:
DIException - if an error occurs while retrieving the information.

getAssemblyLines

AssemblyLine[] getAssemblyLines()
                                throws DIException
Returns started AssemblyLines corresponding to the currently started configurations.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 var assemblyLines = session.getAssemblyLines();
 
 for (i = 0; i < assemblyLines.length; i++) {
        task.logmsg("AL name: " + assemblyLines[i].getName());
 
        // do someting with assemblyLines[i]
 }
 

Returns:
AssemblyLine array each value corresponding to a started AssemblyLine.
Throws:
DIException - if an error occurs while retrieving the information about the AssemblyLines.

startConfigInstance

ConfigInstance startConfigInstance(String configPathOrSolutionName)
                                   throws DIException
Starts a new Config Instance on the Server with the configuration given.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 session.startConfigInstance("Solution_name");
 

Parameters:
configPathOrSolutionName - The URL where the configuration file is loaded from or the Solution Name of the configuration file. Only configuration files located in the configuration codebase folder can be referenced by Solution Name.
Returns:
ConfigInstance object representing currently started configuration instance.
Throws:
DIException - if an error occurs on starting the new Config Instance.

startConfigInstance

ConfigInstance startConfigInstance(String configPathOrSolutionName,
                                   boolean keepAlive,
                                   String password)
                                   throws DIException
Starts a new Config Instance on the Server with the configuration given.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 var pass = "Difficult password";
 session.startConfigInstance("Solution_name", false, pass);
 

Parameters:
configPathOrSolutionName - The URL where the configuration file is loaded from or the Solution Name of the configuration file. Only configuration files located in the configuration codebase folder can be referenced by Solution Name.
keepAlive - When true the Config Instance will stay alive even when no threads are running, when false the Config Instance will automatically terminate when its last thread terminates.
password - Specify the password of the configuration when it is password-protected; specify null when the configuration is not password-protected.
Returns:
ConfigInstance object representing currently started configuration instance.
Throws:
DIException - if an error occurs on starting the new Config Instance.

startConfigInstance

ConfigInstance startConfigInstance(String configPathOrSolutionName,
                                   boolean keepAlive,
                                   String password,
                                   String runName,
                                   String overrideProps)
                                   throws DIException
Starts a new Config Instance on the Server with the configuration given.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 var pass = "Difficult password";
 session.startConfigInstance("Solution_name", false, pass, "myrunname",
                "mystore=mynewstore.properties");
 

Parameters:
configPathOrSolutionName - The URL where the configuration file is loaded from or the Solution Name of the configuration file. Only configuration files located in the configuration codebase folder can be referenced by Solution Name.
keepAlive - When true the Config Instance will stay alive even when no threads are running, when false the Config Instance will automatically terminate when its last thread terminates.
password - Specify the password of the configuration when it is password-protected; specify null when the
runName - A name which will be used as the configuration instance id. It must not coincide with any of the id's of running configuration instances. It must not contain forward or back slashes or colons. This is an optional parameter that can be null.
overrideProps - Use to redirect property stores to load their contents from files different from the ones specified in the configuration file. Property stores and their corresponding files are specified as key-value pairs separated with spaces, e.g.: "mystore1=file1.properties mystore2=file2.properties". You cannot override a property store from an included configuration file, because its property stores are not directly accessible in the including file. This is an optional parameter that can be null.
Returns:
ConfigInstance object representing currently started configuration instance.
Throws:
DIException - if an error occurs on starting the new Config Instance or if the run name is not a valid file name.
Since:
7.0

startConfigInstance

ConfigInstance startConfigInstance(String configPathOrSolutionName,
                                   boolean keepAlive,
                                   String password,
                                   String runName,
                                   String overrideProps,
                                   LogListener logListener)
                                   throws DIException
Starts a new Config Instance on the Server with the configuration given.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 var pass = "Difficult password";
 session.startConfigInstance("Solution_name", false, pass, "myrunname",
                "mystore=mynewstore.properties", null);
 

Parameters:
configPathOrSolutionName - The URL where the configuration file is loaded from or the Solution Name of the configuration file. Only configuration files located in the configuration codebase folder can be referenced by Solution Name.
keepAlive - When true the Config Instance will stay alive even when no threads are running, when false the Config Instance will automatically terminate when its last thread terminates.
password - Specify the password of the configuration when it is password-protected; specify null when the
runName - A name which will be used as the configuration instance id. It must not coincide with any of the id's of running configuration instances. It must not contain forward or back slashes or colons. This is an optional parameter that can be null.
overrideProps - Use to redirect property stores to load their contents from files different from the ones specified in the configuration file. Property stores and their corresponding files are specified as key-value pairs separated with spaces, e.g.: "mystore1=file1.properties mystore2=file2.properties". You cannot override a property store from an included configuration file, because its property stores are not directly accessible in the including file. This is an optional parameter that can be null.
logListener - Listener for messages logged by the configuration instance.
Returns:
ConfigInstance object representing currently started configuration instance.
Throws:
DIException - if an error occurs on starting the new Config Instance or if the run name is not a valid file name.
Since:
7.0

createNewConfigInstance

@Deprecated
ConfigInstance createNewConfigInstance(String aConfigUrl)
                                       throws DIException
Deprecated. Not supported. Creates and starts a new Config Instance with an empty configuration.

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
ConfigInstance createNewConfigInstance(String aConfigUrl,
                                                  String aPassword)
                                       throws DIException
Deprecated. Not supported. Creates and starts a new Config Instance with an empty configuration.

Parameters:
aConfigUrl - The URL of the new configuration file to be created.
aPassword - If this parameter is not null, the new configuration will be protected with the given password.
Throws:
DIException - if an error occurs while creating the new Config Instance.

shutDownServer

void shutDownServer()
                    throws DIException
Shuts down the TDI server.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 session.shutDownServer();
 

Throws:
DIException - if an error occurs while shutting down the server.

shutDownServer

void shutDownServer(int aExitCode)
                    throws DIException
Shuts down the TDI Server with the specified exit code.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 session.shutDownServer(2);
 

Parameters:
aExitCode - the exit code used to shut down TDI Server.
Throws:
DIException - if an error occurs while shutting down the server.

shutDownServer

void shutDownServer(int aExitCode,
                    boolean sync)
                    throws DIException
Shuts down the TDI Server with the specified exit code, after stopping all AssemblyLines and waiting a while for them to finish.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 session.shutDownServer(0, false);
 

Parameters:
aExitCode - the exit code used to shut down TDI Server.
sync - If true, do the waiting in separate Threads.
Throws:
DIException - if an error occurs while shutting down the server.
Since:
7.1

getSecurityRegistry

SecurityRegistry getSecurityRegistry()
                                     throws DIException
Returns information about the restrictions the current user has.

Returns:
SecurityRegistry object which represents the restrictions to the current user.
Throws:
DIException - if an error occurs while retrieving security information.

getSystemLog

SystemLog getSystemLog()
                       throws DIException
Returns information about the System logging.

Returns:
SystemLog object containing log information.
Throws:
DIException - if an error occurs while retrieving the System logging information.

addEventListener

void addEventListener(DIEventListener aListener,
                      String aTypeFilter,
                      String aIdFilter)
                      throws DIException
Registers an Event Listener with the Session.

Parameters:
aListener - The Event Listener to register with the Session.
aTypeFilter - A filter for the type of events.
aIdFilter - A filter for the id of events.
Throws:
DIException - if an error occurs while registering the listener.

removeEventListener

boolean removeEventListener(DIEventListener aListener)
                            throws DIException
Unregisters an Event Listener with the Session.

Parameters:
aListener - The Event Listener to unregister.
Returns:
true if the EventListener is successfully unregistered, false otherwise.
Throws:
DIException - if an error occurs while unregistering the listener.

getTombstoneManager

TombstoneManager getTombstoneManager()
                                     throws DIException
Returns the TombstoneManager object. Tombstones can be queried and cleared through this object.

Returns:
The TombstoneManager object or null if TombstoneManeger is switched off.
Throws:
DIException - If an error occurs while getting the TombstoneManager.

isSSLon

boolean isSSLon()
                throws DIException
Checks if current session is over SSL.

Returns:
true if current session is over SSL.
Throws:
DIException - if an error occurs while retrieving the information.

releaseConfigurationLock

boolean releaseConfigurationLock(String relativePathOrSolutionName)
                                 throws DIException
Administratively releases the lock of the specified configuration. This call can be only executed by users with the admin role.

Parameters:
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the 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

boolean undoCheckOut(String relativePathOrSolutionName)
                     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.

Parameters:
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the configuration codebase folder).
Returns:
true if the undo operation is successful, false otherwise.
Throws:
DIException - If an error occurs during releasing the lock.

listConfigurations

ArrayList<String> listConfigurations(String aRelativePath)
                                     throws DIException
Returns a list of all configurations in the specified folder. If a configuration has a Solution Name, this name appears in the list, otherwise in the list appears the file path of the configuration. The configurations file paths returned are relative to the Server configuration codebase folder. The returned list is based on information, gathered by the Server on startup. If a new configuration file is added in the configuration codebase folder when the Server is already running, that configuration will not be listed by the method.

Example:

        //for Java use APIEngine.getLocalSession() to create new Session instance.
 
        for(alcfg in session.listConfigurations("test_folder")){
        task.logmsg("getting name");
        task.logmsg("Conf: " + alcfg);
        }
 

Parameters:
aRelativePath - A folder relative to the Server configuration codebase folder.
Returns:
A list of all configurations in the specified folder.
Throws:
DIException - If an error occurs while retrieving configurations.

listFolders

ArrayList<String> listFolders(String aRelativePath)
                              throws DIException
Returns a list of the child folders of the specified folder.

Example:

        //for Java use APIEngine.getLocalSession() to create new Session instance.
 
        for(p in session.listFolders("test_folder")){
        task.logmsg("getting name");
        task.logmsg("Folder: " + p);
        }
 

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

ArrayList<String> listAllConfigurations()
                                        throws DIException
Returns a list of all configurations in the directory subtree of the Server configuration codebase folder. If a configuration has a Solution Name, this name appears in the list, otherwise in the list appears the file path of the configuration. The configurations file paths returned are relative to the TDI Server configuration codebase folder. The returned list is based on information, gathered by the Server on startup. If a new configuration file is added in the configuration codebase folder when the Server is already running, that configuration will not be listed by the method.

Example:

        //for Java use APIEngine.getLocalSession() to create new Session instance.
 
        for(alcfg in session.listAllConfigurations()){
                task.logmsg("getting name:");
                task.logmsg("Conf: " + alcfg);
        }
 

Returns:
A list of all configurations from the whole configuration codebase directory subtree.
Throws:
DIException - If an error occurs while retrieving configurations.

checkOutConfiguration

MetamergeConfig checkOutConfiguration(String relativePathOrSolutionName)
                                      throws DIException
Checks out the specified configuration. Returns the MetamergeConfig object representing the configuration and locks that configuration on the Server.

Parameters:
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the configuration codebase folder).
Returns:
The MetamergeConfig object representing the specified configuration.
Throws:
DIException - If an error occurs while checking out the configuration.

checkOutConfiguration

MetamergeConfig checkOutConfiguration(String relativePathOrSolutionName,
                                      String password)
                                      throws DIException
Checks out the specified password protected configuration. Returns the MetamergeConfig object representing the configuration and locks that configuration on the Server.

Parameters:
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the configuration codebase folder).
password - 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.

checkOutConfigurationAndLoad

ConfigInstance checkOutConfigurationAndLoad(String relativePathOrSolutionName)
                                            throws DIException
Checks out the specified configuration and starts a temporary Config Instance on the Server.

Parameters:
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the configuration codebase folder).
Returns:
The ConfigInstance object representing the temporary ConfigIsntance started on the Server.
Throws:
DIException - If an error occurs while checking out the configuration.

checkOutConfigurationAndLoad

ConfigInstance checkOutConfigurationAndLoad(String relativePathOrSolutionName,
                                            String password)
                                            throws DIException
Checks out the specified configuration and starts a temporary Config Instance on the Server.

Parameters:
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the configuration codebase folder).
password - Specify the password for password protected configurations.
Returns:
The ConfigInstance object representing the temporary ConfigIsntance started on the Server.
Throws:
DIException - If an error occurs while checking out the configuration.

checkInConfiguration

void checkInConfiguration(MetamergeConfig configuration,
                          String relativePathOrSolutionName)
                          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.

Parameters:
configuration - The MetamergeConfig object representing the configuration to be checked in.
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the configuration codebase folder).
Throws:
DIException - If an error occurs while checking in the configuration.

checkInAndLeaveCheckedOut

void checkInAndLeaveCheckedOut(MetamergeConfig configuration,
                               String relativePathOrSolutionName)
                               throws DIException
Checks in the specified configuration and leaves it checked out. The timeout for the lock on the configuration is reset.

Parameters:
configuration - The MetamergeConfig object representing the configuration to be checked in.
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the configuration codebase folder).
Throws:
DIException - If an error occurs while checking in the configuration.

checkInConfiguration

void checkInConfiguration(MetamergeConfig configuration,
                          String relativePathOrSolutionName,
                          boolean encrypt)
                          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.

Parameters:
configuration - The MetamergeConfig object representing the configuration to be checked in.
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the configuration codebase folder).
encrypt - If set to true, the configuration will be encrypted on the Server.
Throws:
DIException - If an error occurs while checking in the configuration.

createNewConfiguration

MetamergeConfig createNewConfiguration(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.

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.

createNewConfigurationAndLoad

ConfigInstance createNewConfigurationAndLoad(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.

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 representing the temporary ConfigIsntance started on the Server.
Throws:
DIException - If an error occurs while creating the new configuration.

isConfigurationCheckedOut

boolean isConfigurationCheckedOut(String relativePathOrSolutionName)
                                  throws DIException
Checks if the specified configuration is checked out on the Server.

Parameters:
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the 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

void sendCustomNotification(String aType,
                            String aId,
                            Object aData)
                            throws DIException
Sends a custom, user defined notification to all registered listeners.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 var t = work.getAttribute("event.type");
 var id = work.getAttribute("event.id");
 var data = work.getAttribute("event.userData");
 session.sendCustomNotification(t, id, data);
 

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.

getSystemQueue

SystemQueue getSystemQueue()
                           throws DIException
Gets the SystemQueue Server API object

Returns:
the ServerAPI representation of the System Queue
Throws:
DIException - if the System Queue is turned off or the System Queue cannot be initialized

getConfigFolderPath

String getConfigFolderPath()
Gets the value of the api.config.folder property as a complete path. If not set, then returns an empty string.

Example:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 var p = session.getConfigFolderPath();
 var f = new java.io.File(p);
 if (f.exists())
        task.logmsg("Folder path: " + p);
 

Returns:
A String containing the config folder property as a complete path.

invokeCustom

Object invokeCustom(String aCustomClassName,
                    String aMethodName,
                    Object[] aParams)
                    throws DIException
Invokes the specified method from the specified class. The method must be static. This method cannot invoke methods with null parameter values. All parameter values in the parameter object array MUST be non-null. If any value is null an Exception is thrown. If a user wants to invoke a method with a null parameter, he/she must use the other invokeCustom method. The usage of this method can be turned on/off. There is a property in the global.properties file called api.custom.method.invoke.on. If this property is set to true then this method can be invoked, otherwise an exception is thrown if this method is invoked. There is a restriction on the classes which can be directly invoked. The allowed classes are described in another property in the global.properties file called api.custom.method.invoke.allowed.classes. Only classes listed in this property can be directly invoked by this method. If a user tries to invoke a class which is not in this list then an exception is thrown.

Example: Suppose the following class is packaged in a jar file, which is then placed in the 'jars' folder of TDI:
public class MyClass {
public static Integer multiply(Integer a , Integer b){
return new Integer(a.intValue() * b.intValue());
}
}
Suppose the global.properties TDI configuration file contains the following lines:
api.custom.method.invoke.on=true
api.custom.method.invoke.allowed.classes=MyClass
Now we can do the following:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 var result = session.invokeCustom("MyClass", "multiply", new Array(3, 5));
 

Parameters:
aCustomClassName - The class containing the method to be invoked.
aMethodName - The name of the method to be invoked.
aParams - Array of parameters used by the invoked method.
Returns:
the result of dispatching the method represented with parameters aParams.
Throws:
DIException - If an error occurs while invoking the method.

invokeCustom

Object invokeCustom(String aCustomClassName,
                    String aMethodName,
                    Object[] aParamsValue,
                    String[] aParamsClass)
                    throws DIException
Invokes the specified method from the specified class. The method must be static. This method is used when the user wants to invoke the specified method with a null parameter value. The main difference between these two invokeCustom methods is that when using this method the user MUST specify the parameters' type. The usage of this method can be turned on/off. There is a property in the global.properties file called api.custom.method.invoke.on. If this property is set to true then this method can be invoked, otherwise an exception is thrown if this method is invoked. There is a restriction on the classes which can be directly invoked. The allowed classes are described in another property in the global.properties file called api.custom.method.invoke.allowed.classes. Only classes listed in this property can be directly invoked by this method. If the user tries to invoke a class which is not in this list then an exception is thrown.

Example: Suppose the following class is packaged in a jar file, which is then placed in the 'jars' folder of TDI:
public class MyClass {
public static Integer multiply(Integer a , Integer b){
return new Integer(a.intValue() * b.intValue());
}
}
Suppose the global.properties TDI configuration file contains the following lines:
api.custom.method.invoke.on=true
api.custom.method.invoke.allowed.classes=MyClass
Now we can do the following:

 //for Java use APIEngine.getLocalSession() to create new Session instance.
 
 var result = session.invokeCustom("MyClass", "multiply", new Array(3, 5),
                new Array("java.lang.Integer", "java.lang.Integer"));
 

Parameters:
aCustomClassName - The class containing the method to be invoked.
aMethodName - The name of the method to be invoked.
aParamsValue - Array of parameters used by the invoked method.
aParamsClass - The type of the parameters used by the invoked method.
Returns:
the result of dispatching the method represented with parameters' types aParamsClass.
Throws:
DIException - If an error occurs while invoking the method.

deleteConfiguration

void deleteConfiguration(String relativePathOrSolutionName)
                         throws DIException
Delete a file from the configuration codebase folder. You must be admin to execute this method.

Parameters:
relativePathOrSolutionName - The path to the configuration relative to the Server configuration codebase folder or the Solution Name of the configuration (the configuration must be inside the configuration codebase folder).
Throws:
DIException - The file is currently checked-out or deletion failed (e.g. the file does not exist).
Since:
7.0

startTempConfigInstance

ConfigInstance startTempConfigInstance(String xmlConfig,
                                       boolean keepAlive,
                                       String runName,
                                       String overrideProps)
                                       throws DIException
Start a configuration instance which has no associated configuration file. You must be admin to execute this method.

Parameters:
xmlConfig - A configuration as a XML string.
keepAlive - When true the Config Instance will stay alive even when no threads are running, when false the Config Instance will automatically terminate when its last thread terminates.
runName - A name which will be used as the configuration instance id. It must not coincide with any of the id's of running configuration instances. It must not contain forward or back slashes or colons. This is an optional parameter that can be null.
overrideProps - Use to redirect property stores to load their contents from files different from the ones specified in the configuration. Property stores and their corresponding files are specified as key-value pairs separated with spaces, e.g.: "mystore1=file1.properties mystore2=file2.properties". You cannot override a property store from an included configuration, because its property stores are not directly accessible. This is an optional parameter that can be null.
Returns:
A handle to the started configuration instance.
Throws:
DIException - If an error occurs on starting the new Config Instance or if the run name is not a valid file name.
Since:
7.0

startTempConfigInstance

ConfigInstance startTempConfigInstance(String xmlConfig,
                                       boolean keepAlive,
                                       String runName,
                                       String overrideProps,
                                       LogListener logListener)
                                       throws DIException
Start a configuration instance which has no associated configuration file. You must be admin to execute this method.

Parameters:
xmlConfig - A configuration as a XML string.
keepAlive - When true the Config Instance will stay alive even when no threads are running, when false the Config Instance will automatically terminate when its last thread terminates.
runName - A name which will be used as the configuration instance id. It must not coincide with any of the id's of running configuration instances. It must not contain forward or back slashes or colons. This is an optional parameter that can be null.
overrideProps - Use to redirect property stores to load their contents from files different from the ones specified in the configuration. Property stores and their corresponding files are specified as key-value pairs separated with spaces, e.g.: "mystore1=file1.properties mystore2=file2.properties". You cannot override a property store from an included configuration, because its property stores are not directly accessible. This is an optional parameter that can be null.
logListener - Listener for messages logged by this configuration instance.
Returns:
A handle to the started configuration instance.
Throws:
DIException - If an error occurs on starting the new Config Instance or if the run name is not a valid file name.
Since:
7.0