com.ibm.di.api.remote.impl
Class ConfigInstanceImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by com.ibm.di.api.remote.impl.APIRemoteObject
                  extended by com.ibm.di.api.remote.impl.ConfigInstanceImpl
All Implemented Interfaces:
ConfigInstance, Serializable, Remote

public class ConfigInstanceImpl
extends APIRemoteObject
implements ConfigInstance

This class implements methods exposed through Server API remote session.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Method Summary
 void addLogListener(LogListener listener)
          Register listener for messages logged by this configuration instance.
static ConfigInstanceImpl createInstance(ConfigInstance aLocalConfigInstance, SessionImpl aSession)
          Creates new instance of this class.
 String getALLastLogFileName(String aALName)
          Returns the name of the log file created on the last run of a given AssemblyLine.
 String getALLog(String aALName, String aLogFileName)
          Given an AssemblyLine name, and a log file name, retrieves the log of this AssemblyLine, stored in the specified file.
 String[] getALLogFileNames(String aALName)
          Returns the names of all available log files for a given AssemblyLine.
 String getALLogLastChunk(String aALName, String aLogFileName, int aKilobytes)
          Retrieves the last chunk from a specified AssemblyLine's log file.
 SchemaConfig getAssemblyLineInputParameters(String aAssemblyLineName)
          Returns the AssemblyLine’s input parameters.
 String[] getAssemblyLineNames()
          Returns the AssemblyLines’ names.
 SchemaConfig getAssemblyLineOutputParameters(String aAssemblyLineName)
          Returns the AssemblyLine’s output parameters.
 AssemblyLine[] getAssemblyLines()
          Returns currently started AssemblyLines of the configuration instance.
 String[] getAssemblyLinesNames()
          
 String getConfigId()
          Returns the configuration ID generated by the server.
 String getConfigPath()
          Retrieves absolut configuration path.
 MetamergeConfig getConfiguration()
          Returns configuration instance representing this configuration.
 PoolDefConfig getConnectorPoolConfig(String aConnectorPoolName)
          Returns the Connector Pool configuration object.
 int getConnectorPoolFreeNum(String aConnectorPoolName)
          Returns the number of free Connectors in the specified Connector Pool.
 String[] getConnectorPoolNames()
          Returns the names of all Connector Pools in the Config Instance.
 int getConnectorPoolSize(String aConnectorPoolName)
          Returns the size of the specified Connector Pool.
 ExternalPropertiesConfig getExternalProperties()
          Returns the external properties of the configuration.
 ExternalPropertiesConfig getExternalProperties(String aKey)
          Returns the ExternalPropertiesConfig object for the named external properties object.
 String[] getExternalPropertiesKeys()
          Returns the external properties object names.
 String getGlobalUniqueID()
          Returns the Config Instance GUID.
 Date getInstanceBootTime()
          Returns the Instance boot time.
 TDIProperties getTDIProperties()
          Returns the TDIProperties object associated with the current configuration.
 int purgeConnectorPool(String aConnectorPoolName)
          Unused Connectors will be released so that the Pool is shrunk to its minimum size.
 void reload()
          Reloads the Config Instance with its current configuration.
 void removeLogListener(LogListener listener)
           Unregister listener for messages logged by this configuration instance.
 void saveConfiguration()
          Deprecated. not supported.
 void saveConfiguration(boolean aEncrypt)
          Deprecated. not supported.
 void saveExternalProperties()
          
 void setConfiguration(MetamergeConfig aConfiguration)
          Sets given configuration to this configuration.
 void setExternalProperties(ExternalPropertiesConfig aExPropConfig)
          
 void setExternalProperties(String aKey, ExternalPropertiesConfig aExPropConfig)
          
 AssemblyLine startAssemblyLine(String aAssemblyLineName)
          Starts the specified AssemblyLine asynchronously.
 AssemblyLine startAssemblyLine(String aAssemblyLineName, boolean aSync)
          Starts the specified AssemblyLine.
 AssemblyLine startAssemblyLine(String aAssemblyLineName, Entry aInputData)
          Starts the specified AssemblyLine with the given input data asynchronously.
 AssemblyLine startAssemblyLine(String aAssemblyLineName, Entry aInputData, AssemblyLineListener aListener, boolean aGetLogs)
          Starts asynchronously the specified AssemblyLine with the given input data and results listener.
 AssemblyLine startAssemblyLine(String aAssemblyLineName, Entry aInputData, AssemblyLineListener aListener, boolean aGetLogs, boolean aSync)
          Starts the specified AssemblyLine with the given input data and results listener.
 AssemblyLine startAssemblyLine(String aAssemblyLineName, Entry aInputData, AssemblyLineListener aListener, boolean aGetLogs, boolean aSync, boolean aGetEntryOnEachCycle)
          Starts the specified AssemblyLine with the given input data and results listener.
 AssemblyLine startAssemblyLine(String aAssemblyLineName, Entry aInputData, boolean aSync)
          Starts the specified AssemblyLine with the given input data.
 AssemblyLine startAssemblyLine(String aAssemblyLineName, TaskCallBlock aTcb)
          Starts asynchronously the specified AssemblyLine with the given TaskCallBlock.
 AssemblyLine startAssemblyLine(String aAssemblyLineName, TaskCallBlock aTcb, boolean aSync)
          Starts the specified AssemblyLine with the given TaskCallBlock.
 AssemblyLineHandler startAssemblyLineManual(String aAssemblyLineName, Entry aInputData)
          Starts the specified AssemblyLine with the given input data in manual mode.
 void stop()
          Stops the Config Instance.
 void stop(boolean sync)
          Stops the Config Instance, and all AssemblyLines started by it, and waits a while for the stopping.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getConfigId

