Package com.ibm.di.server
Interface RSInterface
-
- All Known Implementing Classes:
RS
public interface RSInterface
The top level Thread is an instance of this class, called the main object. It has methods for manipulating AssemblyLines.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
dump(java.lang.Object o)
Dumps the class and contents of an object to the log file.void
dumpEntry(Entry e)
Dumps the contents of an Entry to the log file.AttributeMapConfig
getAttributeMap(java.lang.String name)
Returns the the "Attribute Map" for a named connectorjava.lang.String
getConfigPath()
This method returns the current configuration file pathjava.lang.Object
getConfiguration(java.lang.String name)
Returns the entire table or a sub-section of the configuration file.ConnectorConfig
getConnector(java.lang.String name)
Returns the "Connector" entry for nameFunctionConfig
getFunction(java.lang.String name)
Returns the "FunctionConfig" entry for nameLibraryConfig
getLibraries()
Returns all "Libraries"java.lang.Object
getLibrary(java.lang.String name)
Returns the the "Java Library" entry for nameLog
getLog()
MetamergeConfig
getMetamergeConfig()
Returns the config object for this instance.java.lang.String
getName()
java.lang.String
getNullBehavior()
Return the null behavior string from the System.propsjava.lang.String
getNullBehaviorValue()
Gets the null behavior value.java.lang.String
getNullDefinition()
Return the null definition string from the System.propsjava.lang.String
getNullDefinitionValue()
Gets the null definition value.ParserConfig
getParser(java.lang.String name)
Returns the the "Parser" entry for nameScriptConfig
getScript(java.lang.String name)
Returns the the "Script Library" entry for namejavax.net.ServerSocketFactory
getServerSocketFactory(boolean useSSL)
Gets a Server Socket Factory for creating Server Sockets.java.lang.String
getSysProp(java.lang.String name)
Returns the value of a system property.AssemblyLineConfig
getTask(java.lang.String name)
Returns the "AssemblyLine" entryvoid
logerror(java.lang.String msg)
Writes an error message to the system log file.void
logmsg(java.lang.String msg)
Writes a message to the system log file.void
logmsg(java.lang.String level, java.lang.String msg)
This method logs a message with the specified level to the log.void
persistConfiguration()
This method saves the current configuration to disk.void
reload()
This method reloads the configuration file.AssemblyLine
restartAL(java.lang.String assemblyLine, java.lang.String checkpointID)
Deprecated.void
setConfigPath(java.lang.String path)
This method sets the current configuration file path.void
setMetamergeConfig(MetamergeConfig config)
Sets the given configuration to this instance.void
shutdownServer()
Raise the shutdown request flag and set the exit code to 0.void
shutdownServer(int aExitCode)
Raise the shutdown request flag and specify an exit code.AssemblyLine
startAL(java.lang.String assemblyLine)
Start a named AssemblyLine.AssemblyLine
startAL(java.lang.String assemblyLine, Connector connector, Entry work)
Start named AssemblyLine providing an initial work entry and a connectorAssemblyLine
startAL(java.lang.String assemblyLine, java.lang.Object io)
Start a named AssemblyLine providing various objects.
-
-
-
Method Detail
-
getConfiguration
java.lang.Object getConfiguration(java.lang.String name)
Returns the entire table or a sub-section of the configuration file.- Parameters:
name
- Name of subsection or null- Returns:
- The entire table (name == null) or section in table
-
getMetamergeConfig
MetamergeConfig getMetamergeConfig()
Returns the config object for this instance.- Returns:
- the configuration object of this instance.
-
setMetamergeConfig
void setMetamergeConfig(MetamergeConfig config)
Sets the given configuration to this instance.- Parameters:
config
- The configuration object to assign to the instance.
-
getTask
AssemblyLineConfig getTask(java.lang.String name)
Returns the "AssemblyLine" entry- Parameters:
name
- The AssemblyLine name- Returns:
- The configuration for the AssemblyLine
-
getConnector
ConnectorConfig getConnector(java.lang.String name)
Returns the "Connector" entry for name- Parameters:
name
- The connector name- Returns:
- The section from either the file configuration or the templates configuration
-
getLibrary
java.lang.Object getLibrary(java.lang.String name)
Returns the the "Java Library" entry for name- Parameters:
name
- The java library name- Returns:
- The section for name
-
getLibraries
LibraryConfig getLibraries()
Returns all "Libraries"- Returns:
- The entire list of Libraries
-
getParser
ParserConfig getParser(java.lang.String name)
Returns the the "Parser" entry for name- Parameters:
name
- The parser name- Returns:
- The section either the file configuration or the templates configuration
-
getScript
ScriptConfig getScript(java.lang.String name)
Returns the the "Script Library" entry for name- Parameters:
name
- The script library name- Returns:
- The section for name
-
getAttributeMap
AttributeMapConfig getAttributeMap(java.lang.String name)
Returns the the "Attribute Map" for a named connector- Parameters:
name
- The connector name- Returns:
- The attribute map section
-
getFunction
FunctionConfig getFunction(java.lang.String name) throws java.lang.Exception
Returns the "FunctionConfig" entry for name- Parameters:
name
- The name of the function- Returns:
- The function config object
- Throws:
java.lang.Exception
- if a lookup error occurs.
-
getSysProp
java.lang.String getSysProp(java.lang.String name)
Returns the value of a system property. The system properties include all Java system properties as well as TDI's own properties.- Parameters:
name
- The system property name, ornull
if there is no property with that name- Returns:
- The value for the property
-
persistConfiguration
void persistConfiguration() throws java.lang.Exception
This method saves the current configuration to disk.- Throws:
java.lang.Exception
- if an error while persisting the configuration occurs.
-
logmsg
void logmsg(java.lang.String msg)
Writes a message to the system log file.Example:
main.logmsg("Conn object: "); main.dumpEntry(conn);
- Parameters:
msg
- The message to be output.
-
logerror
void logerror(java.lang.String msg)
Writes an error message to the system log file.- Parameters:
msg
- The message to output- Since:
- 7.0
-
logmsg
void logmsg(java.lang.String level, java.lang.String msg)
This method logs a message with the specified level to the log.Example:
main.logmsg("INFO", "Reading entry..."); var entry = input.getConnector().getNextEntry();
- Parameters:
level
- Level of log. Legal values are FATAL, ERROR, WARN, INFO, DEBUG. Unrecognized keyword means DEBUG.msg
- The message
-
dump
void dump(java.lang.Object o)
Dumps the class and contents of an object to the log file. If this is an Entry, use thedumpEntry(Entry)
method instead.- Parameters:
o
- The object to dump- See Also:
dumpEntry(Entry)
-
dumpEntry
void dumpEntry(Entry e)
Dumps the contents of an Entry to the log file.Example:
var ctor = input.getConnector(); for (;;) { var entry = ctor.getNextEntry(); if (entry != null) { main.logmsg("Read entry: "); main.dumpEntry(entry); } else break; }
- Parameters:
e
- The Entry object to dump- See Also:
Entry
-
startAL
AssemblyLine startAL(java.lang.String assemblyLine) throws java.lang.Exception
Start a named AssemblyLine. See also the introduction to AssemblyLines.Example:
var al = main.startAL("ALName"); var tcb = al.getTCB(); main.logmsg("AL run mode: " + tcb.getRunMode()); main.logmsg("AL operation: " + tcb.getALOperation()); main.logmsg("AL settings: "); main.dumpEntry(tcb.getALSettings());
- Parameters:
assemblyLine
- The name identifying the AssemblyLine to start- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception
- ifassemblyLine
is an unknown AssemblyLine or if any of the connectors cannot be initialized
-
startAL
AssemblyLine startAL(java.lang.String assemblyLine, java.lang.Object io) throws java.lang.Exception
Start a named AssemblyLine providing various objects.Example:
var iwe = new com.ibm.di.entry.Entry(); iwe.setAttribute("linenumber", "1"); iwe.setAttribute("", "Some line with text"); var c = new com.ibm.di.connectors.FileConnector(); var al = main.startAL("ALName", iwe); var tcb = al.getTCB(); main.logmsg("AL run mode: " + tcb.getRunMode()); main.logmsg("AL connector 'debug' parameter: " + tcb.getConnectorParameter("ConnectorName", "debug")); main.logmsg("AL initial work entry: "); main.dumpEntry(tcb.getInitialWorkEntry());
- Parameters:
assemblyLine
- The name identifying the AssemblyLine to startio
- This Object could either be- an Entry, used as the initial work entry
- a Connector, used as a runtime-provided Connector
- a Vector that could contain Entry, Connector(s), TCB or a Log objects, used for configuring the AssemblyLine instance.
- a TCB, that holds some special configuration fields read by the AssemblyLine
- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception
- ifassemblyLine
is an unknown AssemblyLine or if any of the connectors cannot be initialized
-
startAL
AssemblyLine startAL(java.lang.String assemblyLine, Connector connector, Entry work) throws java.lang.Exception
Start named AssemblyLine providing an initial work entry and a connectorExample:
var iwe = new com.ibm.di.entry.Entry(); iwe.setAttribute("linenumber", "1"); iwe.setAttribute("line", "Some line with text"); var c = main.getConnector("ConnectorName"); var al = main.startAL("ALName", c, iwe); var tcb = al.getTCB(); main.logmsg("AL run mode: " + tcb.getRunMode()); main.logmsg("AL initial work entry: "); main.dumpEntry(tcb.getInitialWorkEntry());
- Parameters:
assemblyLine
- The name identifying the AssemblyLine to startconnector
- The runtime-provided Connectorwork
- The initial work entry- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception
- ifassemblyLine
is an unknown AssemblyLine or if any of the connectors cannot be initialized
-
restartAL
@Deprecated AssemblyLine restartAL(java.lang.String assemblyLine, java.lang.String checkpointID) throws java.lang.Exception
Deprecated.Restart the AssemblyLine given by the parameter.- Parameters:
assemblyLine
- The name identifying the AssemblyLine to startcheckpointID
- The checkpoint identifier- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception
- ifassemblyLine
is an unknown AssemblyLine or if any of the connectors cannot be re-initialized
-
reload
void reload() throws java.lang.Exception
This method reloads the configuration file.- Throws:
java.lang.Exception
- if the operation fails.
-
getConfigPath
java.lang.String getConfigPath()
This method returns the current configuration file path- Returns:
- The configuration file path as a string
-
setConfigPath
void setConfigPath(java.lang.String path)
This method sets the current configuration file path. This will be used when a persistConfiguration is requested.- Parameters:
path
- The new configuration path
-
shutdownServer
void shutdownServer()
Raise the shutdown request flag and set the exit code to 0. This method requests controlled shutdown of all assembly lines running on the server at the time of calling.
-
shutdownServer
void shutdownServer(int aExitCode)
Raise the shutdown request flag and specify an exit code.- Parameters:
aExitCode
- the code to return when the application exits.
-
getNullBehavior
java.lang.String getNullBehavior()
Return the null behavior string from the System.props- Returns:
- the null behavior string
-
getNullBehaviorValue
java.lang.String getNullBehaviorValue()
Gets the null behavior value.- Returns:
- the null behavior value string or null if it have not been set yet.
-
getNullDefinition
java.lang.String getNullDefinition()
Return the null definition string from the System.props- Returns:
- the null Definition string
-
getNullDefinitionValue
java.lang.String getNullDefinitionValue()
Gets the null definition value.- Returns:
- the null definition value string or null if it have not been set yet.
-
getName
java.lang.String getName()
- Returns:
- The name of this configuration instance.
- Since:
- 7.0
-
getLog
Log getLog()
- Returns:
- The log object of this configuration instance. May be null.
- Since:
- 7.0
-
getServerSocketFactory
javax.net.ServerSocketFactory getServerSocketFactory(boolean useSSL)
Gets a Server Socket Factory for creating Server Sockets. The boolean parameteruseSSL
determines whether a SSL Server Socket Factory is returned or non-SSL one.
This method returns a new instance each time when it is called. The reason for this is that the implementation of the caller may be different. Sometimes SSL Factory may be needed while some other times NOT.
This method is for internal use only and you should not rely on it for any other purpose.- Parameters:
useSSL
- Determines if SSL or non-SSL Server Socket Factory is returns for use.- Returns:
- Server Socket Factory for obtaining Server Sockets.
- Since:
- 7.1
-
-