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
 void dump(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(String name)
          Returns the the "Attribute Map" for a named connector
 String getConfigPath()
          This method returns the current configuration file path
 Object getConfiguration(String name)
          Returns the entire table or a sub-section of the configuration file.
 ConnectorConfig getConnector(String name)
          Returns the "Connector" entry for name
 FunctionConfig getFunction(String name)
          Returns the "FunctionConfig" entry for name
 LibraryConfig getLibraries()
          Returns all "Libraries"
 Object getLibrary(String name)
          Returns the the "Java Library" entry for name
 Log getLog()
           
 MetamergeConfig getMetamergeConfig()
          Returns the config object for this instance.
 String getName()
           
 String getNullBehavior()
          Return the null behavior string from the System.props
 String getNullBehaviorValue()
          Gets the null behavior value.
 String getNullDefinition()
          Return the null definition string from the System.props
 String getNullDefinitionValue()
          Gets the null definition value.
 ParserConfig getParser(String name)
          Returns the the "Parser" entry for name
 ScriptConfig getScript(String name)
          Returns the the "Script Library" entry for name
 ServerSocketFactory getServerSocketFactory(boolean useSSL)
          Gets a Server Socket Factory for creating Server Sockets.
 String getSysProp(String name)
          Returns the value of a system property.
 AssemblyLineConfig getTask(String name)
          Returns the "AssemblyLine" entry
 void logerror(String msg)
          Writes an error message to the system log file.
 void logmsg(String msg)
          Writes a message to the system log file.
 void logmsg(String level, 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(String assemblyLine, String checkpointID)
          Deprecated. 
 void setConfigPath(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(String assemblyLine)
          Start a named AssemblyLine.
 AssemblyLine startAL(String assemblyLine, Connector connector, Entry work)
          Start named AssemblyLine providing an initial work entry and a connector
 AssemblyLine startAL(String assemblyLine, Object io)
          Start a named AssemblyLine providing various objects.
 

Method Detail

getConfiguration

Object getConfiguration(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(String name)
Returns the "AssemblyLine" entry

Parameters:
name - The AssemblyLine name
Returns:
The configuration for the AssemblyLine

getConnector

ConnectorConfig getConnector(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

Object getLibrary(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(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(String name)
Returns the the "Script Library" entry for name

Parameters:
name - The script library name
Returns:
The section for name

getAttributeMap

AttributeMapConfig getAttributeMap(String name)
Returns the the "Attribute Map" for a named connector

Parameters:
name - The connector name
Returns:
The attribute map section

getFunction

FunctionConfig getFunction(String name)
                           throws Exception
Returns the "FunctionConfig" entry for name

Parameters:
name - The name of the function
Returns:
The function config object
Throws:
Exception - if a lookup error occurs.

getSysProp

String getSysProp(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, or null if there is no property with that name
Returns:
The value for the property

persistConfiguration

void persistConfiguration()
                          throws Exception
This method saves the current configuration to disk.

Throws:
Exception - if an error while persisting the configuration occurs.

logmsg

void logmsg(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(String msg)
Writes an error message to the system log file.

Parameters:
msg - The message to output
Since:
7.0

logmsg

void logmsg(String level,
            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(Object o)
Dumps the class and contents of an object to the log file. If this is an Entry, use the dumpEntry(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(String assemblyLine)
                     throws 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:
Exception - if assemblyLine is an unknown AssemblyLine or if any of the connectors cannot be initialized

startAL

AssemblyLine startAL(String assemblyLine,
                     Object io)
                     throws 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 start
io - This Object could either be
  1. an Entry, used as the initial work entry
  2. a Connector, used as a runtime-provided Connector
  3. a Vector that could contain Entry, Connector(s), TCB or a Log objects, used for configuring the AssemblyLine instance.
  4. a TCB, that holds some special configuration fields read by the AssemblyLine
Returns:
The AssemblyLine Thread object
Throws:
Exception - if assemblyLine is an unknown AssemblyLine or if any of the connectors cannot be initialized

startAL

AssemblyLine startAL(String assemblyLine,
                     Connector connector,
                     Entry work)
                     throws Exception
Start named AssemblyLine providing an initial work entry and a connector

Example:

 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 start
connector - The runtime-provided Connector
work - The initial work entry
Returns:
The AssemblyLine Thread object
Throws:
Exception - if assemblyLine is an unknown AssemblyLine or if any of the connectors cannot be initialized

restartAL

@Deprecated
AssemblyLine restartAL(String assemblyLine,
                                  String checkpointID)
                       throws Exception
Deprecated. 

Restart the AssemblyLine given by the parameter.

Parameters:
assemblyLine - The name identifying the AssemblyLine to start
checkpointID - The checkpoint identifier
Returns:
The AssemblyLine Thread object
Throws:
Exception - if assemblyLine is an unknown AssemblyLine or if any of the connectors cannot be re-initialized

reload

void reload()
            throws Exception
This method reloads the configuration file.

Throws:
Exception - if the operation fails.

getConfigPath

String getConfigPath()
This method returns the current configuration file path

Returns:
The configuration file path as a string

setConfigPath

void setConfigPath(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

String getNullBehavior()
Return the null behavior string from the System.props

Returns:
the null behavior string

getNullBehaviorValue

String getNullBehaviorValue()
Gets the null behavior value.

Returns:
the null behavior value string or null if it have not been set yet.

getNullDefinition

String getNullDefinition()
Return the null definition string from the System.props

Returns:
the null Definition string

getNullDefinitionValue

String getNullDefinitionValue()
Gets the null definition value.

Returns:
the null definition value string or null if it have not been set yet.

getName

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

ServerSocketFactory getServerSocketFactory(boolean useSSL)
Gets a Server Socket Factory for creating Server Sockets. The boolean parameter useSSL 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