|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.server.AssemblyLineComponent
public class AssemblyLineComponent
This class is used by the AssemblyLine (AssemblyLine) to wrap a Connector object and provide additional functionality over the underlying Connector object. All attribute mapping and hook handling is performed by this class.
The underlying Connector object is exposed as a property called connector. This class is also the root class of a hierarchy of classes which represent components which can be hosted in an AssemblyLine (for example Function Components, Script Components, Branch Components, Loop Components, etc.)
Field Summary | |
---|---|
protected AttributeMapping |
addmap
|
static String |
CHECKPOINT_GETS
|
protected ConnectorConfig |
config
This is our configuration (with attribute maps, hooks etc ...) |
protected RawConnectorConfig |
connConfig
This is the configuration of the ConnectorInterface |
ConnectorInterface |
connector
This is the connector we are working with. |
protected ConnectorPool |
connPool
Holds the Connector Pool object when a pooled Connector is used |
protected AttributeMapping |
handler
This is the object performing hooks |
protected AttributeMapping |
imap
These are the objects performing input and output attribute mapping |
protected static String |
INITIALIZE
|
protected Log |
log
This is the Log object we use for logging |
protected AttributeMapping |
modmap
|
protected String |
name
This is the connector name as given by the AssemblyLine |
protected TaskInterface |
parent
This is the parent task (AssemblyLine) |
protected boolean |
pooledConnector
Indicates whether this Connector is got from a Connector Pool |
protected long |
restartCycle
This is the number of cycles to skip if we are doing a simple restart for an Iterator |
protected boolean |
reusingConnector
Flag to avoid closing reused connector |
protected static String |
SELECT
|
TaskStatistics |
stats
This is the statistics object for the connector |
Constructor Summary | |
---|---|
AssemblyLineComponent()
Empty Constructor for the AssemblyLineComponent object |
|
AssemblyLineComponent(TaskInterface parent,
String name,
ConnectorConfig config,
ConnectorInterface conn)
Constructor for the AssemblyLineComponent object |
|
AssemblyLineComponent(TaskInterface parent,
String name,
ConnectorConfig config,
ConnectorInterface conn,
boolean forceRuntime)
|
Method Summary | |
---|---|
void |
add(Entry meta)
This method implements the AddOnly mode operation. |
void |
callreply(Entry meta)
This method implements the CallReply mode operation. |
boolean |
checkInitialize()
Checks whether the connector needs to be (re)initialized or not. |
boolean |
checkTerminate()
Checks whether the connector should be terminated (e.g. |
void |
close()
This method closes the connector (connector.terminate()) and calls the before/after close hooks. |
void |
debug(String msg)
Write a message to the logfile prefixed by this connector's name |
void |
delete(Entry meta)
This method implements the Delete mode operation. |
void |
deleteEntry(Entry meta)
This method calls the delete method. |
void |
delta(Entry meta)
This method implements the Delta mode operation. |
void |
doConnectorInitialize()
This method calls the appropriate hooks and the connector's initialize method. |
void |
doConnectorTerminate()
This method calls the appropriate hooks and the connector's terminate method. |
void |
dumpEntry(Entry meta)
Deprecated. replaced by add(Entry) |
protected void |
dumpObjects(Entry conn,
Entry work,
Entry current)
|
void |
expandParameters(BaseConfiguration cf)
Deprecated. |
BaseConfiguration |
getBaseConfiguration()
This method returns the BaseConfiguration |
Object |
getConfig(String param)
This method returns the configuration value for a parameter |
ConnectorConfig |
getConfiguration()
This method returns the Connector configuration |
ConnectorInterface |
getConnector()
Returns the ConnectorInterface we are working with |
Object |
getConnectorParam(String param)
This method returns the configuration value for the ConnectorInterface's parameter. |
SearchCriteria |
getCriteria()
This method returns the link criteria |
Entry |
getCurrent()
Gets the current attribute of the AssemblyLineComponent object |
boolean |
getDebug()
This method returns the debug mode flag. |
int |
getDuplicateEntryCount()
Gets the count of duplicate Entries found by the last findEntry by the ConnectorInterface |
Entry |
getFirstDuplicateEntry()
Gets the first Duplicate Entry from the ConnectorInterface. |
AttributeMapping |
getHandler()
|
Entry |
getLastEntry()
This method returns the last entry read and mapped. |
Entry |
getLastReadEntry()
This method returns the last entry read from the connector. |
Log |
getLog()
Returns the log object |
String |
getName()
This method returns the name assigned to the Connector by the AssemblyLine. |
Entry |
getnext()
The method returns the next entry from the connector. |
Entry |
getnext(Entry work)
The method returns the next entry from the connector. |
ConnectorInterface |
getnextClient()
The method returns the next client from the connector. |
Entry |
getNextDuplicateEntry()
Gets the next Duplicate Entry from the ConnectorInterface. |
Entry |
getRestartInfoEntry()
This method returns the connector's restart info entry. |
TaskStatistics |
getStats()
Gets the stats attribute of the AssemblyLineComponent object |
int |
getType()
This method returns the mode in which we are executing (e.g. |
void |
handleException(String aOper,
Throwable e,
Entry meta)
This method is called by the AssemblyLine. |
void |
handleSuccess(String oper,
Entry meta)
This method is called by the AssemblyLine if the operation oper is successful. |
void |
initialize()
This method initializes the underlying connector and registers the script beans in the ScriptEngine context. |
boolean |
isCheckpointRestartEnabled()
|
boolean |
isDeltaMode()
Returns true if we are in Delta mode. |
boolean |
isEnabled()
Returns true if this Component is enabled in this AssemblyLine |
boolean |
isExceptionFatal(Exception e)
Returns true if an exception is fatal |
void |
logmsg(String msg)
Write a message to the logfile prefixed by this connector's name |
Entry |
lookup(Entry meta)
The method is called to lookup an entry using the configured Link Criteria. |
Entry |
lookup(String attribute,
String value)
The method is called to lookup an entry using exact matching for attribute and value. |
Entry |
mapEntry(Entry work,
Entry conn)
The method is called to map an entry using the configured input attribute map. |
void |
modify(Entry old,
Entry meta)
This method implements the Modify operation (called by Update if the entry exists) |
void |
pushback(Entry entry)
This method pushes an entry back to the connector. |
boolean |
reconnect()
Cause the underlying ConnectorInterface to reconnect to it's data source |
void |
reply(Entry meta)
This method is used to send a reply entry to a connector |
void |
setConnectorParam(String param,
Object value)
This method sets the configuration value for the ConnectorInterface's parameter. |
void |
setCriteria(SearchCriteria mySearchCrit)
This method sets the link criteria for this AssemblyLineComponent |
boolean |
setCriteria(SearchCriteria mySearchCrit,
Entry work)
This method sets the link criteria template for this AssemblyLineComponent, and then expands the template using the given work Entry. |
void |
setCurrent(Entry current)
Sets the current attribute of the AssemblyLineComponent object |
void |
setDebug(boolean debug)
This method sets the the debug mode flag. |
void |
setDuplicateEntryCount(int maxdup)
Sets the max number of duplicate entries for the ConnectorInterface |
void |
setErrorObject(String oper,
String reason)
Deprecated. Not used anymore |
void |
setName(String name)
|
void |
setRestartInfoEntry(ALState state,
Entry rsi,
int restartPoint)
|
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. |
void |
update(Entry meta)
This method implements the Update mode operation. |
void |
verifySchema(Entry entry,
boolean input)
Verify contents of an entry according to connector's schema definition |
boolean |
wasConfigurationModified()
Returns true if the connection configuration has been modified since last call. |
boolean |
willExecute(Entry work)
Return true/false if this component should be executed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CHECKPOINT_GETS
protected static final String INITIALIZE
protected static final String SELECT
public ConnectorInterface connector
public TaskStatistics stats
protected String name
protected TaskInterface parent
protected boolean reusingConnector
protected AttributeMapping imap
protected AttributeMapping addmap
protected AttributeMapping modmap
protected AttributeMapping handler
protected ConnectorConfig config
protected RawConnectorConfig connConfig
protected Log log
protected long restartCycle
protected boolean pooledConnector
protected ConnectorPool connPool
Constructor Detail |
---|
public AssemblyLineComponent(TaskInterface parent, String name, ConnectorConfig config, ConnectorInterface conn) throws Exception
parent
- The AssemblyLine or EventHandler using this componentname
- The name of this connectorconfig
- The configuration for this connectorconn
- An optional connector to use if we need a (runtime provided) connector
Exception
- Any exception that might occur while loading the configpublic AssemblyLineComponent(TaskInterface parent, String name, ConnectorConfig config, ConnectorInterface conn, boolean forceRuntime) throws Exception
Exception
public AssemblyLineComponent()
Method Detail |
---|
public void setCurrent(Entry current)
current
- The new current valuepublic void setDebug(boolean debug)
debug
- True to enable debug, false to disablepublic void setErrorObject(String oper, String reason)
oper
- The new errorObject valuereason
- The new errorObject valuepublic void setDuplicateEntryCount(int maxdup)
maxdup
- The new maximumpublic String getName()
public void setName(String name)
public Entry getCurrent()
public ConnectorConfig getConfiguration()
public BaseConfiguration getBaseConfiguration()
public Object getConfig(String param)
param
- The parameter name
public Object getConnectorParam(String param)
param
- The parameter name
public void setConnectorParam(String param, Object value)
param
- The parameter namevalue
- The parameter valuepublic ConnectorInterface getConnector()
public boolean getDebug()
public SearchCriteria getCriteria()
public void setCriteria(SearchCriteria mySearchCrit)
mySearchCrit
- The link criteria to setpublic boolean setCriteria(SearchCriteria mySearchCrit, Entry work)
mySearchCrit
- The Sriteria to setwork
- The Entry to use for expansion.
public int getType()
public boolean isDeltaMode()
public Entry getLastReadEntry()
public Entry getLastEntry()
public ConnectorInterface getnextClient() throws Exception
Exception
- Errors that may occurpublic Entry getnext() throws Exception
Exception
- Errors that may occurpublic Entry getnext(Entry work) throws Exception
work
- The work entry to fill in
Exception
- Errors that may occurpublic TaskStatistics getStats()
public Log getLog()
public AttributeMapping getHandler()
public boolean isExceptionFatal(Exception e)
e
- The exception to check
public int getDuplicateEntryCount()
public Entry getFirstDuplicateEntry() throws Exception
Exception
- Any exceptions thrown by the connector's underlying classespublic Entry getNextDuplicateEntry() throws Exception
Exception
- Any exceptions thrown by the connector's underlying classespublic boolean isEnabled()
public void close() throws Exception
Exception
public boolean willExecute(Entry work) throws Exception
work
- The current work Entry
Exception
- Any exception thrown by the executed hookpublic void initialize() throws Exception
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 hookspublic void pushback(Entry entry)
entry
- The entry to push backpublic void doConnectorInitialize() throws Exception
Exception
public void doConnectorTerminate() throws Exception
Exception
public Entry lookup(String attribute, String value) throws Exception
attribute
- The attribute name to searchvalue
- The attribute value
Exception
- Any exceptions thrown by the underlying connectorpublic Entry lookup(Entry meta) throws Exception
meta
- The entry object providing values for variable substitution.
Exception
- the component is not initialized or
the underlying Connector raised an error or
some of the user-defined hooks raised an errorpublic void deleteEntry(Entry meta) throws Exception
meta
- The work object to use for the link criteria
Exception
- Any Exceptiondelete( Entry )
public void delete(Entry meta) throws Exception
meta
- The work object to use for the link criteria
Exception
- the component is not initialized or
the underlying Connector raised an error or
some of the user-defined hooks raised an errorpublic void update(Entry meta) throws Exception
meta
- The work entry
Exception
- the component is not initialized or
the underlying Connector raised an error or
some of the user-defined hooks raised an errorpublic void modify(Entry old, Entry meta) throws Exception
old
- The current entry in the destination systemmeta
- The new entry to use in the attribute map
Exception
- Any Exceptionpublic void add(Entry meta) throws Exception
meta
- The work entry to add
Exception
- the component is not initialized or
the underlying Connector raised an error or
some of the user-defined hooks raised an errorpublic void reply(Entry meta) throws Exception
meta
- The work entry to add
Exception
- the component is not initialized or
the underlying Connector raised an error or
some of the user-defined hooks raised an errorpublic void callreply(Entry meta) throws Exception
meta
- The work entry to send
Exception
- the component is not initialized or
the underlying Connector raised an error or
some of the user-defined hooks raised an errorpublic void delta(Entry meta) throws Exception
meta
- The delta entry
Exception
- Any Exceptionpublic void dumpEntry(Entry meta) throws Exception
add(Entry)
meta
- an Entry to be added to the data source by the Connector
Exception
- problem while adding the Entry to the data sourcepublic void logmsg(String msg)
msg
- The message to writepublic void debug(String msg)
msg
- The message to writepublic void handleException(String aOper, Throwable e, Entry meta) throws Exception
aOper
- Hook prefixe
- The error causing this hook to be called, or null for no errormeta
- The work entry
Exception
- Throws the parameter e if we cannot or do not want to handle it,
or an Exception from the Hooks.public void handleSuccess(String oper, Entry meta) throws Exception
oper
- Hook prefixmeta
- The work entry
Exception
- Any Exception from the Hookspublic boolean trigger(String oper, Entry work, Entry conn) throws Exception
oper
- Name of the hook to callwork
- This will be the work bean in the hookconn
- This will be the conn bean in the hook
Exception
- Any exception thrown by the execution of the hookpublic boolean trigger(String oper, Entry work) throws Exception
oper
- Name of the hook to callwork
- This will be the work bean in the hook
Exception
- Any exception thrown by the execution of the hookpublic boolean trigger(String oper) throws Exception
oper
- Name of the hook to call
Exception
- Any exception thrown by the execution of the hookpublic void expandParameters(BaseConfiguration cf) throws Exception
Exception
public void verifySchema(Entry entry, boolean input) throws Exception
Exception
public Entry getRestartInfoEntry() throws Exception
Exception
public boolean isCheckpointRestartEnabled() throws Exception
Exception
public void setRestartInfoEntry(ALState state, Entry rsi, int restartPoint) throws Exception
Exception
protected void dumpObjects(Entry conn, Entry work, Entry current)
public boolean reconnect() throws Exception
Exception
public Entry mapEntry(Entry work, Entry conn) throws Exception
work
- The work entryconn
- The conn entry
Exception
- problem while mapping the entrypublic boolean checkInitialize() throws Exception
Exception
public boolean checkTerminate() throws Exception
Exception
public boolean wasConfigurationModified()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |