com.ibm.di.fc
Interface FunctionInterface

All Known Implementing Classes:
AssemblyLineFC, Axis2WSClientFC, AxisEasyInvokeSoapWS, AxisJavaToSoap, AxisSoapToJava, CastorJavaToXML, CastorXMLToJava, CBEGeneratorFC, CloseIdMLFC, ComplexTypesGenerator, DataCleanserFC, DeltaFC, EmfSdoToXml, EmfXmlToSdo, Function, InitITRegistryFC, InvokeSoapWS, JavaClassFC, MemBufferQFC, OpenIdMLFC, ParserFC, RemoteCmdLineFC, RollingIdMLFC, SapR3RfcFC, ScriptedFC, SendEMailFC, WrapSoap, zOSTSOCommandLine

public interface FunctionInterface

This is the interface implemented by Function objects.


Method Summary
 void debug(String aMsg)
          If debug is turned on, logs a message to the currently used log.
 BaseConfiguration getConfiguration()
          Gets the configuration attribute of the FunctionInterface object
 Object getContext()
          Retrieves used defined context.
 Log getLog()
          Returns the logger object in use by this FC
 Object getParam(String param)
          Gets a named parameter in the configuration.
 RSInterface getRSInterface()
          Returns the current RSInterface object in use by this Function.
 Component getUI()
          Deprecated.  
 void initialize(Object obj)
          Called once to initialize the function
 void logmsg(String msg)
          Logs a message to the currently used log
 Object perform(Object obj)
          This is the main method of a Function Component.
 Object querySchema(Object source)
          This method translates to whatever means a function component has to discover schema for a connection.
 void setConfiguration(BaseConfiguration config)
          Sets the configuration attribute of the FunctionInterface object
 void setContext(Object aContext)
          Sets the user defined context.
 void setLog(Log logger)
          Sets the logger object to use in this FC
 void setParam(String param, Object value)
          Sets a named parameter in the configuration.
 void setRSInterface(RSInterface rsi)
          Sets the RSInterface object for this Function.
 void terminate()
          The implementation of this method must take care to cleanup any resources which the Function Component has allocated during its operation.
 boolean updateSchema(FunctionConfig config)
          This method modifies the schema in the provided configuration.
 

Method Detail

initialize

void initialize(Object obj)
                throws Exception
Called once to initialize the function

Parameters:
obj - this object provides information to the Function Component needed on initialization
Throws:
Exception - An exception is thrown if the initialization fails.

perform

Object perform(Object obj)
               throws Exception
This is the main method of a Function Component. This method is called for the Function Component to actually do its job. The implementation of this methods performs the function which the Function Component was created to do.

Parameters:
obj - the input to the function
Returns:
the output from the function
Throws:
Exception - An exception is thrown if this method fails.

terminate

void terminate()
               throws Exception
The implementation of this method must take care to cleanup any resources which the Function Component has allocated during its operation. Software modules which use a Function Component must make sure they call this method so that all resources used by the Function Component are freed properly.

Throws:
Exception - An exception is thrown if this method fails.

getUI

Component getUI()
Deprecated. 

This method returns null.

Returns:
null

getConfiguration

BaseConfiguration getConfiguration()
Gets the configuration attribute of the FunctionInterface object

Returns:
The configuration value

setConfiguration

void setConfiguration(BaseConfiguration config)
Sets the configuration attribute of the FunctionInterface object

Parameters:
config - The new configuration value

updateSchema

boolean updateSchema(FunctionConfig config)
                     throws Exception
This method modifies the schema in the provided configuration. The intent is to allow the FC to provide a schema definition dynamically based on a given configuration.

Parameters:
config - FunctionConfig
Returns:
boolean
Throws:
Exception

getParam

Object getParam(String param)
Gets a named parameter in the configuration.

Parameters:
param - the name of the parameter whose value this method returns
Returns:
the value of the parameter

setParam

void setParam(String param,
              Object value)
Sets a named parameter in the configuration.

Parameters:
param - The new parameter's name
value - The new parameter value

logmsg

void logmsg(String msg)
Logs a message to the currently used log

Parameters:
msg - The message appearing in the log

setLog

void setLog(Log logger)
Sets the logger object to use in this FC

Parameters:
logger - The log object

getLog

Log getLog()
Returns the logger object in use by this FC

Returns:
The log object

debug

void debug(String aMsg)
If debug is turned on, logs a message to the currently used log.

Parameters:
aMsg - The debug message appearing in the log

getContext

Object getContext()
Retrieves used defined context.

Returns:
the user defined context.

setContext

void setContext(Object aContext)
Sets the user defined context.

Parameters:
aContext - String

querySchema

Object querySchema(Object source)
                   throws Exception
This method translates to whatever means a function component has to discover schema for a connection. The specific FC may implement this, in which case a Vector of Entry objects is returned for each column/attribute it discovered.

Each Entry in the Vector returned should contain the following attributes:

Name Value
name The name of the column/attribute/field ....
syntax The syntax or expected value type
size If specified this will give the user a hint as to how long the field may be

Parameters:
source - The object on which to discover schema. This may be an Entry or a string value. Boolean value will tell which schema to discover: true - InputMapSchema, false - OutputMapSchema. If not specified the default will be true. Might be a FunctionConfig object which will be set as the configuration of this object. Could be an array of objects (i.e. Object[]). Only the first object of a specific type will be considered, the rest (if any) will be ignored.
Returns:
A Vector of com.ibm.di.entry.Entry objects describing each entity
Throws:
Exception
See Also:
Entry, Vector

setRSInterface

void setRSInterface(RSInterface rsi)
Sets the RSInterface object for this Function.

Since:
7.0

getRSInterface

RSInterface getRSInterface()
Returns the current RSInterface object in use by this Function. If not set, return com.ibm.di.server.RS.getServer()

Returns:
Function's RSInterface object
Since:
7.0