public String getConfigId()
                   throws DIException,
                          RemoteException
Returns the configuration ID generated by the server.

Example

  var sessionFactory = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
  var remoteSession = sessionFactory.createSession();
  for( ci in remoteSession.getConfigInstances()){
    task.logmsg("Name: " + ci.getConfigId());
  }
 

Specified by:
getConfigId in interface ConfigInstance
Returns:
String object representing the configuration ID.
Throws:
DIException - if an error occurs while getting the configuration ID.
RemoteException - if a communication-related exception occurs.

getConfiguration

public MetamergeConfig getConfiguration()
                                 throws DIException,
                                        RemoteException
Returns configuration instance representing this configuration.

Specified by:
getConfiguration in interface ConfigInstance
Returns:
MetamergeConfig object representing this configuration.
Throws:
DIException - if an error occurs while getting the configuration.
RemoteException - if a communication-related exception occurs.

setConfiguration

public void setConfiguration(MetamergeConfig aConfiguration)
                      throws DIException,
                             RemoteException
Sets given configuration to this configuration.

Specified by:
setConfiguration in interface ConfigInstance
Parameters:
aConfiguration - The new configuration.
Throws:
DIException - if an error occurs while setting the configuration.
RemoteException - if a communication-related exception occurs.

getAssemblyLinesNames

public String[] getAssemblyLinesNames()
                               throws DIException,
                                      RemoteException

Specified by:
getAssemblyLinesNames in interface ConfigInstance
Throws:
DIException
RemoteException

getAssemblyLineNames

public String[] getAssemblyLineNames()
                              throws DIException,
                                     RemoteException
Returns the AssemblyLines’ names.

Example

  var sessionFactory = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
  var remoteSession = sessionFactory.createSession();
  var configInstances = remoteSession.getConfigInstances();
  if (configInstances != null){
    for (ci in configInstances){
      for(al in ci.getAssemblyLineNames()){
        task.logmsg("Al name: " + al);
      }
    }
  } else {
    task.logmsg("no available config instances");
  }
 

Specified by:
getAssemblyLineNames in interface ConfigInstance
Returns:
String array each value representing AssemblyLine name.
Throws:
DIException - if an error occurs while getting the AssemblyLines’ names.
RemoteException - if a communication-related exception occurs.

