com.ibm.di.server
Class ScriptComponent

java.lang.Object
  extended by com.ibm.di.server.AssemblyLineComponent
      extended by com.ibm.di.server.ScriptComponent
All Implemented Interfaces:
Map

public class ScriptComponent
extends AssemblyLineComponent

This class is used by the AssemblyLine for scripts.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class com.ibm.di.server.AssemblyLineComponent
addmap, CHECKPOINT_GETS, config, connConfig, connector, connPool, END_OF_DATA, handler, HOOKS_INVOKED, imap, INITIALIZE, initializeCount, LAST_CONN, LAST_ERROR, log, modmap, name, NUM_ADD, NUM_CALLREPLY, NUM_DELETE, NUM_ERRORS, NUM_GET, NUM_GET_TRIES, NUM_GETCLIENT, NUM_GETCLIENT_TRIES, NUM_IGNORED, NUM_LOOKUP, NUM_MODIFY, NUM_NOCHANGE, NUM_SKIPPED, parent, pooledConnector, reusingConnector, SELECT, stats, SUCCESSFUL
 
Constructor Summary
ScriptComponent(AssemblyLine parent, String name, ConnectorConfig config, ConnectorInterface conn)
          Constructor for the script component object.
ScriptComponent(AssemblyLine parent, String name, ScriptConfig 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
 ScriptConfig getScriptConfiguration()
          This method returns the Script configuration.
 int getType()
          Returns ServerConstants.TYPE_SCRIPT
 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, clear, componentInitialized, containsKey, containsValue, debug, delete, deleteEntry, delta, doConnectorInitialize, doConnectorTerminate, dumpEntry, dumpObjects, entrySet, executeOperation, expandParameters, failBack, failOver, get, getBaseConfiguration, getConfig, getConnector, getConnectorParam, getCriteria, getCurrent, getDebug, getDuplicateEntryCount, getFirstDuplicateEntry, getHandler, getLastEntry, getLastReadEntry, getLog, getName, getnext, getnext, getnextClient, getNextDuplicateEntry, getRestartInfoEntry, getSimulatingState, getStats, handleException, handleSuccess, isCheckpointRestartEnabled, isDeltaMode, isEmpty, isEnabled, isExceptionFatal, isFailOvered, keySet, logmsg, lookup, lookup, mapEntry, modify, pushback, put, putAll, reconnect, remove, reply, resetStatus, setConnectorParam, setCriteria, setCriteria, setCurrent, setDebug, setDuplicateEntryCount, setErrorObject, setName, setRestartInfoEntry, setSimulatingState, setSuccessful, size, toString, triggerImpl, update, useInputMap, useMap, useMap, useOutputMap, values, verifySchema, wasConfigurationModified, wasSuccessful
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

ScriptComponent

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

Parameters:
parent - the AssemblyLine using this component
name - the name of hte component
config - script configuration of this component
conn - an optional connector to use if needed
Throws:
Exception - if problem occurs

ScriptComponent

public ScriptComponent(AssemblyLine parent,
                       String name,
                       ConnectorConfig config,
                       ConnectorInterface conn)
                throws Exception
Constructor for the script component object.

Parameters:
parent - the parent AssemblyLine.
name - the component's name given by the ÀssemblyLine.
config - the configuration.
conn - an optional connector to use if needed
Throws:
Exception - if problem occurs
Method Detail

initialize

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

Overrides:
initialize in class AssemblyLineComponent
Throws:
Exception - if initialization encounters problems

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
Returns:
the connector configuration.

getScriptConfiguration

public ScriptConfig getScriptConfiguration()
This method returns the Script configuration.

Returns:
the script configuration
Since:
7.0

getType

public int getType()
Returns ServerConstants.TYPE_SCRIPT

Overrides:
getType in class AssemblyLineComponent
Returns:
the ServerConstants.TYPE_SCRIPT value

add

public void add(Entry meta)
         throws Exception
This method executes the script. If an error occurs, it will also declare the error bean.

Overrides:
add in class AssemblyLineComponent
Parameters:
meta - Entry parameter
Throws:
Exception - if error occurs

add1

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

Parameters:
meta - Entry parameter
Throws:
Exception - if error occurs

trigger

public boolean trigger(String oper)
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)
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)
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 work Entry object
Returns:
true if this component should be executed, otherwise false
Throws:
Exception - if problem occurs