Class AssemblyLineComponent
- java.lang.Object
-
- com.ibm.di.server.AssemblyLineComponent
-
- All Implemented Interfaces:
java.util.Map
- Direct Known Subclasses:
AttributeMapComponent
,BranchingComponent
,CSDeltaTaskComponent
,EndBranchComponent
,EndLoopComponent
,FunctionComponent
,ReplyChannelComponent
,ScriptComponent
public class AssemblyLineComponent extends java.lang.Object implements java.util.Map
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
Fields Modifier and Type Field Description protected AttributeMapping
addmap
static java.lang.String
CHECKPOINT_GETS
Deprecated.Checkpoint/restart is deprecatedprotected ConnectorConfig
config
This is our configuration (with attribute maps, hooks etc ...)protected RawConnectorConfig
connConfig
This is the configuration of the ConnectorInterfaceConnectorInterface
connector
This is the connector we are working with.protected ConnectorPool
connPool
Holds the Connector Pool object when a pooled Connector is usedstatic java.lang.String
END_OF_DATA
The key used to get the flag which is raised (it's value is set to true) when the the component wrapped by thisAssemblyLineComponent
is in Iterator mode and the feed has been exhausted.protected AttributeMapping
handler
This is the object performing hooksstatic java.lang.String
HOOKS_INVOKED
The key used to get the list of invoked hooks in this cycle.protected AttributeMapping
imap
These are the objects performing input and output attribute mappingprotected static java.lang.String
INITIALIZE
protected int
initializeCount
How many times the component has been initializedstatic java.lang.String
LAST_CONN
The key used to get the last Entry with information from the Connector, or the last Entry that was sent to the Connectorstatic java.lang.String
LAST_ERROR
The key used to get the last error that have occurred.protected Log
log
This is the Log object we use for loggingprotected AttributeMapping
modmap
protected java.lang.String
name
This is the connector name as given by the AssemblyLinestatic java.lang.String
NUM_ADD
The key used to get the number additions this component has made.static java.lang.String
NUM_CALLREPLY
The key used to get the number of call-replays operations this component has executed.static java.lang.String
NUM_DELETE
The key used to get the number of deletions this component has made.static java.lang.String
NUM_ERRORS
The key used to get the number of errors this component has made.static java.lang.String
NUM_GET
The key used to get the number of entries this component has gotten.static java.lang.String
NUM_GET_TRIES
The key used to get the number of times we tried to get an Entry.static java.lang.String
NUM_GETCLIENT
The key used to get the number of the clients this component has connected with.static java.lang.String
NUM_GETCLIENT_TRIES
The key used to get the number of times we tried to get a clientstatic java.lang.String
NUM_IGNORED
The key used to get the number of ignored entries.static java.lang.String
NUM_LOOKUP
The key used to get the number of lookups this component has made.static java.lang.String
NUM_MODIFY
The key used to get the number of modifications this component has made.static java.lang.String
NUM_NOCHANGE
The key used to get the number of no-change entries.static java.lang.String
NUM_SKIPPED
The key used to get the number of skipped entries.protected AssemblyLine
parent
This is the parent task (AssemblyLine)protected boolean
pooledConnector
Indicates whether this Connector is got from a Connector Poolprotected static java.lang.String
SELECT
TaskStatistics
stats
This is the statistics object for the componentstatic java.lang.String
SUCCESSFUL
The key used to get the status the last operation ended with.
-
Constructor Summary
Constructors Constructor Description AssemblyLineComponent()
Empty Constructor for the AssemblyLineComponent objectAssemblyLineComponent(TaskInterface parent, java.lang.String name, ConnectorConfig config, ConnectorInterface conn)
Constructor for theAssemblyLineComponent
objectAssemblyLineComponent(TaskInterface parent, java.lang.String name, ConnectorConfig config, ConnectorInterface conn, boolean forceRuntime)
Constructor for theAssemblyLineComponent
object
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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
clear()
void
close()
This method closes the connector (connector.terminate()) and calls the before/after close hooks.boolean
componentInitialized()
Returns true if component is initializedboolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object val)
Returns true if a key maps to this value.void
debug(java.lang.String msg)
Write a message to the log file prefixed by this connector's namevoid
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
doConnectorTerminate(boolean force)
This method calls the appropriate hooks and the connector's terminate method.void
dumpEntry(Entry meta)
Deprecated.replaced byadd(com.ibm.di.entry.Entry)
protected void
dumpObjects(Entry conn, Entry work, Entry current)
java.util.Set<java.util.Map.Entry>
entrySet()
protected java.lang.Object
executeOperation(int operation, Entry work, Entry conn, SearchCriteria search, Entry current)
This method is used to take care of dangerous/safe operations when the AL is simulatingvoid
expandParameters(BaseConfiguration cf)
Deprecated.boolean
failBack(Entry work, Entry error)
Attempt to fall back to the original connector after a failOver.boolean
failOver(Entry work, Entry error)
Attempt a failOver.java.lang.Object
get(java.lang.Object propName)
BaseConfiguration
getBaseConfiguration()
java.lang.Object
getConfig(java.lang.String param)
This method returns the configuration value for a parameterConnectorConfig
getConfiguration()
ConnectorInterface
getConnector()
Returns the ConnectorInterface we are working withjava.lang.Object
getConnectorParam(java.lang.String param)
This method returns the ConnectorInterface attached to this AL component.SearchCriteria
getCriteria()
This method returns the link criteriaEntry
getCurrent()
Gets the current entry of the AssemblyLineComponent objectboolean
getDebug()
This method returns the debug mode flag.int
getDuplicateEntryCount()
Gets the count of duplicate Entries found by the last findEntry by the ConnectorInterfaceEntry
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 objectjava.lang.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()
Deprecated.java.lang.String
getSimulatingState()
The state of this component.TaskStatistics
getStats()
Gets the stats attribute of the AssemblyLineComponent objectint
getType()
This method returns the mode of a Connector, or the type constant for any other type of component.void
handleException(java.lang.String aOper, java.lang.Throwable e, Entry meta)
This method is called by the AssemblyLine.void
handleSuccess(java.lang.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()
Deprecated.boolean
isDeltaMode()
boolean
isEmpty()
Returns false.boolean
isEnabled()
Returns true if this Component is enabled in this AssemblyLineboolean
isExceptionFatal(java.lang.Exception e)
Returns true if an exception is fatalboolean
isFailOvered()
Returns true when using the failover connector.java.util.Set
keySet()
void
logmsg(java.lang.String msg)
Write a message to the log file prefixed by this connector's nameEntry
lookup(Entry meta)
The method is called to lookup an entry using the configured Link Criteria.Entry
lookup(java.lang.String attribute, java.lang.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.java.lang.Object
put(java.lang.Object propName, java.lang.Object propValue)
void
putAll(java.util.Map map)
boolean
reconnect()
Cause the underlying ConnectorInterface to reconnect to it's data sourcejava.lang.Object
remove(java.lang.Object propName)
void
reply(Entry meta)
This method is used to send a reply entry to a connectorvoid
resetStatus()
This method resets the Properties of this AssemblyLineComponent.void
setConnectorParam(java.lang.String param, java.lang.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 AssemblyLineComponentboolean
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 entry of theAssemblyLineComponent
objectvoid
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(java.lang.String oper, java.lang.String reason)
Deprecated.Not used anymorevoid
setName(java.lang.String name)
This method assigns a name to the Connector.void
setRestartInfoEntry(ALState state, Entry rsi, int restartPoint)
Deprecated.void
setSimulatingState(java.lang.String state)
This methods defines the behavior of a Component when the AL is simulatingvoid
setSuccessful(boolean b)
Sets the value that will be returned from wasSuccessful().int
size()
java.lang.String
toString()
Returns the name and class of this componentboolean
trigger(java.lang.String oper)
Calls the hook named operboolean
trigger(java.lang.String oper, Entry work)
Calls the hook named oper, declaring work as the corresponding bean.boolean
trigger(java.lang.String oper, Entry work, Entry conn)
Calls the hook named oper, declaring work and conn as the corresponding beans.protected boolean
triggerImpl(java.lang.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
useAttributeMap(java.lang.String fileName)
Load an attribute map from a file and use it for the default map.void
useAttributeMap(java.lang.String fileName, boolean extend)
Load an attribute map from a file and use it for the default map.void
useAttributeMap(java.lang.String fileName, boolean input, boolean extend)
Load an attribute map from a file and use it for the specified map.void
useInputMap(AttributeMapConfig map)
Sets the provided AttributeMapConfig to be used for input mapping.void
useMap(java.lang.String attributeMapName)
Sets the named Attribute Map to be used for input and output mapping.void
useMap(java.lang.String attributeMapName, boolean input)
Sets the named Attribute Map to be used for input or output mapping.void
useOutputMap(AttributeMapConfig map)
Sets the provided AttributeMapConfig to be used for output mapping.java.util.Collection
values()
Returns the values in this Map.void
verifySchema(Entry entry, boolean input)
Deprecated.boolean
wasConfigurationModified()
boolean
wasSuccessful()
Returns true if this component was successfully executed the last time it was called.boolean
willExecute(Entry work)
Return true/false if this component should be executed.
-
-
-
Field Detail
-
CHECKPOINT_GETS
public static final java.lang.String CHECKPOINT_GETS
Deprecated.Checkpoint/restart is deprecated- See Also:
- Constant Field Values
-
INITIALIZE
protected static final java.lang.String INITIALIZE
- See Also:
- Constant Field Values
-
SELECT
protected static final java.lang.String SELECT
- See Also:
- Constant Field Values
-
NUM_ERRORS
public static final java.lang.String NUM_ERRORS
The key used to get the number of errors this component has made.- See Also:
- Constant Field Values
-
NUM_ADD
public static final java.lang.String NUM_ADD
The key used to get the number additions this component has made.- See Also:
- Constant Field Values
-
NUM_MODIFY
public static final java.lang.String NUM_MODIFY
The key used to get the number of modifications this component has made.- See Also:
- Constant Field Values
-
NUM_DELETE
public static final java.lang.String NUM_DELETE
The key used to get the number of deletions this component has made.- See Also:
- Constant Field Values
-
NUM_GET
public static final java.lang.String NUM_GET
The key used to get the number of entries this component has gotten.- See Also:
- Constant Field Values
-
NUM_GET_TRIES
public static final java.lang.String NUM_GET_TRIES
The key used to get the number of times we tried to get an Entry.- See Also:
- Constant Field Values
-
NUM_GETCLIENT
public static final java.lang.String NUM_GETCLIENT
The key used to get the number of the clients this component has connected with.- See Also:
- Constant Field Values
-
NUM_GETCLIENT_TRIES
public static final java.lang.String NUM_GETCLIENT_TRIES
The key used to get the number of times we tried to get a client- See Also:
- Constant Field Values
-
NUM_CALLREPLY
public static final java.lang.String NUM_CALLREPLY
The key used to get the number of call-replays operations this component has executed.- See Also:
- Constant Field Values
-
NUM_LOOKUP
public static final java.lang.String NUM_LOOKUP
The key used to get the number of lookups this component has made.- See Also:
- Constant Field Values
-
NUM_NOCHANGE
public static final java.lang.String NUM_NOCHANGE
The key used to get the number of no-change entries.- See Also:
- Constant Field Values
-
NUM_SKIPPED
public static final java.lang.String NUM_SKIPPED
The key used to get the number of skipped entries.- See Also:
- Constant Field Values
-
NUM_IGNORED
public static final java.lang.String NUM_IGNORED
The key used to get the number of ignored entries.- See Also:
- Constant Field Values
-
LAST_ERROR
public static final java.lang.String LAST_ERROR
The key used to get the last error that have occurred.- See Also:
- Constant Field Values
-
SUCCESSFUL
public static final java.lang.String SUCCESSFUL
The key used to get the status the last operation ended with.- See Also:
- Constant Field Values
-
LAST_CONN
public static final java.lang.String LAST_CONN
The key used to get the last Entry with information from the Connector, or the last Entry that was sent to the Connector- See Also:
- Constant Field Values
-
HOOKS_INVOKED
public static final java.lang.String HOOKS_INVOKED
The key used to get the list of invoked hooks in this cycle.- See Also:
- Constant Field Values
-
END_OF_DATA
public static final java.lang.String END_OF_DATA
The key used to get the flag which is raised (it's value is set to true) when the the component wrapped by thisAssemblyLineComponent
is in Iterator mode and the feed has been exhausted.- See Also:
- Constant Field Values
-
connector
public ConnectorInterface connector
This is the connector we are working with. See getConnector()
-
stats
public TaskStatistics stats
This is the statistics object for the component
-
name
protected java.lang.String name
This is the connector name as given by the AssemblyLine
-
parent
protected AssemblyLine parent
This is the parent task (AssemblyLine)
-
imap
protected AttributeMapping imap
These are the objects performing input and output attribute mapping
-
addmap
protected AttributeMapping addmap
-
modmap
protected AttributeMapping modmap
-
handler
protected AttributeMapping handler
This is the object performing hooks
-
config
protected ConnectorConfig config
This is our configuration (with attribute maps, hooks etc ...)
-
connConfig
protected RawConnectorConfig connConfig
This is the configuration of the ConnectorInterface
-
log
protected Log log
This is the Log object we use for logging
-
pooledConnector
protected boolean pooledConnector
Indicates whether this Connector is got from a Connector Pool
-
connPool
protected ConnectorPool connPool
Holds the Connector Pool object when a pooled Connector is used
-
initializeCount
protected int initializeCount
How many times the component has been initialized
-
-
Constructor Detail
-
AssemblyLineComponent
public AssemblyLineComponent(TaskInterface parent, java.lang.String name, ConnectorConfig config, ConnectorInterface conn) throws java.lang.Exception
Constructor for theAssemblyLineComponent
object- Parameters:
parent
- The AssemblyLine 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- Throws:
java.lang.Exception
- Any exception that might occur while loading the config
-
AssemblyLineComponent
public AssemblyLineComponent(TaskInterface parent, java.lang.String name, ConnectorConfig config, ConnectorInterface conn, boolean forceRuntime) throws java.lang.Exception
Constructor for theAssemblyLineComponent
object- Parameters:
parent
- The AssemblyLine using this componentname
- The name of this connectorconfig
- The configuration for this connectorconn
- An optional connector to use if we need a (runtime provided) connectorforceRuntime
- whether to use the runtime provided connector- Throws:
java.lang.Exception
- Any exception that might occur while loading the config
-
AssemblyLineComponent
public AssemblyLineComponent()
Empty Constructor for the AssemblyLineComponent object
-
-
Method Detail
-
setCurrent
public void setCurrent(Entry current)
Sets the current entry of theAssemblyLineComponent
object- Parameters:
current
- The new current value
-
setDebug
public void setDebug(boolean debug)
This method sets the the debug mode flag. May be called by different threads.- Parameters:
debug
- True to enable debug, false to disable
-
setErrorObject
@Deprecated public void setErrorObject(java.lang.String oper, java.lang.String reason)
Deprecated.Not used anymoreDeclare an error object in the script engine- Parameters:
oper
- The new errorObject valuereason
- The new errorObject value
-
setDuplicateEntryCount
public void setDuplicateEntryCount(int maxdup)
Sets the max number of duplicate entries for the ConnectorInterface. This is used by the lookup operation when a lookup returns more than one entry.- Parameters:
maxdup
- The new maximum
-
getName
public java.lang.String getName()
This method returns the name assigned to the Connector by the AssemblyLine.- Returns:
- The name of this Connector (in scripting terms)
-
setName
public void setName(java.lang.String name)
This method assigns a name to the Connector.- Parameters:
name
- the name to set.
-
toString
public java.lang.String toString()
Returns the name and class of this component- Overrides:
toString
in classjava.lang.Object
-
getCurrent
public Entry getCurrent()
Gets the current entry of the AssemblyLineComponent object- Returns:
- The current Entry
-
getConfiguration
public ConnectorConfig getConfiguration()
- Returns:
- the Connector configuration
-
getBaseConfiguration
public BaseConfiguration getBaseConfiguration()
- Returns:
- the BaseConfiguration
-
getConfig
public java.lang.Object getConfig(java.lang.String param)
This method returns the configuration value for a parameter- Parameters:
param
- The parameter name- Returns:
- The object associated with parameter name
-
getConnectorParam
public java.lang.Object getConnectorParam(java.lang.String param)
This method returns the ConnectorInterface attached to this AL component.Note that this applies only to Connectors and will return null for any other type of component.
- Parameters:
param
- The parameter name- Returns:
- The object associated with parameter name
-
setConnectorParam
public void setConnectorParam(java.lang.String param, java.lang.Object value)
This method sets the configuration value for the ConnectorInterface's parameter.- Parameters:
param
- The parameter namevalue
- The parameter value
-
getConnector
public ConnectorInterface getConnector()
Returns the ConnectorInterface we are working with- Returns:
- The Connector we are working with
-
getDebug
public boolean getDebug()
This method returns the debug mode flag.- Returns:
- True if debug is enabled, false otherwise
-
getCriteria
public SearchCriteria getCriteria()
This method returns the link criteriaThis example code demonstrates how to get, modify and set different SearchCriteria for a component.
Example:
var conCrit = input.getCriteria(); var newCrit = new com.ibm.di.server.SearchCriteria(); for (i = 0; i < conCrit.size(); i++) { var rsc = conCrit.getCriteria(i); if ((rsc.name.equals("pass")) && (rsc.match == com.ibm.di.server.SearchCriteria.SUBSTRING)) { newCrit.addTemplate("password", com.ibm.di.server.SearchCriteria.EXACT, rsc.value); } else { newCrit.addTemplate(rsc.name, rsc.match, rsc.value); } } input.setCriteria(newCrit);
- Returns:
- The link criteria of this AssemblyLineComponent
-
setCriteria
public void setCriteria(SearchCriteria mySearchCrit)
This method sets the link criteria for this AssemblyLineComponent- Parameters:
mySearchCrit
- The link criteria to set
-
setCriteria
public 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. If the template is successfully expanded, the method will return true.- Parameters:
mySearchCrit
- The Criteria to setwork
- The Entry to use for expansion.- Returns:
- true if the link criteria was successfully expanded.
-
getType
public int getType()
This method returns the mode of a Connector, or the type constant for any other type of component.ServerConstants.TYPE_ITERATOR
= 0
ServerConstants.TYPE_UPDATE
= 1
ServerConstants.TYPE_LOOKUP
= 2
ServerConstants.TYPE_DELETE
= 3
ServerConstants.TYPE_ADDONLY
= 4
ServerConstants.TYPE_CALLREPLY
= 5
ServerConstants.TYPE_SCRIPT
= 6
ServerConstants.TYPE_FUNCTION
= 7
ServerConstants.TYPE_BRANCH
= 8
ServerConstants.TYPE_REPLYCHANNEL
= 9
ServerConstants.TYPE_SERVER
= 10
ServerConstants.TYPE_DELTA
= 11
ServerConstants.TYPE_LOOP
= 12
ServerConstants.TYPE_ATTRIBUTEMAP
= 13
ServerConstants.TYPE_SWITCH
= 14
ServerConstants.TYPE_CASE
= 15- Returns:
- The integer value corresponding to the execution mode
-
isDeltaMode
public boolean isDeltaMode()
- Returns:
- true if we are in Delta mode.
-
getLastReadEntry
public Entry getLastReadEntry()
This method returns the last entry read from the connector.- Returns:
- The last input entry (unmapped)
-
getLastEntry
public Entry getLastEntry()
This method returns the last entry read and mapped.- Returns:
- The last input entry (mapped)
-
getnextClient
public ConnectorInterface getnextClient() throws java.lang.Exception
The method returns the next client from the connector.- Returns:
- The next client or null if there are no more clients
- Throws:
java.lang.Exception
- Errors that may occur
-
getnext
public Entry getnext() throws java.lang.Exception
The method returns the next entry from the connector.- Returns:
- The next input entry or null if there are no more entries
- Throws:
java.lang.Exception
- Errors that may occur
-
getnext
public Entry getnext(Entry work) throws java.lang.Exception
The method returns the next entry from the connector. It is called by theAssemblyLine
if we are working in Iterator mode.- Parameters:
work
- The work entry to fill in- Returns:
- The work entry filled with the next input entry, or null if there are no more entries
- Throws:
java.lang.Exception
- Errors that may occur
-
getStats
public TaskStatistics getStats()
Gets the stats attribute of the AssemblyLineComponent object- Returns:
- The
TaskStatistics
object holding the statistics for this component.
-
getHandler
public AttributeMapping getHandler()
- Returns:
- the object performing hooks
-
isExceptionFatal
public boolean isExceptionFatal(java.lang.Exception e)
Returns true if an exception is fatal- Parameters:
e
- The exception to check- Returns:
- True if the exception is fatal
-
getDuplicateEntryCount
public int getDuplicateEntryCount()
Gets the count of duplicate Entries found by the last findEntry by the ConnectorInterface- Returns:
- The duplicateEntryCount value
-
getFirstDuplicateEntry
public Entry getFirstDuplicateEntry() throws java.lang.Exception
Gets the first Duplicate Entry from the ConnectorInterface. This function also resets the implicit pointer to the next Entry.- Returns:
- The firstDuplicateEntry value
- Throws:
java.lang.Exception
- Any exceptions thrown by the connector's underlying classes
-
getNextDuplicateEntry
public Entry getNextDuplicateEntry() throws java.lang.Exception
Gets the next Duplicate Entry from the ConnectorInterface. This function also moves an implicit pointer to the next Entry.- Returns:
- The nextDuplicateEntry value, null means no more values
- Throws:
java.lang.Exception
- Any exceptions thrown by the connector's underlying classes
-
isEnabled
public boolean isEnabled()
Returns true if this Component is enabled in this AssemblyLine- Returns:
- The enabled value
-
close
public void close() throws java.lang.Exception
This method closes the connector (connector.terminate()) and calls the before/after close hooks.- Throws:
java.lang.Exception
-
willExecute
public boolean willExecute(Entry work) throws java.lang.Exception
Return true/false if this component should be executed. Also calls the "Before Execute" hook.- Parameters:
work
- The current work Entry- Returns:
- True if this component is enabled
- Throws:
java.lang.Exception
- Any exception thrown by the executed hook
-
initialize
public void initialize() throws java.lang.Exception
This method initializes the underlying connector and registers the script beans in the ScriptEngine context.- Throws:
java.lang.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
-
pushback
public void pushback(Entry entry)
This method pushes an entry back to the connector. The entry is returned the next time connector.getNextEntry() is called.- Parameters:
entry
- The entry to push back
-
doConnectorInitialize
public void doConnectorInitialize() throws java.lang.Exception
This method calls the appropriate hooks and the connector's initialize method.- Throws:
java.lang.Exception
- if the connector's initialization fails or an error in one of the executed hooks occurred.
-
doConnectorTerminate
public void doConnectorTerminate() throws java.lang.Exception
This method calls the appropriate hooks and the connector's terminate method.- Throws:
java.lang.Exception
- if the connector's termination fails or an error in one of the executed hooks occurred.
-
doConnectorTerminate
public void doConnectorTerminate(boolean force) throws java.lang.Exception
This method calls the appropriate hooks and the connector's terminate method.- Parameters:
force
- Forces a connector terminate, even if the connector was initialized elsewhere.- Throws:
java.lang.Exception
- if the connector's termination fails or an error in one of the executed hooks occurred.
-
lookup
public Entry lookup(java.lang.String attribute, java.lang.String value) throws java.lang.Exception
The method is called to lookup an entry using exact matching for attribute and value.- Parameters:
attribute
- The attribute name to searchvalue
- The attribute value- Returns:
- The entry found or null if no entries or more than one entry was found.
- Throws:
java.lang.Exception
- Any exceptions thrown by the underlying connector
-
lookup
public Entry lookup(Entry meta) throws java.lang.Exception
The method is called to lookup an entry using the configured Link Criteria. The link criteria is applied using meta as source for variable substitution. If you allow duplicate entries by configuration, the method will return null only when no entries have been found.- Parameters:
meta
- The entry object providing values for variable substitution.- Returns:
- The entry found or null if no entries or more than one entry was found.
- Throws:
java.lang.Exception
- the component is not initialized or the underlying Connector raised an error or some of the user-defined hooks raised an error
-
deleteEntry
public void deleteEntry(Entry meta) throws java.lang.Exception
This method calls the delete method. It is included since JavaScript and possibly other scripting languages choke on the "delete" keyword.- Parameters:
meta
- The work object to use for the link criteria- Throws:
java.lang.Exception
- Any Exception- See Also:
delete(com.ibm.di.entry.Entry)
-
delete
public void delete(Entry meta) throws java.lang.Exception
This method implements the Delete mode operation.- Parameters:
meta
- The work object to use for the link criteria- Throws:
java.lang.Exception
- the component is not initialized or the underlying Connector raised an error or some of the user-defined hooks raised an error
-
update
public void update(Entry meta) throws java.lang.Exception
This method implements the Update mode operation.- Parameters:
meta
- The work entry- Throws:
java.lang.Exception
- the component is not initialized or the underlying Connector raised an error or some of the user-defined hooks raised an error
-
modify
public void modify(Entry old, Entry meta) throws java.lang.Exception
This method implements the Modify operation (called by Update if the entry exists)- Parameters:
old
- The current entry in the destination systemmeta
- The new entry to use in the attribute map- Throws:
java.lang.Exception
- Any Exception
-
add
public void add(Entry meta) throws java.lang.Exception
This method implements the AddOnly mode operation.- Parameters:
meta
- The work entry to add- Throws:
java.lang.Exception
- the component is not initialized or the underlying Connector raised an error or some of the user-defined hooks raised an error
-
reply
public void reply(Entry meta) throws java.lang.Exception
This method is used to send a reply entry to a connector- Parameters:
meta
- The work entry to send back- Throws:
java.lang.Exception
- the component is not initialized or the underlying Connector raised an error or some of the user-defined hooks raised an error
-
callreply
public void callreply(Entry meta) throws java.lang.Exception
This method implements the CallReply mode operation.- Parameters:
meta
- The work entry to send- Throws:
java.lang.Exception
- the component is not initialized or the underlying Connector raised an error or some of the user-defined hooks raised an error
-
delta
public void delta(Entry meta) throws java.lang.Exception
This method implements the Delta mode operation.- Parameters:
meta
- The delta entry- Throws:
java.lang.Exception
- Any Exception
-
dumpEntry
@Deprecated public void dumpEntry(Entry meta) throws java.lang.Exception
Deprecated.replaced byadd(com.ibm.di.entry.Entry)
- Parameters:
meta
- an Entry to be added to the data source by the Connector- Throws:
java.lang.Exception
- problem while adding the Entry to the data source
-
logmsg
public void logmsg(java.lang.String msg)
Write a message to the log file prefixed by this connector's name- Parameters:
msg
- The message to write
-
debug
public void debug(java.lang.String msg)
Write a message to the log file prefixed by this connector's name- Parameters:
msg
- The message to write
-
handleException
public void handleException(java.lang.String aOper, java.lang.Throwable e, Entry meta) throws java.lang.Exception
This method is called by the AssemblyLine. The aOper is any of the standard modes. The mode specific error hook is called first, then the "default" error hook is called.- Parameters:
aOper
- Hook prefixe
- The error causing this hook to be called, or null for no errormeta
- The work entry- Throws:
java.lang.Exception
- Throws the parameter e if we cannot or do not want to handle it, or an Exception from the Hooks.
-
failOver
public boolean failOver(Entry work, Entry error) throws java.lang.Exception
Attempt a failOver.- Parameters:
work
- The work entryweeoe
- The error Entry (may be filled in if an Exception occurs)- Returns:
- true if we could do a failover
- Throws:
java.lang.Exception
- an Exception from the Hook.
-
failBack
public boolean failBack(Entry work, Entry error) throws java.lang.Exception
Attempt to fall back to the original connector after a failOver.- Parameters:
work
- The work entryweeoe
- The error Entry (may be filled in if an Exception occurs)- Returns:
- true if we could do a failover
- Throws:
java.lang.Exception
- an Exception from the Hook.
-
handleSuccess
public void handleSuccess(java.lang.String oper, Entry meta) throws java.lang.Exception
This method is called by the AssemblyLine if the operation oper is successful. The mode specific success hook is called first, then the "default" success hook is called.- Parameters:
oper
- Hook prefixmeta
- The work entry- Throws:
java.lang.Exception
- Any Exception from the Hooks
-
trigger
public boolean trigger(java.lang.String oper, Entry work, Entry conn) throws java.lang.Exception
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.- Parameters:
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- Returns:
- True if the hook was executed, false if the hook is not defined or disabled.
- Throws:
java.lang.Exception
- Any exception thrown by the execution of the hook
-
trigger
public boolean trigger(java.lang.String oper, Entry work) throws java.lang.Exception
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.- Parameters:
oper
- Name of the hook to callwork
- 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.
- Throws:
java.lang.Exception
- Any exception thrown by the execution of the hook
-
trigger
public boolean trigger(java.lang.String oper) throws java.lang.Exception
Calls the hook named oper- Parameters:
oper
- Name of the hook to call- Returns:
- True if the hook was executed, false if the hook is not defined or disabled.
- Throws:
java.lang.Exception
- Any exception thrown by the execution of the hook
-
triggerImpl
protected boolean triggerImpl(java.lang.String oper, Entry work, Entry conn) throws java.lang.Exception
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.- Parameters:
oper
- Name of the hook to callwork
- This will be the work bean in the hook. Maybe null.conn
- This will be the conn bean in the hook. Maybe null.- Returns:
- True if the hook was executed, false if the hook is not defined or disabled.
- Throws:
java.lang.Exception
- Any exception thrown by the execution of the hook
-
expandParameters
@Deprecated public void expandParameters(BaseConfiguration cf) throws java.lang.Exception
Deprecated.Does nothing!- Parameters:
cf
- ignored- Throws:
java.lang.Exception
- never
-
verifySchema
@Deprecated public void verifySchema(Entry entry, boolean input) throws java.lang.Exception
Deprecated.This method does nothing.- Parameters:
entry
- - ignoredinput
- - ignored- Throws:
java.lang.Exception
- - never
-
getRestartInfoEntry
@Deprecated public Entry getRestartInfoEntry() throws java.lang.Exception
Deprecated.This method returns null- Returns:
- null
- Throws:
java.lang.Exception
- - never
-
isCheckpointRestartEnabled
@Deprecated public boolean isCheckpointRestartEnabled() throws java.lang.Exception
Deprecated.Always returns false- Returns:
- false
- Throws:
java.lang.Exception
- - never
-
setRestartInfoEntry
@Deprecated public void setRestartInfoEntry(ALState state, Entry rsi, int restartPoint) throws java.lang.Exception
Deprecated.This method does nothing.- Parameters:
state
- - ignoredrsi
- - ignoredrestartPoint
- - ignored- Throws:
java.lang.Exception
- - never
-
reconnect
public boolean reconnect() throws java.lang.Exception
Cause the underlying ConnectorInterface to reconnect to it's data source- Returns:
- true if the reconnect operation completed successfully, false otherwise.
- Throws:
java.lang.Exception
- if an error while reconnecting occurs.
-
mapEntry
public Entry mapEntry(Entry work, Entry conn) throws java.lang.Exception
The method is called to map an entry using the configured input attribute map.- Parameters:
work
- The work entryconn
- The conn entry- Returns:
- The mapped entry
- Throws:
java.lang.Exception
- problem while mapping the entry
-
checkInitialize
public boolean checkInitialize() throws java.lang.Exception
Checks whether the connector needs to be (re)initialized or not.- Returns:
- true if connector was (re)initialized
- Throws:
java.lang.Exception
-
checkTerminate
public boolean checkTerminate() throws java.lang.Exception
Checks whether the connector should be terminated (e.g. init option = always).- Returns:
- true if connector was terminated
- Throws:
java.lang.Exception
-
wasConfigurationModified
public boolean wasConfigurationModified()
- Returns:
- true if the connection configuration has been modified since the last call.
-
setSimulatingState
public void setSimulatingState(java.lang.String state) throws java.lang.Exception
This methods defines the behavior of a Component when the AL is simulating- Parameters:
state
- - possible values:
SimulationConfig.SIM_ENABLED_STATE
SimulationConfig.SIM_DISABLED_STATE
SimulationConfig.SIM_SIMULATED_STATE
SimulationConfig.SIM_PROXY_STATE
SimulationConfig.SIM_SCRIPTED_STATE
- Throws:
java.lang.Exception
- if an error occurs
-
getSimulatingState
public java.lang.String getSimulatingState() throws java.lang.Exception
The state of this component.- Returns:
- one of the following:
SimulationConfig.SIM_ENABLED_STATE
SimulationConfig.SIM_DISABLED_STATE
SimulationConfig.SIM_SIMULATED_STATE
SimulationConfig.SIM_PROXY_STATE
SimulationConfig.SIM_SCRIPTED_STATE
- Throws:
java.lang.Exception
- if an error occurs
-
executeOperation
protected java.lang.Object executeOperation(int operation, Entry work, Entry conn, SearchCriteria search, Entry current) throws java.lang.Exception
This method is used to take care of dangerous/safe operations when the AL is simulating- Parameters:
operation
- the operation (the method that is called). Recognizable input are the values putEntry, modEntry, deleteEntry, perform, getNextClient, getNextEntry, findEntry, selectEntries, replyEntry and queryReplywork
- The work entry. If a null is passed the method will get the work entry from its parent (AssemblyLine) and if it still null then a new work entry will be created. If the Proxy simulation state is executed and the passed operation does not expect an entry to be returned then the entry retrieved from the Proxy AL will be merged with the work entryconn
- For the operations that expect an entry to be returned and we are with Scripted simulation state set then the conn entry modified in the script will be used as the returned entry.search
- TheSearchCriteria
object used to locate the entry to be modified/deletedcurrent
- The old entry found by the search criteria this would be only available for the modEntry operation and only then will be exposed in a script- Returns:
- Operations that expect an object to be returned are findEntry, getNextEntry, queryReply and perform. In case one of this operations are simulated then either empty Entry is returned or the entry retrieved form the proxy AL or the conn entry modified by executed script
- Throws:
java.lang.Exception
- in case the call to one of the methods fails.java.lang.ClassCastException
- in case the parent of the AssemblyLineComponent is not an instance of the AssemblyLine class- Since:
- 7.0
-
componentInitialized
public boolean componentInitialized()
Returns true if component is initialized- Returns:
- true if component is initialized
- Since:
- 7.0
-
wasSuccessful
public boolean wasSuccessful()
Returns true if this component was successfully executed the last time it was called.- Returns:
- true if this component was successfully executed the last time it was called, false otherwise.
-
setSuccessful
public void setSuccessful(boolean b)
Sets the value that will be returned from wasSuccessful().- Parameters:
b
- - The new value
-
resetStatus
public void resetStatus()
This method resets the Properties of this AssemblyLineComponent. SUCCESSFUL is set to "true", and HOOKS_INVOKED is set to an empty list.
-
size
public int size()
- Specified by:
size
in interfacejava.util.Map
-
isEmpty
public boolean isEmpty()
Returns false.- Specified by:
isEmpty
in interfacejava.util.Map
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map
-
containsValue
public boolean containsValue(java.lang.Object val)
Returns true if a key maps to this value. Does not consider the statistics values.- Specified by:
containsValue
in interfacejava.util.Map
- Parameters:
val
- The value to look for.
-
get
public java.lang.Object get(java.lang.Object propName)
- Specified by:
get
in interfacejava.util.Map
-
put
public java.lang.Object put(java.lang.Object propName, java.lang.Object propValue)
- Specified by:
put
in interfacejava.util.Map
-
remove
public java.lang.Object remove(java.lang.Object propName)
- Specified by:
remove
in interfacejava.util.Map
-
putAll
public void putAll(java.util.Map map)
- Specified by:
putAll
in interfacejava.util.Map
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Map
-
keySet
public java.util.Set keySet()
- Specified by:
keySet
in interfacejava.util.Map
-
values
public java.util.Collection values()
Returns the values in this Map. Does not include the statistics values.- Specified by:
values
in interfacejava.util.Map
-
entrySet
public java.util.Set<java.util.Map.Entry> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map
-
isFailOvered
public boolean isFailOvered()
Returns true when using the failover connector.- Returns:
- true if this connector is failovered.
- Since:
- 7.1.1
-
useMap
public void useMap(java.lang.String attributeMapName) throws java.lang.Exception
Sets the named Attribute Map to be used for input and output mapping. If the name is null, mapping will use this Connector's map.- Parameters:
attributeMapName
- Name used to locate the AttributeMap.- Throws:
java.lang.Exception
- Since:
- 7.1.1
-
useMap
public void useMap(java.lang.String attributeMapName, boolean input) throws java.lang.Exception
Sets the named Attribute Map to be used for input or output mapping. If the name is null, mapping will use this Connector's map.- Parameters:
attributeMapName
- Name used to locate the AttributeMap.input
- If true, this is used for input mapping, false means output.- Throws:
java.lang.Exception
- Since:
- 7.1.1
-
useInputMap
public void useInputMap(AttributeMapConfig map) throws java.lang.Exception
Sets the provided AttributeMapConfig to be used for input mapping.- Parameters:
map
- If null, this Connector's Input map is used.- Throws:
java.lang.Exception
- Since:
- 7.1.1
-
useOutputMap
public void useOutputMap(AttributeMapConfig map) throws java.lang.Exception
Sets the provided AttributeMapConfig to be used for output mapping.- Parameters:
map
- If null, this Connector's Output map is used.- Throws:
java.lang.Exception
- Since:
- 7.1.1
-
useAttributeMap
public void useAttributeMap(java.lang.String fileName) throws java.lang.Exception
Load an attribute map from a file and use it for the default map. This works likeuseAttributeMap(fileName, false)
- Parameters:
fileName
- The name of the external file containing the attribute map. If null, the mapping will be reset to this Connector's default map.- Throws:
java.lang.Exception
- if the file cannot be read- Since:
- 7.1.1
-
useAttributeMap
public void useAttributeMap(java.lang.String fileName, boolean extend) throws java.lang.Exception
Load an attribute map from a file and use it for the default map. The default map is the output map in AddOnly, Update and Delta mode. For all other modes the input map will be used. If the named file is already being used for this mapping, nothing will be done. The format of the external file is described in FileNamespace.- Parameters:
fileName
- The name of the external file containing the attribute map. If null, the mapping will be reset to this Connector's default map.extend
- If true, the new map will extend the existing map. If false, the new map will replace the existing map.- Throws:
java.lang.Exception
- if the file cannot be read- Since:
- 7.1.1
- See Also:
FileNamespace
-
useAttributeMap
public void useAttributeMap(java.lang.String fileName, boolean input, boolean extend) throws java.lang.Exception
Load an attribute map from a file and use it for the specified map. If the named file is already being used for this mapping, nothing will be done. The format of the external file is described in FileNamespace.- Parameters:
fileName
- The name of the external file containing the attribute map. If null, the mapping will be reset to the Connector's default map.input
- If true, change the input map. If false, change the output map.extend
- If true, the new map will extend the existing map. If false, the new map will replace the existing map.- Throws:
java.lang.Exception
- if the file cannot be read- Since:
- 7.1.1
- See Also:
FileNamespace
-
-