|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.di.api.local.impl.ConfigInstanceImpl
public class ConfigInstanceImpl
Represents a configuration instance and implements various methods for manipulating the configuration.
| Constructor Summary | |
|---|---|
ConfigInstanceImpl(RS aConfigInstance,
SessionImpl aSession)
|
|
| Method Summary | |
|---|---|
void |
addLogListener(LogListener listener)
Register listener for messages logged by this configuration instance. |
static java.lang.String |
genGUID(RS aConfigInstance)
This method is for internal Server API usage. |
java.lang.String |
getALLastLogFileName(java.lang.String aALName)
Returns the name of the log file created on the last run of a given AssemblyLine. |
java.lang.String |
getALLog(java.lang.String aALName,
java.lang.String aLogFileName)
Given an AssemblyLine name, and a log file name, retrieves the log of this AssemblyLine, stored in the specified file. |
java.lang.String[] |
getALLogFileNames(java.lang.String aALName)
Returns the names of all available log files for a given AssemblyLine. |
java.lang.String |
getALLogLastChunk(java.lang.String aALName,
java.lang.String aLogFileName,
int aKilobytes)
Retrieves the last chunk from a specified AssemblyLine's log file. |
SchemaConfig |
getAssemblyLineInputParameters(java.lang.String aAssemblyLineName)
Returns the AssemblyLine’s input parameters. |
java.lang.String[] |
getAssemblyLineNames()
Returns the AssemblyLines’ names. |
SchemaConfig |
getAssemblyLineOutputParameters(java.lang.String aAssemblyLineName)
Returns the AssemblyLine’s output parameters. |
AssemblyLine[] |
getAssemblyLines()
Returns currently started AssemblyLines of the configuration instance. |
java.lang.String[] |
getAssemblyLinesNames()
|
java.lang.String |
getConfigId()
Returns the configuration ID generated by the server. |
java.lang.String |
getConfigPath()
Retrieves the absolute path of the configuration. |
MetamergeConfig |
getConfiguration()
Returns configuration instance representing this configuration. |
PoolDefConfig |
getConnectorPoolConfig(java.lang.String aConnectorPoolName)
Returns the Connector Pool configuration object. |
int |
getConnectorPoolFreeNum(java.lang.String aConnectorPoolName)
Returns the number of free Connectors in the specified Connector Pool. |
java.lang.String[] |
getConnectorPoolNames()
Returns the names of all Connector Pools in the Config Instance. |
int |
getConnectorPoolSize(java.lang.String aConnectorPoolName)
Returns the size of the specified Connector Pool. |
ExternalPropertiesConfig |
getExternalProperties()
Returns the external properties of the configuration. |
ExternalPropertiesConfig |
getExternalProperties(java.lang.String aKey)
Returns the ExternalPropertiesConfig object for the named external properties object. |
java.lang.String[] |
getExternalPropertiesKeys()
Returns the external properties object names. |
java.lang.String |
getGlobalUniqueID()
Returns the Config Instance GUID. |
java.util.Date |
getInstanceBootTime()
Returns the Instance boot time. |
TDIProperties |
getTDIProperties()
Used to obtain a reference to TDIProperties for managing properties / property stores. |
int |
purgeConnectorPool(java.lang.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(java.lang.String aKey,
ExternalPropertiesConfig aExPropConfig)
|
AssemblyLine |
startAssemblyLine(java.lang.String aAssemblyLineName)
Starts the specified AssemblyLine asynchronously. |
AssemblyLine |
startAssemblyLine(java.lang.String aAssemblyLineName,
boolean aSync)
Starts the specified AssemblyLine. |
AssemblyLine |
startAssemblyLine(java.lang.String aAssemblyLineName,
Entry aInputData)
Starts the specified AssemblyLine with the given input data asynchronously. |
AssemblyLine |
startAssemblyLine(java.lang.String aAssemblyLineName,
Entry aInputData,
AssemblyLineListener aListener,
boolean aGetLogs)
Starts asynchronously the specified AssemblyLine with the given input data and results listener. |
AssemblyLine |
startAssemblyLine(java.lang.String aAssemblyLineName,
Entry aInputData,
AssemblyLineListener aListener,
boolean aGetLogs,
boolean aSync)
Starts the specified AssemblyLine with the given input data and results listener. |
AssemblyLine |
startAssemblyLine(java.lang.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(java.lang.String aAssemblyLineName,
Entry aInputData,
boolean aSync)
Starts the specified AssemblyLine with the given input data. |
AssemblyLine |
startAssemblyLine(java.lang.String aAssemblyLineName,
TaskCallBlock aTcb)
Starts asynchronously the specified AssemblyLine with the given TaskCallBlock. |
AssemblyLine |
startAssemblyLine(java.lang.String aAssemblyLineName,
TaskCallBlock aTcb,
boolean aSync)
Starts the specified AssemblyLine with the given TaskCallBlock. |
AssemblyLineHandler |
startAssemblyLineManual(java.lang.String aAssemblyLineName,
Entry aInputData)
Starts the specified AssemblyLine with the given input data in manual mode. |
void |
stop()
Stops the Config Instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConfigInstanceImpl(RS aConfigInstance,
SessionImpl aSession)
throws DIException
aConfigInstance - aSession -
DIException| Method Detail |
|---|
public java.lang.String getConfigId()
throws DIException
Example:
for( ci in session.getConfigInstances()){
task.logmsg("Name: " + ci.getConfigId());
}
//Sample output: Name: C__Documents and Settings_username_My Documents_TDI_rs.xml
getConfigId in interface ConfigInstanceDIException - if an error occurs while getting the configuration ID.
public MetamergeConfig getConfiguration()
throws DIException
getConfiguration in interface ConfigInstanceDIException - if an error occurs while getting the configuration.
public void setConfiguration(MetamergeConfig aConfiguration)
throws DIException
setConfiguration in interface ConfigInstanceaConfiguration - The new configuration.
DIException - if an error occurs while setting the configuration.
public void saveConfiguration()
throws DIException
saveConfiguration in interface ConfigInstanceDIException
public void saveConfiguration(boolean aEncrypt)
throws DIException
saveConfiguration in interface ConfigInstanceDIException
public ExternalPropertiesConfig getExternalProperties()
throws DIException
getExternalProperties in interface ConfigInstanceDIException - if an error occurs while getting the external properties.
public ExternalPropertiesConfig getExternalProperties(java.lang.String aKey)
throws DIException
getExternalProperties in interface ConfigInstanceaKey - The external property object name.
DIException - if an error occurs while getting the external properties.
public java.lang.String[] getExternalPropertiesKeys()
throws DIException
getExternalPropertiesKeys in interface ConfigInstanceDIException - if an error occurs while getting the external properties
names.
public void setExternalProperties(ExternalPropertiesConfig aExPropConfig)
throws DIException
setExternalProperties in interface ConfigInstanceDIException
public void setExternalProperties(java.lang.String aKey,
ExternalPropertiesConfig aExPropConfig)
throws DIException
setExternalProperties in interface ConfigInstanceDIException
public void saveExternalProperties()
throws DIException
saveExternalProperties in interface ConfigInstanceDIException
public java.lang.String[] getAssemblyLinesNames()
throws DIException
getAssemblyLinesNames in interface ConfigInstanceDIException
public java.lang.String[] getAssemblyLineNames()
throws DIException
Example:
var ci = session.getConfigInstance("C__Documents and Settings_username_My Documents_TDI_rs.xml");
for(al in ci.getAssemblyLineNames()){
task.logmsg("Al name: " + al);
}
//Sample output:Al name: csv2xml
Al name: test
getAssemblyLineNames in interface ConfigInstanceDIException - if an error occurs while getting the AssemblyLines’ names.
public SchemaConfig getAssemblyLineInputParameters(java.lang.String aAssemblyLineName)
throws DIException
getAssemblyLineInputParameters in interface ConfigInstanceaAssemblyLineName - the name of the AssemblyLine.
DIException - if an error occurs while getting the AssemblyLine's input
parameters.
public SchemaConfig getAssemblyLineOutputParameters(java.lang.String aAssemblyLineName)
throws DIException
getAssemblyLineOutputParameters in interface ConfigInstanceaAssemblyLineName - the name of the AssemblyLine.
DIException - if an error occurs while getting the AssemblyLine's output
parameters.
public AssemblyLine[] getAssemblyLines()
throws DIException
Example:
var ci = session.getConfigInstance("C__Documents and Settings_username_My Documents_TDI_rs.xml");
for(al in ci.getAssemblyLines()){
task.logmsg("Al running: " + al.getName());
}
//Sample output: Al running: AssemblyLines/test
getAssemblyLines in interface ConfigInstanceDIException - if an error occurs while getting the AssemblyLines.
public AssemblyLine startAssemblyLine(java.lang.String aAssemblyLineName)
throws DIException
Example:
var ci = session
.getConfigInstance("C__Documents and Settings_username_My Documents_TDI_rs.xml");
var al = ci.startAssemblyLine("csv2xml");//assembly line is started
//do something with al
startAssemblyLine in interface ConfigInstanceaAssemblyLineName - The name of the AssemblyLine.
DIException - if an error occurs when starting the AssemblyLine.
public AssemblyLine startAssemblyLine(java.lang.String aAssemblyLineName,
boolean aSync)
throws DIException
Example:
var ci = session
.getConfigInstance("C__Documents and Settings_username_My Documents_TDI_rs.xml");
var al = ci.startAssemblyLine("csv2xml", false);//assembly line is started in new thread
//do something with al
startAssemblyLine in interface ConfigInstanceaAssemblyLineName - The name of the AssemblyLine.aSync - when true the AssemblyLine is started
synchronously, when false the AssemblyLine is
started asynchronously.
DIException - if an error occurs when starting the AssemblyLine.
public AssemblyLine startAssemblyLine(java.lang.String aAssemblyLineName,
Entry aInputData)
throws DIException
Example:
var ci = session
.getConfigInstance("C__Documents and Settings_username_My Documents_TDI_rs.xml");
var al = ci.startAssemblyLine("csv2xml", work);
//assembly line "csv2xml" is started with the current entry of the current running assembly line
//do something with al
startAssemblyLine in interface ConfigInstanceaAssemblyLineName - The name of the AssemblyLine.aInputData - Initial Work Entry to run the AssemblyLine with.
DIException - if an error occurs when starting the AssemblyLine.
public AssemblyLine startAssemblyLine(java.lang.String aAssemblyLineName,
Entry aInputData,
boolean aSync)
throws DIException
Example:
var ci = session
.getConfigInstance("C__Documents and Settings_username_My Documents_TDI_rs.xml");
var al = ci.startAssemblyLine("csv2xml", work, false);
//assembly line "csv2xml" is started with the current entry of the current running assembly line
//do something with al
startAssemblyLine in interface ConfigInstanceaAssemblyLineName - 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.
DIException - if an error occurs when starting the AssemblyLine.
public AssemblyLine startAssemblyLine(java.lang.String aAssemblyLineName,
Entry aInputData,
AssemblyLineListener aListener,
boolean aGetLogs)
throws DIException
startAssemblyLine in interface ConfigInstanceaAssemblyLineName - 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.
DIException - if an error occurs when starting the AssemblyLine.
public AssemblyLine startAssemblyLine(java.lang.String aAssemblyLineName,
Entry aInputData,
AssemblyLineListener aListener,
boolean aGetLogs,
boolean aSync)
throws DIException
startAssemblyLine in interface ConfigInstanceaAssemblyLineName - 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.
DIException - if an error occurs when starting the AssemblyLine.
public AssemblyLine startAssemblyLine(java.lang.String aAssemblyLineName,
Entry aInputData,
AssemblyLineListener aListener,
boolean aGetLogs,
boolean aSync,
boolean aGetEntryOnEachCycle)
throws DIException
startAssemblyLine in interface ConfigInstanceaAssemblyLineName - 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.
DIException - if an error occurs when starting the AssemblyLine.
public AssemblyLineHandler startAssemblyLineManual(java.lang.String aAssemblyLineName,
Entry aInputData)
throws DIException
startAssemblyLineManual in interface ConfigInstanceaAssemblyLineName - The name of the AssemblyLine.aInputData - Initial Work Entry to run the AssemblyLine with.
DIException - if an error occurs when starting the AssemblyLine.
public AssemblyLine startAssemblyLine(java.lang.String aAssemblyLineName,
TaskCallBlock aTcb)
throws DIException
startAssemblyLine in interface ConfigInstanceaAssemblyLineName - The name of the AssemblyLine.aTcb - The TaskCallBlock object to start the AL with.
DIException - if an error occurs when starting the AssemblyLine.
public AssemblyLine startAssemblyLine(java.lang.String aAssemblyLineName,
TaskCallBlock aTcb,
boolean aSync)
throws DIException
startAssemblyLine in interface ConfigInstanceaAssemblyLineName - 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.
DIException - if an error occurs when starting the AssemblyLine.
public void reload()
throws DIException
reload in interface ConfigInstanceDIException - if an error occurs while reloading the server.
public void stop()
throws DIException
Example:
var ci = session
.getConfigInstance("C__Documents and Settings_username_My Documents_TDI_rs.xml");
ci.stop();
stop in interface ConfigInstanceDIException - if an error occurs while stopping.
public java.lang.String[] getALLogFileNames(java.lang.String aALName)
throws DIException
getALLogFileNames in interface ConfigInstanceaALName - the name of the AssemblyLine.
DIException - if an error occurs while obtaining AssemblyLine's log file
names.
public java.lang.String getALLastLogFileName(java.lang.String aALName)
throws DIException
getALLastLogFileName in interface ConfigInstanceaALName - the name of the AssemblyLine.
DIException - if an error occurs while obtaining the log file name.
public java.lang.String getALLog(java.lang.String aALName,
java.lang.String aLogFileName)
throws DIException
getALLog in interface ConfigInstanceaALName - the name of the AssemblyLine.aLogFileName - the name of the log file; no file path should be specified -
just the file name.
DIException - if an error occurs while obtaining AssemblyLine's log.
public java.lang.String getALLogLastChunk(java.lang.String aALName,
java.lang.String aLogFileName,
int aKilobytes)
throws DIException
getALLogLastChunk in interface ConfigInstanceaALName - 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.
DIException - if an error occurs while obtaining AssemblyLine's log.
public java.util.Date getInstanceBootTime()
throws DIException
getInstanceBootTime in interface ConfigInstancejava.util.Date specifying the date and time the
instance was started.
DIException - if an error occurs while retrieving instance's boot time.public java.lang.String getGlobalUniqueID()
Example:
var ci = session
.getConfigInstance("C__Documents and Settings_username_My Documents_TDI_rs.xml");
task.logmsg("Config ID: " + ci.getGlobalUniqueID());
//Sample output: Config ID: 19245595421206360821315
getGlobalUniqueID in interface ConfigInstance
public java.lang.String[] getConnectorPoolNames()
throws DIException
getConnectorPoolNames in interface ConfigInstanceDIException - if an error occurs while retrieving the names of all
Connector Pools.
public int getConnectorPoolSize(java.lang.String aConnectorPoolName)
throws DIException
getConnectorPoolSize in interface ConfigInstanceaConnectorPoolName - the name of the Connector Pool.
DIException - if an error occurs while retrieving the size of the specified
Connector Pool.
public int getConnectorPoolFreeNum(java.lang.String aConnectorPoolName)
throws DIException
getConnectorPoolFreeNum in interface ConfigInstanceaConnectorPoolName - the name of the Connector Pool.
DIException - if an error occurs while retrieving the number of free
Connectors in the specified Connector Pool.
public PoolDefConfig getConnectorPoolConfig(java.lang.String aConnectorPoolName)
throws DIException
getConnectorPoolConfig in interface ConfigInstanceaConnectorPoolName - the name of the Connector Pool.
DIException - if an error occurs while retrieving the Connector Pool
configuration object.
public int purgeConnectorPool(java.lang.String aConnectorPoolName)
throws DIException
purgeConnectorPool in interface ConfigInstanceaConnectorPoolName - the name of the Connector Pool.
DIException - if an error occurs while shrinking the Connector Pool.
public TDIProperties getTDIProperties()
throws java.lang.Exception
getTDIProperties in interface ConfigInstancejava.lang.Exception - if an error occurs while obtaining a reference to
TDIProperties.public static java.lang.String genGUID(RS aConfigInstance)
aConfigInstance -
public java.lang.String getConfigPath()
Example:
var ci = session
.getConfigInstance("C__Documents and Settings_Username_My Documents_TDI_rs.xml");
task.logmsg("CI path: " + ci.getConfigPath());
//Sample output: CI path: "C:\Documents and Settings\Username\My Documents\TDI"
getConfigPath in interface ConfigInstance
public void addLogListener(LogListener listener)
throws DIException
addLogListener in interface ConfigInstancelistener - Listener for logged messages.
DIException - If an error occurs during registration, e.g. the listener is
null.ConfigInstance.removeLogListener(LogListener)
public void removeLogListener(LogListener listener)
throws DIException
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.
removeLogListener in interface ConfigInstancelistener - Registered listener.
DIException - If an error occurs while unregistering the listener, e.g. the
listener is null or is not registered.ConfigInstance.addLogListener(LogListener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||