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.MapThis 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 AttributeMappingaddmapstatic java.lang.StringCHECKPOINT_GETSDeprecated.Checkpoint/restart is deprecatedprotected ConnectorConfigconfigThis is our configuration (with attribute maps, hooks etc ...)protected RawConnectorConfigconnConfigThis is the configuration of the ConnectorInterfaceConnectorInterfaceconnectorThis is the connector we are working with.protected ConnectorPoolconnPoolHolds the Connector Pool object when a pooled Connector is usedstatic java.lang.StringEND_OF_DATAThe key used to get the flag which is raised (it's value is set to true) when the the component wrapped by thisAssemblyLineComponentis in Iterator mode and the feed has been exhausted.protected AttributeMappinghandlerThis is the object performing hooksstatic java.lang.StringHOOKS_INVOKEDThe key used to get the list of invoked hooks in this cycle.protected AttributeMappingimapThese are the objects performing input and output attribute mappingprotected static java.lang.StringINITIALIZEprotected intinitializeCountHow many times the component has been initializedstatic java.lang.StringLAST_CONNThe key used to get the last Entry with information from the Connector, or the last Entry that was sent to the Connectorstatic java.lang.StringLAST_ERRORThe key used to get the last error that have occurred.protected LoglogThis is the Log object we use for loggingprotected AttributeMappingmodmapprotected java.lang.StringnameThis is the connector name as given by the AssemblyLinestatic java.lang.StringNUM_ADDThe key used to get the number additions this component has made.static java.lang.StringNUM_CALLREPLYThe key used to get the number of call-replays operations this component has executed.static java.lang.StringNUM_DELETEThe key used to get the number of deletions this component has made.static java.lang.StringNUM_ERRORSThe key used to get the number of errors this component has made.static java.lang.StringNUM_GETThe key used to get the number of entries this component has gotten.static java.lang.StringNUM_GET_TRIESThe key used to get the number of times we tried to get an Entry.static java.lang.StringNUM_GETCLIENTThe key used to get the number of the clients this component has connected with.static java.lang.StringNUM_GETCLIENT_TRIESThe key used to get the number of times we tried to get a clientstatic java.lang.StringNUM_IGNOREDThe key used to get the number of ignored entries.static java.lang.StringNUM_LOOKUPThe key used to get the number of lookups this component has made.static java.lang.StringNUM_MODIFYThe key used to get the number of modifications this component has made.static java.lang.StringNUM_NOCHANGEThe key used to get the number of no-change entries.static java.lang.StringNUM_SKIPPEDThe key used to get the number of skipped entries.protected AssemblyLineparentThis is the parent task (AssemblyLine)protected booleanpooledConnectorIndicates whether this Connector is got from a Connector Poolprotected static java.lang.StringSELECTTaskStatisticsstatsThis is the statistics object for the componentstatic java.lang.StringSUCCESSFULThe 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 theAssemblyLineComponentobjectAssemblyLineComponent(TaskInterface parent, java.lang.String name, ConnectorConfig config, ConnectorInterface conn, boolean forceRuntime)Constructor for theAssemblyLineComponentobject
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(Entry meta)This method implements the AddOnly mode operation.voidcallreply(Entry meta)This method implements the CallReply mode operation.booleancheckInitialize()Checks whether the connector needs to be (re)initialized or not.booleancheckTerminate()Checks whether the connector should be terminated (e.g.voidclear()voidclose()This method closes the connector (connector.terminate()) and calls the before/after close hooks.booleancomponentInitialized()Returns true if component is initializedbooleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object val)Returns true if a key maps to this value.voiddebug(java.lang.String msg)Write a message to the log file prefixed by this connector's namevoiddelete(Entry meta)This method implements the Delete mode operation.voiddeleteEntry(Entry meta)This method calls the delete method.voiddelta(Entry meta)This method implements the Delta mode operation.voiddoConnectorInitialize()This method calls the appropriate hooks and the connector's initialize method.voiddoConnectorTerminate()This method calls the appropriate hooks and the connector's terminate method.voiddoConnectorTerminate(boolean force)This method calls the appropriate hooks and the connector's terminate method.voiddumpEntry(Entry meta)Deprecated.replaced byadd(com.ibm.di.entry.Entry)protected voiddumpObjects(Entry conn, Entry work, Entry current)java.util.Set<java.util.Map.Entry>entrySet()protected java.lang.ObjectexecuteOperation(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 simulatingvoidexpandParameters(BaseConfiguration cf)Deprecated.booleanfailBack(Entry work, Entry error)Attempt to fall back to the original connector after a failOver.booleanfailOver(Entry work, Entry error)Attempt a failOver.java.lang.Objectget(java.lang.Object propName)BaseConfigurationgetBaseConfiguration()java.lang.ObjectgetConfig(java.lang.String param)This method returns the configuration value for a parameterConnectorConfiggetConfiguration()ConnectorInterfacegetConnector()Returns the ConnectorInterface we are working withjava.lang.ObjectgetConnectorParam(java.lang.String param)This method returns the ConnectorInterface attached to this AL component.SearchCriteriagetCriteria()This method returns the link criteriaEntrygetCurrent()Gets the current entry of the AssemblyLineComponent objectbooleangetDebug()This method returns the debug mode flag.intgetDuplicateEntryCount()Gets the count of duplicate Entries found by the last findEntry by the ConnectorInterfaceEntrygetFirstDuplicateEntry()Gets the first Duplicate Entry from the ConnectorInterface.AttributeMappinggetHandler()EntrygetLastEntry()This method returns the last entry read and mapped.EntrygetLastReadEntry()This method returns the last entry read from the connector.LoggetLog()Returns the log objectjava.lang.StringgetName()This method returns the name assigned to the Connector by the AssemblyLine.Entrygetnext()The method returns the next entry from the connector.Entrygetnext(Entry work)The method returns the next entry from the connector.ConnectorInterfacegetnextClient()The method returns the next client from the connector.EntrygetNextDuplicateEntry()Gets the next Duplicate Entry from the ConnectorInterface.EntrygetRestartInfoEntry()Deprecated.java.lang.StringgetSimulatingState()The state of this component.TaskStatisticsgetStats()Gets the stats attribute of the AssemblyLineComponent objectintgetType()This method returns the mode of a Connector, or the type constant for any other type of component.voidhandleException(java.lang.String aOper, java.lang.Throwable e, Entry meta)This method is called by the AssemblyLine.voidhandleSuccess(java.lang.String oper, Entry meta)This method is called by the AssemblyLine if the operation oper is successful.voidinitialize()This method initializes the underlying connector and registers the script beans in the ScriptEngine context.booleanisCheckpointRestartEnabled()Deprecated.booleanisDeltaMode()booleanisEmpty()Returns false.booleanisEnabled()Returns true if this Component is enabled in this AssemblyLinebooleanisExceptionFatal(java.lang.Exception e)Returns true if an exception is fatalbooleanisFailOvered()Returns true when using the failover connector.java.util.SetkeySet()voidlogmsg(java.lang.String msg)Write a message to the log file prefixed by this connector's nameEntrylookup(Entry meta)The method is called to lookup an entry using the configured Link Criteria.Entrylookup(java.lang.String attribute, java.lang.String value)The method is called to lookup an entry using exact matching for attribute and value.EntrymapEntry(Entry work, Entry conn)The method is called to map an entry using the configured input attribute map.voidmodify(Entry old, Entry meta)This method implements the Modify operation (called by Update if the entry exists)voidpushback(Entry entry)This method pushes an entry back to the connector.java.lang.Objectput(java.lang.Object propName, java.lang.Object propValue)voidputAll(java.util.Map map)booleanreconnect()Cause the underlying ConnectorInterface to reconnect to it's data sourcejava.lang.Objectremove(java.lang.Object propName)voidreply(Entry meta)This method is used to send a reply entry to a connectorvoidresetStatus()This method resets the Properties of this AssemblyLineComponent.voidsetConnectorParam(java.lang.String param, java.lang.Object value)This method sets the configuration value for the ConnectorInterface's parameter.voidsetCriteria(SearchCriteria mySearchCrit)This method sets the link criteria for this AssemblyLineComponentbooleansetCriteria(SearchCriteria mySearchCrit, Entry work)This method sets the link criteria template for this AssemblyLineComponent, and then expands the template using the given work Entry.voidsetCurrent(Entry current)Sets the current entry of theAssemblyLineComponentobjectvoidsetDebug(boolean debug)This method sets the the debug mode flag.voidsetDuplicateEntryCount(int maxdup)Sets the max number of duplicate entries for the ConnectorInterface.voidsetErrorObject(java.lang.String oper, java.lang.String reason)Deprecated.Not used anymorevoidsetName(java.lang.String name)This method assigns a name to the Connector.voidsetRestartInfoEntry(ALState state, Entry rsi, int restartPoint)Deprecated.voidsetSimulatingState(java.lang.String state)This methods defines the behavior of a Component when the AL is simulatingvoidsetSuccessful(boolean b)Sets the value that will be returned from wasSuccessful().intsize()java.lang.StringtoString()Returns the name and class of this componentbooleantrigger(java.lang.String oper)Calls the hook named operbooleantrigger(java.lang.String oper, Entry work)Calls the hook named oper, declaring work as the corresponding bean.booleantrigger(java.lang.String oper, Entry work, Entry conn)Calls the hook named oper, declaring work and conn as the corresponding beans.protected booleantriggerImpl(java.lang.String oper, Entry work, Entry conn)Calls the hook named oper, declaring work and conn as the corresponding beans.voidupdate(Entry meta)This method implements the Update mode operation.voiduseAttributeMap(java.lang.String fileName)Load an attribute map from a file and use it for the default map.voiduseAttributeMap(java.lang.String fileName, boolean extend)Load an attribute map from a file and use it for the default map.voiduseAttributeMap(java.lang.String fileName, boolean input, boolean extend)Load an attribute map from a file and use it for the specified map.voiduseInputMap(AttributeMapConfig map)Sets the provided AttributeMapConfig to be used for input mapping.voiduseMap(java.lang.String attributeMapName)Sets the named Attribute Map to be used for input and output mapping.voiduseMap(java.lang.String attributeMapName, boolean input)Sets the named Attribute Map to be used for input or output mapping.voiduseOutputMap(AttributeMapConfig map)Sets the provided AttributeMapConfig to be used for output mapping.java.util.Collectionvalues()Returns the values in this Map.voidverifySchema(Entry entry, boolean input)Deprecated.booleanwasConfigurationModified()booleanwasSuccessful()Returns true if this component was successfully executed the last time it was called.booleanwillExecute(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 thisAssemblyLineComponentis 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 theAssemblyLineComponentobject- 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 theAssemblyLineComponentobject- 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 theAssemblyLineComponentobject- 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:
toStringin 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 theAssemblyLineif 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
TaskStatisticsobject 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.ExceptionThis 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.ExceptionThis 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.ExceptionThis 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.ExceptionThis 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.ExceptionThis 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.ExceptionThis 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.ExceptionThis 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.ExceptionCalls 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.ExceptionCalls 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.ExceptionCalls 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.ExceptionCalls 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.ExceptionDeprecated.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.ExceptionCause 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.ExceptionChecks 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.ExceptionChecks 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.ExceptionThis 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.ExceptionThe 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.ExceptionThis 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- TheSearchCriteriaobject 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:
sizein interfacejava.util.Map
-
isEmpty
public boolean isEmpty()
Returns false.- Specified by:
isEmptyin interfacejava.util.Map
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKeyin 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:
containsValuein interfacejava.util.Map- Parameters:
val- The value to look for.
-
get
public java.lang.Object get(java.lang.Object propName)
- Specified by:
getin interfacejava.util.Map
-
put
public java.lang.Object put(java.lang.Object propName, java.lang.Object propValue)- Specified by:
putin interfacejava.util.Map
-
remove
public java.lang.Object remove(java.lang.Object propName)
- Specified by:
removein interfacejava.util.Map
-
putAll
public void putAll(java.util.Map map)
- Specified by:
putAllin interfacejava.util.Map
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Map
-
keySet
public java.util.Set keySet()
- Specified by:
keySetin interfacejava.util.Map
-
values
public java.util.Collection values()
Returns the values in this Map. Does not include the statistics values.- Specified by:
valuesin interfacejava.util.Map
-
entrySet
public java.util.Set<java.util.Map.Entry> entrySet()
- Specified by:
entrySetin 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.ExceptionSets 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.ExceptionSets 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.ExceptionLoad 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.ExceptionLoad 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.ExceptionLoad 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
-
-