Package com.ibm.di.server
Class SwitchComponent
- java.lang.Object
-
- com.ibm.di.server.AssemblyLineComponent
-
- com.ibm.di.server.BranchingComponent
-
- com.ibm.di.server.SwitchComponent
-
- All Implemented Interfaces:
java.util.Map
public class SwitchComponent extends BranchingComponent
This class is used by an AssemblyLine
-
-
Field Summary
-
Fields inherited from class com.ibm.di.server.BranchingComponent
branchingConfig, psc, value
-
Fields inherited from class com.ibm.di.server.AssemblyLineComponent
addmap, CHECKPOINT_GETS, config, connConfig, connector, connPool, END_OF_DATA, handler, HOOKS_INVOKED, imap, INITIALIZE, initializeCount, LAST_CONN, LAST_ERROR, log, modmap, name, NUM_ADD, NUM_CALLREPLY, NUM_DELETE, NUM_ERRORS, NUM_GET, NUM_GET_TRIES, NUM_GETCLIENT, NUM_GETCLIENT_TRIES, NUM_IGNORED, NUM_LOOKUP, NUM_MODIFY, NUM_NOCHANGE, NUM_SKIPPED, parent, pooledConnector, SELECT, stats, SUCCESSFUL
-
-
Constructor Summary
Constructors Constructor Description SwitchComponent(AssemblyLine parent, java.lang.String name, BranchingConfig config)
Constructor for the BranchingComponent object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Entry meta)
This method does nothingboolean
getCaseExecuted()
Returns true if any contained CASE component executed this cyclejava.lang.String
getCaseExecutedBy()
Returns the name of the CASE component that executed this cyclejava.lang.String
getLastExpression()
Returns the value from the last evaluated expression.SwitchComponent
getParentSwitch()
Returns the SWITCH component to which this CASE belongs.int
getType()
Gets the type attribute of the BranchingComponent objectvoid
initialize()
Initializes this SwitchComponentvoid
setCaseExecutedBy(java.lang.String name)
Sets the name of the CASE component that executed this cycle (called by CASE components)boolean
willExecute(Entry work)
Return true/false if this component should be executed.-
Methods inherited from class com.ibm.di.server.BranchingComponent
add1, checkWillExecute, close, componentCount, evaluateCondition, evaluateConditions, getBaseConfiguration, getBranchType, getConfiguration, isExecuted, trigger, trigger, trigger
-
Methods inherited from class com.ibm.di.server.AssemblyLineComponent
callreply, checkInitialize, checkTerminate, clear, componentInitialized, containsKey, containsValue, debug, delete, deleteEntry, delta, doConnectorInitialize, doConnectorTerminate, doConnectorTerminate, dumpEntry, dumpObjects, entrySet, executeOperation, expandParameters, failBack, failOver, get, getConfig, getConnector, getConnectorParam, getCriteria, getCurrent, getDebug, getDuplicateEntryCount, getFirstDuplicateEntry, getHandler, getLastEntry, getLastReadEntry, getLog, getName, getnext, getnext, getnextClient, getNextDuplicateEntry, getRestartInfoEntry, getSimulatingState, getStats, handleException, handleSuccess, isCheckpointRestartEnabled, isDeltaMode, isEmpty, isEnabled, isExceptionFatal, isFailOvered, keySet, logmsg, lookup, lookup, mapEntry, modify, pushback, put, putAll, reconnect, remove, reply, resetStatus, setConnectorParam, setCriteria, setCriteria, setCurrent, setDebug, setDuplicateEntryCount, setErrorObject, setName, setRestartInfoEntry, setSimulatingState, setSuccessful, size, toString, triggerImpl, update, useAttributeMap, useAttributeMap, useAttributeMap, useInputMap, useMap, useMap, useOutputMap, values, verifySchema, wasConfigurationModified, wasSuccessful
-
-
-
-
Constructor Detail
-
SwitchComponent
public SwitchComponent(AssemblyLine parent, java.lang.String name, BranchingConfig config) throws java.lang.Exception
Constructor for the BranchingComponent object- Parameters:
parent
- The AssemblyLine that contains this SwitchComponentname
- The name of this SwitchComponentconfig
- The configuration for this SwitchComponent- Throws:
java.lang.Exception
-
-
Method Detail
-
initialize
public void initialize() throws java.lang.Exception
Initializes this SwitchComponent- Overrides:
initialize
in classBranchingComponent
- Throws:
java.lang.Exception
- Not really, but subclasses may throw Exceptions
-
getType
public int getType()
Gets the type attribute of the BranchingComponent object- Overrides:
getType
in classBranchingComponent
- Returns:
- The type value
-
willExecute
public boolean willExecute(Entry work) throws java.lang.Exception
Return true/false if this component should be executed. Return true if this is a SWITCH, or if the expression in this CASE matches the expression in the containing SWITCH- Overrides:
willExecute
in classBranchingComponent
- Parameters:
work
- The work Entry- Returns:
- see above
- Throws:
java.lang.Exception
- Any Exception that might be thrown
-
add
public void add(Entry meta) throws java.lang.Exception
This method does nothing- Overrides:
add
in classBranchingComponent
- Parameters:
meta
- parameter- Throws:
java.lang.Exception
- if problem occurs
-
getLastExpression
public java.lang.String getLastExpression()
Returns the value from the last evaluated expression. This is used by the CASE components when they compare to their own values.
-
getParentSwitch
public SwitchComponent getParentSwitch()
Returns the SWITCH component to which this CASE belongs.
-
getCaseExecuted
public boolean getCaseExecuted()
Returns true if any contained CASE component executed this cycle- Returns:
- true if any contained CASE component executed this cycle
-
getCaseExecutedBy
public java.lang.String getCaseExecutedBy()
Returns the name of the CASE component that executed this cycle- Returns:
- the name of the CASE component that executed this cycle
-
setCaseExecutedBy
public void setCaseExecutedBy(java.lang.String name)
Sets the name of the CASE component that executed this cycle (called by CASE components)- Parameters:
name
- The name of the CASE component that executed this cycle
-
-