getAssemblyLineInputParameters

public SchemaConfig getAssemblyLineInputParameters(String aAssemblyLineName)
                                            throws DIException,
                                                   RemoteException
Returns the AssemblyLine’s input parameters.

Specified by:
getAssemblyLineInputParameters in interface ConfigInstance
Parameters:
aAssemblyLineName - the name of the AssemblyLine.
Returns:
SchemaConfig representing the schema input of the AssemblyLine.
Throws:
DIException - if an error occurs while getting the AssemblyLine's input parameters.
RemoteException - if a communication-related exception occurs.

getAssemblyLineOutputParameters

public SchemaConfig getAssemblyLineOutputParameters(String aAssemblyLineName)
                                             throws DIException,
                                                    RemoteException
Returns the AssemblyLine’s output parameters.

Specified by:
getAssemblyLineOutputParameters in interface ConfigInstance
Parameters:
aAssemblyLineName - the name of the AssemblyLine.
Returns:
SchemaConfig representing the schema output of the AssemblyLine.
Throws:
DIException - if an error occurs while getting the AssemblyLine's output parameters.
RemoteException - if a communication-related exception occurs.

getAssemblyLines

public AssemblyLine[] getAssemblyLines()
                                throws DIException,
                                       RemoteException
Returns currently started AssemblyLines of the configuration instance.

Example

  var sessionFactory = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
  var remoteSession = sessionFactory.createSession();
  var configInstances = remoteSession.getConfigInstances();
  if (configInstances != null){
    for (ci in configInstances){
      for(al in ci.getAssemblyLines()){
        task.logmsg("Al name: " + al.getName());
      }
    }
  } else {
    task.logmsg("no available config instances");
  }
 

Specified by:
getAssemblyLines in interface ConfigInstance
Returns:
AssemblyLine array object each value represents currently started AssemblyLine.
Throws:
DIException - if an error occurs while getting the AssemblyLines.
RemoteException - if a communication-related exception occurs.

startAssemblyLine

public AssemblyLine startAssemblyLine(String aAssemblyLineName)
                               throws DIException,
                                      RemoteException
Starts the specified AssemblyLine asynchronously.

Example

 var sessionFactory = java.rmi.Naming
                .lookup("rmi://127.0.0.1:1099/SessionFactory");
 var remoteSession = sessionFactory.createSession();
 var mAssemblyLine = remoteSession.getAssemblyLines()[0];
 
 if (mAssemblyLine != null) {
        var mConfigInstance = mAssemblyLine.getConfigInstance();
        var al = ci.startAssemblyLine("exampleAL");
 } else {
        main.logmsg("No Remote Assembly Lines Running");
 }
 

Specified by:
startAssemblyLine in interface ConfigInstance
Parameters:
aAssemblyLineName - The name of the AssemblyLine.
Returns:
the AssemblyLine object.
Throws:
DIException - if an error occurs when starting the AssemblyLine.
RemoteException - if a communication-related exception occurs.

startAssemblyLine

public AssemblyLine startAssemblyLine(String aAssemblyLineName,
                                      boolean aSync)
                               throws DIException,
                                      RemoteException
Starts the specified AssemblyLine.

Example

 var sessionFactory = java.rmi.Naming
                .lookup("rmi://127.0.0.1:1099/SessionFactory");
 var remoteSession = sessionFactory.createSession();
 var mAssemblyLine = remoteSession.getAssemblyLines()[0];
 
 if (mAssemblyLine != null) {
        var mConfigInstance = mAssemblyLine.getConfigInstance();
        var al = ci.startAssemblyLine("exampleAL", false);
 } else {
        main.logmsg("No Remote Assembly Lines Running");
 }
 

