com.ibm.di.server
Class ScriptComponent

java.lang.Object
  extended by com.ibm.di.server.AssemblyLineComponent
      extended by com.ibm.di.server.ScriptComponent

public class ScriptComponent
extends AssemblyLineComponent


Field Summary
 
Fields inherited from class com.ibm.di.server.AssemblyLineComponent
addmap, CHECKPOINT_GETS, connConfig, connector, connPool, handler, imap, INITIALIZE, log, modmap, name, parent, pooledConnector, restartCycle, reusingConnector, SELECT, stats
 
Constructor Summary
ScriptComponent(AssemblyLine parent, String name, ConnectorConfig config, ConnectorInterface conn)
          Constructor
 
Method Summary
 void add(Entry meta)
          This method executes the script.
 void add1(Entry meta)
          This method executes the script.
 void close()
          This method closes the script engine.
 ConnectorConfig getConfiguration()
          This method returns the Connector configuration
 int getType()
          This method returns the mode in which we are executing (e.g.
 void initialize()
          This method initializes the script engine.
 boolean trigger(String oper)
          Calls the hook named oper
 boolean trigger(String oper, Entry work)
          Calls the hook named oper, declaring work as the corresponding bean.
 boolean trigger(String oper, Entry work, Entry conn)
          Calls the hook named oper, declaring work and conn as the corresponding beans.
 boolean willExecute(Entry work)
          Return true/false if this component should be executed.
 
Methods inherited from class com.ibm.di.server.AssemblyLineComponent
callreply, checkInitialize, checkTerminate, debug, delete, deleteEntry, delta, doConnectorInitialize, doConnectorTerminate, dumpEntry, dumpObjects, expandParameters, getBaseConfiguration, getConfig, getConnector, getConnectorParam, getCriteria, getCurrent, getDebug, getDuplicateEntryCount, getFirstDuplicateEntry, getHandler, getLastEntry, getLastReadEntry, getLog, getName, getnext, getnext, getnextClient, getNextDuplicateEntry, getRestartInfoEntry, getStats, handleException, handleSuccess, isCheckpointRestartEnabled, isDeltaMode, isEnabled, isExceptionFatal, logmsg, lookup, lookup, mapEntry, modify, pushback, reconnect, reply, setConnectorParam, setCriteria, setCriteria, setCurrent, setDebug, setDuplicateEntryCount, setErrorObject, setName, setRestartInfoEntry, update, verifySchema, wasConfigurationModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptComponent

public ScriptComponent(AssemblyLine parent,
                       String name,
                       ConnectorConfig config,
                       ConnectorInterface conn)
                throws Exception
Constructor

Throws:
Exception
Method Detail

initialize

public void initialize()
                throws Exception
This method initializes the script engine.

Overrides:
initialize in class AssemblyLineComponent
Throws:
Exception - any exception, which occurs during the initialization of the component and is not handled by the reconnect mechanism or the error hooks; it is also possible that the exception is thrown by some of the initialize hooks

close

public void close()
This method closes the script engine.

Overrides:
close in class AssemblyLineComponent

getConfiguration

public ConnectorConfig getConfiguration()
This method returns the Connector configuration

Overrides:
getConfiguration in class AssemblyLineComponent

getType

public int getType()
This method returns the mode in which we are executing (e.g. Iterator, update etc..). public final static int TYPE_ITERATOR = 0; public final static int TYPE_UPDATE = 1; public final static int TYPE_LOOKUP = 2; public final static int TYPE_DELETE = 3; public final static int TYPE_ADDONLY = 4; public final static int TYPE_CALLREPLY = 5; public final static int TYPE_SCRIPT = 6;

Overrides:
getType in class AssemblyLineComponent
Returns:
The integer value corresponding to the execution mode

add

public void add(Entry meta)
         throws Exception
This method executes the script.

Overrides:
add in class AssemblyLineComponent
Parameters:
meta - The work entry to add
Throws:
Exception - the component is not initialized or the underlying Connector raised an error or some of the user-defined hooks raised an error

add1

public void add1(Entry meta)
          throws Exception
This method executes the script.

Throws:
Exception

trigger

public boolean trigger(String oper)
Description copied from class: AssemblyLineComponent
Calls the hook named oper

Overrides:
trigger in class AssemblyLineComponent
Parameters:
oper - Name of the hook to call
Returns:
True if the hook was executed, false if the hook is not defined or disabled.

trigger

public boolean trigger(String oper,
                       Entry work)
Description copied from class: AssemblyLineComponent
Calls the hook named oper, declaring work as the corresponding bean. The trigger function calls one of the AssemblyLine hooks defined for this Connector using the provided work.

Overrides:
trigger in class AssemblyLineComponent
Parameters:
oper - Name of the hook to call
work - This will be the work bean in the hook
Returns:
True if the hook was executed, false if the hook is not defined or disabled.

trigger

public boolean trigger(String oper,
                       Entry work,
                       Entry conn)
Description copied from class: AssemblyLineComponent
Calls the hook named oper, declaring work and conn as the corresponding beans. The trigger function calls one of the AssemblyLine hooks defined for this Connector using the provided conn/work.

Overrides:
trigger in class AssemblyLineComponent
Parameters:
oper - Name of the hook to call
work - This will be the work bean in the hook
conn - This will be the conn bean in the hook
Returns:
True if the hook was executed, false if the hook is not defined or disabled.

willExecute

public boolean willExecute(Entry work)
                    throws Exception
Return true/false if this component should be executed.

Overrides:
willExecute in class AssemblyLineComponent
Parameters:
work - The current work Entry
Returns:
True if this component is enabled
Throws:
Exception - Any exception thrown by the executed hook