com.ibm.di.server
Class LoopComponent

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

public class LoopComponent
extends BranchingComponent

This class is used by an AssemblyLine to mark the beginning of a loop


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
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, 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
LoopComponent(AssemblyLine parent, java.lang.String name, LoopConfig config)
          Constructor for the LoopComponent object
 
Method Summary
 void add(Entry meta)
          If necessary, move a value from the stored Attribute values to the work Entry
 void checkConnectorInit(Entry work)
          Check what to do with our connector when we enter the loop.
 void checkLoopAttribute(Entry work)
          Copy values from work entry attribute
 void close()
          Releases resource.
 AssemblyLineComponent getAssemblyLineComponent()
          Returns the associated AssemblyLineComponent with the Connector.
 ConnectorConfig getConfiguration()
          Returns the LoopConnector Config.
 int getLoopType()
          Returns the source for this loop component (e.g.
 Entry getNextEntry(Entry meta)
          Returns the next Entry if this is a Connector loop
 int getType()
          Returns the type of this component.
 void initialize()
          This method initializes the LoopComponent
 void setConnectorParam(java.lang.String param, java.lang.Object value)
          Used for setting the connector Param.
 void setConnectorParams(Entry work)
          Executes the attribute map for the connector params
 void setFirstLoop(boolean value)
          Set the internal firstLoop variable to the parameter value.
 boolean willExecute(Entry work)
          This method will execute the Loop condition/connector and determine whether there are more loops to do.
 
Methods inherited from class com.ibm.di.server.BranchingComponent
add1, checkWillExecute, componentCount, evaluateCondition, evaluateConditions, getBaseConfiguration, getBranchType, 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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

LoopComponent

public LoopComponent(AssemblyLine parent,
                     java.lang.String name,
                     LoopConfig config)
              throws java.lang.Exception
Constructor for the LoopComponent object

Parameters:
parent - The AssemblyLine this LoopComponent belongs in
name - The name of this LoopComponent
config - The configuration for this LoopComponent
Throws:
java.lang.Exception - Any Exception that might be thrown
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
This method initializes the LoopComponent

Overrides:
initialize in class BranchingComponent
Throws:
java.lang.Exception - If this is a Collection Loop, and attribute names are missing

getNextEntry

public Entry getNextEntry(Entry meta)
                   throws java.lang.Exception
Returns the next Entry if this is a Connector loop

Parameters:
meta - The work Entry
Returns:
The next Entry
Throws:
java.lang.Exception - Any Exception thrown by the Connector

setFirstLoop

public void setFirstLoop(boolean value)
Set the internal firstLoop variable to the parameter value. Used to decide if this LoopComponent should begin a new Loop, or continue the old Loop

Parameters:
value - The value to set

getLoopType

public int getLoopType()
Returns the source for this loop component (e.g. LoopConfig.LOOP_CONDITIONS/CONNECTOR_FC/COLLECTION)

Returns:
An int containing the loop type.

willExecute

public boolean willExecute(Entry work)
                    throws java.lang.Exception
This method will execute the Loop condition/connector and determine whether there are more loops to do.

Overrides:
willExecute in class BranchingComponent
Parameters:
work - The work Entry
Returns:
true if there are more loops to do
Throws:
java.lang.Exception - if a problem occurs

getType

public int getType()
Returns the type of this component.

Overrides:
getType in class BranchingComponent
Returns:
ServerConstants.TYPE_LOOP

checkLoopAttribute

public void checkLoopAttribute(Entry work)
Copy values from work entry attribute

Parameters:
work - The work Entry

checkConnectorInit

public void checkConnectorInit(Entry work)
                        throws java.lang.Exception
Check what to do with our connector when we enter the loop.

Parameters:
work - The work Entry
Throws:
java.lang.Exception - if a problem occurs

setConnectorParams

public void setConnectorParams(Entry work)
                        throws java.lang.Exception
Executes the attribute map for the connector params

Parameters:
work - The work Entry
Throws:
java.lang.Exception - if a problem occurs

add

public void add(Entry meta)
         throws java.lang.Exception
If necessary, move a value from the stored Attribute values to the work Entry

Overrides:
add in class BranchingComponent
Parameters:
meta - The work Entry
Throws:
java.lang.Exception - if a problem occurs

close

public void close()
           throws java.lang.Exception
Releases resource.

Overrides:
close in class BranchingComponent
Throws:
java.lang.Exception - if a problem occurs.

getAssemblyLineComponent

public AssemblyLineComponent getAssemblyLineComponent()
Returns the associated AssemblyLineComponent with the Connector. If this is not a Connector LoopComponent, returns null.

Returns:
an AssemblyLineComponent, or null
Since:
7.0

getConfiguration

public ConnectorConfig getConfiguration()
Returns the LoopConnector Config.

Overrides:
getConfiguration in class BranchingComponent
Returns:
null
Since:
7.1.1.

setConnectorParam

public void setConnectorParam(java.lang.String param,
                              java.lang.Object value)
Used for setting the connector Param.

Overrides:
setConnectorParam in class AssemblyLineComponent
Parameters:
param - The parameter name
value - The parameter value
Since:
7.1.1.