Specified by:
startAssemblyLine in interface ConfigInstance
Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aSync - when true the AssemblyLine is started synchronously, when false the AssemblyLine is started asynchronously.
Returns:
the AssemblyLine object.
Throws:
DIException - if an error occurs when starting the AssemblyLine.
RemoteException - if a communication-related exception occurs.

startAssemblyLine

public AssemblyLine startAssemblyLine(String aAssemblyLineName,
                                      Entry aInputData)
                               throws DIException,
                                      RemoteException
Starts the specified AssemblyLine with the given input data asynchronously.

Example

 var sessionFactory = java.rmi.Naming
                .lookup("rmi://127.0.0.1:1099/SessionFactory");
 var remoteSession = sessionFactory.createSession();
 var mAssemblyLine = remoteSession.getAssemblyLines()[0];
 
 if (mAssemblyLine != null) {
        var mConfigInstance = mAssemblyLine.getConfigInstance();
        var al = ci.startAssemblyLine("exampleAL", work);
 } else {
        main.logmsg("No Remote Assembly Lines Running");
 }
 

Specified by:
startAssemblyLine in interface ConfigInstance
Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aInputData - Initial Work Entry to run the AssemblyLine with.
Returns:
the AssemblyLine object.
Throws:
DIException - if an error occurs when starting the AssemblyLine.
RemoteException - if a communication-related exception occurs.

startAssemblyLine

public AssemblyLine startAssemblyLine(String aAssemblyLineName,
                                      Entry aInputData,
                                      boolean aSync)
                               throws DIException,
                                      RemoteException
Starts the specified AssemblyLine with the given input data.

When the AssemblyLine is started synchronously it waits the current thread to die and starts after that.

Example

 var sessionFactory = java.rmi.Naming
                .lookup("rmi://127.0.0.1:1099/SessionFactory");
 var remoteSession = sessionFactory.createSession();
 var mAssemblyLine = remoteSession.getAssemblyLines()[0];
 
 if (mAssemblyLine != null) {
        var mConfigInstance = mAssemblyLine.getConfigInstance();
        var al = ci.startAssemblyLine("exampleAL", work, false);
 } else {
        main.logmsg("No Remote Assembly Lines Running");
 }
 

Specified by:
startAssemblyLine in interface ConfigInstance
Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aInputData - Initial Work Entry to run the AssemblyLine with.
aSync - when true the AssemblyLine is started synchronously, when false the AssemblyLine is started asynchronously.
Returns:
the AssemblyLine object.
Throws:
DIException - if an error occurs when starting the AssemblyLine.
RemoteException - if a communication-related exception occurs.

startAssemblyLine

public AssemblyLine startAssemblyLine(String aAssemblyLineName,
                                      Entry aInputData,
                                      AssemblyLineListener aListener,
                                      boolean aGetLogs)
                               throws DIException,
                                      RemoteException
Starts asynchronously the specified AssemblyLine with the given input data and results listener.

Specified by:
startAssemblyLine in interface ConfigInstance
Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aInputData - Initial Work Entry to run the AssemblyLine with.
aListener - A listener for Entries produced by the AssemblyLine.
aGetLogs - when true the AssemblyLineListener is delivered log messages, when false log messages are not delivered.
Returns:
the AssemblyLine object.
Throws:
DIException - if an error occurs when starting the AssemblyLine.
RemoteException - if a communication-related exception occurs.

startAssemblyLine

public AssemblyLine startAssemblyLine(String aAssemblyLineName,
                                      Entry aInputData,
                                      AssemblyLineListener aListener,
                                      boolean aGetLogs,
                                      boolean aSync)
                               throws DIException,
                                      RemoteException
Starts the specified AssemblyLine with the given input data and results listener.

When the AssemblyLine is started synchronously it waits the current thread to die and starts after that.

Specified by:
startAssemblyLine in interface ConfigInstance
Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aInputData - Initial Work Entry to run the AssemblyLine with.
aListener - A listener for Entries produced by the AssemblyLine.
aGetLogs - when true the AssemblyLineListener delivers log messages, when false log messages are not delivered.
aSync - when true the AssemblyLine is started synchronously, when false the AssemblyLine is started asynchronously.
Returns:
the AssemblyLine object.
Throws:
DIException - if an error occurs when starting the AssemblyLine.
RemoteException - if a communication-related exception occurs.

