com.ibm.di.server
Class AttributeMapComponent

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

public class AttributeMapComponent
extends AssemblyLineComponent

This class is used by the AssemblyLine, it contains a standalone Attribute map


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.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
AttributeMapComponent(AssemblyLine parent, java.lang.String name, ALMappingConfig config)
          Constructor for the AttributeMapComponent object
 
Method Summary
 void add(Entry meta)
          Does the attribute mapping in every cycle
 void close()
          This method closes the AttributeMapComponent
 ConnectorConfig getConfiguration()
          Returns the configuration for this component
 int getType()
          Returns the type of this component
 void handleException(java.lang.String oper, java.lang.Throwable e, Entry meta)
          Handles any Exception.
 void initialize()
          This method creates the AttributeMapping for this component
 boolean trigger(java.lang.String oper, Entry work)
          Performs any hook.
 boolean trigger(java.lang.String oper, Entry work, Entry conn)
          Performs any hook.
 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 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.
 boolean willExecute(Entry work)
          This method always returns true
 
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, getBaseConfiguration, getConfig, getConnector, getConnectorParam, getCriteria, getCurrent, getDebug, getDuplicateEntryCount, getFirstDuplicateEntry, getHandler, getLastEntry, getLastReadEntry, getLog, getName, getnext, getnext, getnextClient, getNextDuplicateEntry, getRestartInfoEntry, getSimulatingState, getStats, 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, trigger, triggerImpl, update, useAttributeMap, useAttributeMap, useInputMap, 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

AttributeMapComponent

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

Parameters:
parent - The AssemblyLine that contains this AttributeMapComponent
name - The name of this component
config - The configuration for this component
Throws:
java.lang.Exception - Any Exception that might occur
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
This method creates the AttributeMapping for this component

Overrides:
initialize in class AssemblyLineComponent
Throws:
java.lang.Exception - Any Exception that might be thrown

willExecute

public boolean willExecute(Entry work)
                    throws java.lang.Exception
This method always returns true

Overrides:
willExecute in class AssemblyLineComponent
Parameters:
work - The work Entry
Returns:
always true
Throws:
java.lang.Exception - Any exception thrown by the executed hook

getConfiguration

public ConnectorConfig getConfiguration()
Returns the configuration for this component

Overrides:
getConfiguration in class AssemblyLineComponent
Returns:
the configuration for this component

getType

public int getType()
Returns the type of this component

Overrides:
getType in class AssemblyLineComponent
Returns:
ServerConstants.TYPE_ATTRIBUTEMAP

add

public void add(Entry meta)
         throws java.lang.Exception
Does the attribute mapping in every cycle

Overrides:
add in class AssemblyLineComponent
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

handleException

public void handleException(java.lang.String oper,
                            java.lang.Throwable e,
                            Entry meta)
                     throws java.lang.Exception
Handles any Exception. Since Attribute Maps don't have hooks, this method just rethrows the Exception

Overrides:
handleException in class AssemblyLineComponent
Parameters:
oper - The operation that was performed. Ignored
e - The Throwable that was thrown
meta - The work Entry
Throws:
java.lang.Exception - Rethrows the Throwable, if necessary wrapped in an Exception

trigger

public boolean trigger(java.lang.String oper,
                       Entry work,
                       Entry conn)
Performs any hook. Since there are no hooks, this method is never called

Overrides:
trigger in class AssemblyLineComponent
Parameters:
oper - The operation that was performed
work - The work Entry
conn - The conn Entry
Returns:
always false

trigger

public boolean trigger(java.lang.String oper,
                       Entry work)
Performs any hook. Since there are no hooks, this method is never called

Overrides:
trigger in class AssemblyLineComponent
Parameters:
oper - The operation that was performed
work - The work Entry
Returns:
always false

close

public void close()
           throws java.lang.Exception
This method closes the AttributeMapComponent

Overrides:
close in class AssemblyLineComponent
Throws:
java.lang.Exception

useMap

public void useMap(java.lang.String attributeMapName)
            throws java.lang.Exception
Description copied from class: AssemblyLineComponent
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.

Overrides:
useMap in class AssemblyLineComponent
Parameters:
attributeMapName - Name used to locate the AttributeMap.
Throws:
java.lang.Exception

useMap

public void useMap(java.lang.String attributeMapName,
                   boolean input)
            throws java.lang.Exception
Description copied from class: AssemblyLineComponent
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.

Overrides:
useMap in class AssemblyLineComponent
Parameters:
attributeMapName - Name used to locate the AttributeMap.
input - If true, this is used for input mapping, false means output.
Throws:
java.lang.Exception

useOutputMap

public void useOutputMap(AttributeMapConfig map)
                  throws java.lang.Exception
Description copied from class: AssemblyLineComponent
Sets the provided AttributeMapConfig to be used for output mapping.

Overrides:
useOutputMap in class AssemblyLineComponent
Parameters:
map - If null, this Connector's Output map is used.
Throws:
java.lang.Exception

useAttributeMap

public void useAttributeMap(java.lang.String fileName,
                            boolean input,
                            boolean extend)
                     throws java.lang.Exception
Description copied from class: AssemblyLineComponent
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.

Overrides:
useAttributeMap in class AssemblyLineComponent
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
See Also:
FileNamespace