startAssemblyLine

public AssemblyLine startAssemblyLine(String aAssemblyLineName,
                                      Entry aInputData,
                                      AssemblyLineListener aListener,
                                      boolean aGetLogs,
                                      boolean aSync,
                                      boolean aGetEntryOnEachCycle)
                               throws DIException,
                                      RemoteException
Starts the specified AssemblyLine with the given input data and results listener.

When the AssemblyLine is started synchronously it waits the current thread to die and starts after that.

Specified by:
startAssemblyLine in interface ConfigInstance
Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aInputData - Initial Work Entry to run the AssemblyLine with.
aListener - A listener for Entries produced by the AssemblyLine.
aGetLogs - when true the AssemblyLineListener delivers log messages, when false log messages are not delivered.
aSync - when true the AssemblyLine is started synchronously, when false the AssemblyLine is started asynchronously.
aGetEntryOnEachCycle - when true the AssemblyLineListener delivers the current entry on each AssemblyLine cycle, when false the entries are not delivered.
Returns:
the AssemblyLine object.
Throws:
DIException - if an error occurs when starting the AssemblyLine.
RemoteException - if a communication-related exception occurs.

startAssemblyLineManual

public AssemblyLineHandler startAssemblyLineManual(String aAssemblyLineName,
                                                   Entry aInputData)
                                            throws DIException,
                                                   RemoteException
Starts the specified AssemblyLine with the given input data in manual mode.

Specified by:
startAssemblyLineManual in interface ConfigInstance
Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aInputData - Initial Work Entry to run the AssemblyLine with.
Returns:
the AssemblyLineHandler object for AssemblyLine manipulation in manual mode.
Throws:
DIException - if an error occurs when starting the AssemblyLine.
RemoteException - if a communication-related exception occurs.

startAssemblyLine

public AssemblyLine startAssemblyLine(String aAssemblyLineName,
                                      TaskCallBlock aTcb)
                               throws DIException,
                                      RemoteException
Starts asynchronously the specified AssemblyLine with the given TaskCallBlock.

Specified by:
startAssemblyLine in interface ConfigInstance
Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aTcb - The TaskCallBlock object to start the AL with.
Returns:
the AssemblyLine object.
Throws:
DIException - if an error occurs when starting the AssemblyLine.
RemoteException - if a communication-related exception occurs.

startAssemblyLine

public AssemblyLine startAssemblyLine(String aAssemblyLineName,
                                      TaskCallBlock aTcb,
                                      boolean aSync)
                               throws DIException,
                                      RemoteException
Starts the specified AssemblyLine with the given TaskCallBlock.

Specified by:
startAssemblyLine in interface ConfigInstance
Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aTcb - The TaskCallBlock object to start the AL with.
aSync - when true the AssemblyLine is started synchronously, when false the AssemblyLine is started asynchronously.
Returns:
the AssemblyLine object.
Throws:
DIException - if an error occurs when starting the AssemblyLine.
RemoteException - if a communication-related exception occurs.

reload

public void reload()
            throws DIException,
                   RemoteException
Reloads the Config Instance with its current configuration.

Specified by:
reload in interface ConfigInstance
Throws:
DIException - if an error occurs while reloading the server.
RemoteException - if a communication-related exception occurs.

stop

public void stop()
          throws DIException,
                 RemoteException
Stops the Config Instance.

Example

 var sessionFactory = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
 var remoteSession = sessionFactory.createSession();
 var configInstances = remoteSession.getConfigInstances();
 if (configInstances != null){
   for (ci in configInstances){
     ci.stop();
   }
 } else {
   task.logmsg("no available config instances");
 }
 

Specified by:
stop in interface ConfigInstance
Throws:
DIException - if an error occurs while stopping.
RemoteException - if a communication-related exception occurs.

stop

public void stop(boolean sync)
          throws DIException,
                 RemoteException
Stops the Config Instance, and all AssemblyLines started by it, and waits a while for the stopping.

Example

 var sessionFactory = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
 var remoteSession = sessionFactory.createSession();
 var configInstances = remoteSession.getConfigInstances();
 if (configInstances != null){
   for (ci in configInstances){
     ci.stop(false);
   }
 } else {
   task.logmsg("no available config instances");
 }
 

Specified by:
stop in interface ConfigInstance
Parameters:
sync - If true, creates new Threads on the server to do the waiting.
Throws:
DIException - if an error occurs while stopping.
RemoteException - if a communication-related exception occurs.

getALLogFileNames

public String[] getALLogFileNames(String aALName)
                           throws DIException,
                                  RemoteException
Returns the names of all available log files for a given AssemblyLine.

Specified by:
getALLogFileNames in interface ConfigInstance
Parameters:
aALName - the name of the AssemblyLine.
Returns:
a String array, each of its elements specifying the name of a log file.
Throws:
DIException - if an error occurs while obtaining AssemblyLine's log file names.
RemoteException - if a communication-related exception occurs.

getALLastLogFileName

public String getALLastLogFileName(String aALName)
                            throws DIException,
                                   RemoteException
Returns the name of the log file created on the last run of a given AssemblyLine.

Specified by:
getALLastLogFileName in interface ConfigInstance
Parameters:
aALName - the name of the AssemblyLine.
Returns:
the name of the log file created on the last AssemblyLine's run.
Throws:
DIException - if an error occurs while obtaining the log file name.
RemoteException - if a communication-related exception occurs.

getALLog

public String getALLog(String aALName,
                       String aLogFileName)
                throws DIException,
                       RemoteException
Given an AssemblyLine name, and a log file name, retrieves the log of this AssemblyLine, stored in the specified file.

Specified by:
getALLog in interface ConfigInstance
Parameters:
aALName - the name of the AssemblyLine.
aLogFileName - the name of the log file; no file path should be specified - just the file name.
Returns:
the specified log of the AssemblyLine.
Throws:
DIException - if an error occurs while obtaining AssemblyLine's log.
RemoteException - if a communication-related exception occurs.

getALLogLastChunk

public String getALLogLastChunk(String aALName,
                                String aLogFileName,
                                int aKilobytes)
                         throws DIException,
                                RemoteException
Retrieves the last chunk from a specified AssemblyLine's log file.

Specified by:
getALLogLastChunk in interface ConfigInstance
Parameters:
aALName - the name of the AssemblyLine.
aLogFileName - the name of the log file; no file path should be specified - just the file name.
aKilobytes - specifies in kilobytes the size of the log's last chunk that will be read.
Returns:
the last chunk of the specified AssemblyLine's log.
Throws:
DIException - if an error occurs while obtaining AssemblyLine's log.
RemoteException - if a communication-related exception occurs.

getInstanceBootTime

public Date getInstanceBootTime()
                         throws DIException,
                                RemoteException
Returns the Instance boot time.

Specified by:
getInstanceBootTime in interface ConfigInstance
Returns:
a java.util.Date specifying the date and time the instance was started.
Throws:
DIException - if an error occurs while retrieving instance's boot time.
RemoteException - if a communication-related exception occurs.

saveConfiguration

public void saveConfiguration()
                       throws DIException,
                              RemoteException
Deprecated. not supported.

Specified by:
saveConfiguration in interface ConfigInstance
Throws:
DIException
RemoteException

saveConfiguration

public void saveConfiguration(boolean aEncrypt)
                       throws DIException,
                              RemoteException
Deprecated. not supported.

Specified by:
saveConfiguration in interface ConfigInstance
Throws:
DIException
RemoteException

getExternalProperties

public ExternalPropertiesConfig getExternalProperties()
                                               throws DIException,
                                                      RemoteException
Returns the external properties of the configuration.

Specified by:
getExternalProperties in interface ConfigInstance
Returns:
ExternalPropertiesConfig object representing the configuration’s external properties.
Throws:
DIException - if an error occurs while getting the external properties.
RemoteException - if a communication-related exception occurs.

getExternalProperties

public ExternalPropertiesConfig getExternalProperties(String aKey)
                                               throws DIException,
                                                      RemoteException
Returns the ExternalPropertiesConfig object for the named external properties object.

Specified by:
getExternalProperties in interface ConfigInstance
Parameters:
aKey - The external property object name.
Returns:
ExternalPropertiesConfig object representing the configuration’s external properties specified by the external property object name.
Throws:
DIException - if an error occurs while getting the external properties.
RemoteException - if a communication-related exception occurs.

getExternalPropertiesKeys

public String[] getExternalPropertiesKeys()
                                   throws DIException,
                                          RemoteException
Returns the external properties object names.

Specified by:
getExternalPropertiesKeys in interface ConfigInstance
Returns:
String array each value representing one external property object name.
Throws:
DIException - if an error occurs while getting the external properties names.
RemoteException - if a communication-related exception occurs.

setExternalProperties

public void setExternalProperties(ExternalPropertiesConfig aExPropConfig)
                           throws DIException,
                                  RemoteException

Specified by:
setExternalProperties in interface ConfigInstance
Throws:
DIException
RemoteException

setExternalProperties

public void setExternalProperties(String aKey,
                                  ExternalPropertiesConfig aExPropConfig)
                           throws DIException,
                                  RemoteException

Specified by:
setExternalProperties in interface ConfigInstance
Throws:
DIException
RemoteException

saveExternalProperties

public void saveExternalProperties()
                            throws DIException,
                                   RemoteException

Specified by:
saveExternalProperties in interface ConfigInstance
Throws:
DIException
RemoteException

createInstance

public static ConfigInstanceImpl createInstance(ConfigInstance aLocalConfigInstance,
                                                SessionImpl aSession)
                                         throws DIException,
                                                RemoteException
Creates new instance of this class.

Parameters:
aLocalConfigInstance - local config instance
aSession - the SessionImpl object
Returns:
ConfigInstanceImpl object
Throws:
DIException - if error occurred while creating instance.
RemoteException - if a communication-related exception occurs.

getGlobalUniqueID

public String getGlobalUniqueID()
                         throws DIException,
                                RemoteException
Returns the Config Instance GUID. The GUID is a string value that is unique for each component ever created by a particular TDI Server.

Example

 var sessionFactory = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
 var remoteSession = sessionFactory.createSession();
 var configInstances = remoteSession.getConfigInstances();
 if (configInstances != null){
   for (ci in configInstances){
     task.logmsg("CI path: " + ci.getGlobalUniqueID());
   }
 } else {
   task.logmsg("no available config instances");
 }
 

Specified by:
getGlobalUniqueID in interface ConfigInstance
Returns:
The Config Instance GUID value.
Throws:
DIException - if an error occurs while retrieving Config Instance GUID value.
RemoteException - if a communication-related exception occurs.

getConnectorPoolNames

public String[] getConnectorPoolNames()
                               throws DIException,
                                      RemoteException
Returns the names of all Connector Pools in the Config Instance.

Specified by:
getConnectorPoolNames in interface ConfigInstance
Returns:
String array containing the Connector Pool names.
Throws:
DIException - if an error occurs while retrieving Connector Pool names.
RemoteException - if a communication-related exception occurs.

getConnectorPoolSize

public int getConnectorPoolSize(String aConnectorPoolName)
                         throws DIException,
                                RemoteException
Returns the size of the specified Connector Pool.

Specified by:
getConnectorPoolSize in interface ConfigInstance
Parameters:
aConnectorPoolName - the name of the Connector Pool.
Returns:
The current size of the specified Connector Pool.
Throws:
DIException - if an error occurs while retrieving the size of the specified Connector Pool.
RemoteException - if a communication-related exception occurs.

getConnectorPoolFreeNum

public int getConnectorPoolFreeNum(String aConnectorPoolName)
                            throws DIException,
                                   RemoteException
Returns the number of free Connectors in the specified Connector Pool.

Specified by:
getConnectorPoolFreeNum in interface ConfigInstance
Parameters:
aConnectorPoolName - the name of the Connector Pool.
Returns:
The number of free Connectors in the specified Connector Pool.
Throws:
DIException - if an error occurs while retrieving the number of free Connectors in the specified Connector Pool.
RemoteException - if a communication-related exception occurs.

getConnectorPoolConfig

public PoolDefConfig getConnectorPoolConfig(String aConnectorPoolName)
                                     throws DIException,
                                            RemoteException
Returns the Connector Pool configuration object.

Specified by:
getConnectorPoolConfig in interface ConfigInstance
Parameters:
aConnectorPoolName - the name of the Connector Pool.
Returns:
The configuration object for the specified Connector Pool.
Throws:
DIException - if an error occurs while retrieving Connector Pool configuration object.
RemoteException - if a communication-related exception occurs.

purgeConnectorPool

public int purgeConnectorPool(String aConnectorPoolName)
                       throws DIException,
                              RemoteException
Unused Connectors will be released so that the Pool is shrunk to its minimum size.

Specified by:
purgeConnectorPool in interface ConfigInstance
Parameters:
aConnectorPoolName - the name of the Connector Pool.
Returns:
The size of the Connector Pool after shrinking.
Throws:
DIException - if an error occurs while shrinking the Connector Pool.
RemoteException - if a communication-related exception occurs.

getTDIProperties

public TDIProperties getTDIProperties()
                               throws Exception,
                                      RemoteException
Returns the TDIProperties object associated with the current configuration. The TDIProperties can then be used to obtain list of property stores, get/set/remove property values,etc.

Specified by:
getTDIProperties in interface ConfigInstance
Returns:
TDIProperties object associated with the current configuration.
Throws:
Exception - if an error occurs while retrieving TDIProperties object.
RemoteException - if a communication-related exception occurs.

getConfigPath

public String getConfigPath()
                     throws RemoteException
Retrieves absolut configuration path.

Example

 var sessionFactory = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
 var remoteSession = sessionFactory.createSession();
 var configInstances = remoteSession.getConfigInstances();
 if (configInstances != null){
   for (ci in configInstances){
     task.logmsg("CI path: " + ci.getConfigPath());
   }
 } else {
   task.logmsg("no available config instances");
 }
 

Specified by:
getConfigPath in interface ConfigInstance
Returns:
The absolute path of the configuration file.
Throws:
RemoteException - if a communication-related exception occurs.

addLogListener

public void addLogListener(LogListener listener)
                    throws DIException,
                           RemoteException
Register listener for messages logged by this configuration instance. You must be admin to execute this method.

Specified by:
addLogListener in interface ConfigInstance
Parameters:
listener - Listener for logged messages.
Throws:
DIException - If an error occurs during registration, e.g. the listener is null.
RemoteException - If a communication-related exception occurs.
See Also:
ConfigInstance.removeLogListener(LogListener)

removeLogListener

public void removeLogListener(LogListener listener)
                       throws DIException,
                              RemoteException

Unregister listener for messages logged by this configuration instance. You must be admin to execute this method.

Listeners are associated with the API object, not with the AssemblyLine in the Server, so you can remove only listeners added with the ConfigInstance.addLogListener(LogListener) method on the same object.

Do not invoke this method from within the listener while the listener is being notified because a deadlock may occur.

Specified by:
removeLogListener in interface ConfigInstance
Parameters:
listener - Registered listener.
Throws:
DIException - If an error occurs while unregistering the listener, e.g. the listener is null or is not registered.
RemoteException - If a communication-related exception occurs.
See Also:
ConfigInstance.addLogListener(LogListener)