com.ibm.di.connector
Class AssemblyLineConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.AssemblyLineConnector
All Implemented Interfaces:
ConnectorInterface, VersionInfoInterface

public class AssemblyLineConnector
extends Connector
implements ConnectorInterface

This class uses the AssemblyLineFC function to invoke operations on an AssemblyLine. The behavior of this class depends on the operations defined by the target AssemblyLine. If the target AL has defined connector interface methods that match the connector interface names, this connector will invoke the corresponding operation in the target AL. If a mode ends up in an internal connector interface method with no corresponding operation defined an exception is thrown. The exception is the CallReply mode which is the default for all non-standard modes. A connector interface based adapter AssemblyLine must define operations that correspond to the names found in the connector interface. This means that in order to act as an Iterator it should define "selectentries" and "getnext" as valid operations. This connector will compute the valid modes an AssemblyLine provides by looking at the operation names.

When the target AssemblyLine has its operations invoked through the native connector interface methods (e.g. getnext, selectentries etc) the AssemblyLine connector will provide a work entry with predefined attribute names. These attributes are:

conn - the entry (or entries) passed between this connector and the adapter. The value can be null, a single entry or an array/collection of entries in case there are multiple.

search - the search criteria as specified by the user. See SearchCriteria

current - the current target object. this is used when modifying existing entries. Conversely, when the target AssemblyLine returns data for these methods/operations it should return an entry with these attribute names.


Field Summary
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
AssemblyLineConnector()
           
 
Method Summary
 void deleteEntry(Entry entry, SearchCriteria search)
          Deletes an existing entry.
 Entry findEntry(SearchCriteria search)
          Finds an existing entry.
 Vector getALModes(ConnectorConfig config)
           
 Vector getModes(ConnectorConfig config)
          Returns the connector's modes.
 Entry getNextEntry()
          Returns the next Entry from the connector.
 String getVersion()
          Return version information
 void initialize(Object o)
          Initialize the connector.
 void modEntry(Entry entry, SearchCriteria search, Entry old)
          Modifies an existing entry.
 Entry performOperation(Entry workEntry, String operation)
          This method invokes the named operation in the target AssemblyLine.
 Entry performOperation(Entry workEntry, String operation, Entry opentry)
           
 void putEntry(Entry entry)
          Adds a new entry to the data source
 Entry queryReply(Entry entry)
          Performs a query/reply operations.
 Object querySchema(Object table)
          This function translates to whatever means a connector has to discover schema for a connection.
 void selectEntries()
          Prepare the Connector for sequential read.
 void terminate()
          Terminate the connector.
 
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getName, getNextClient, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logmsg, modEntry, pushback, queryOperations, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface, terminateServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.di.connector.ConnectorInterface
getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, pushback, queryOperations, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
 

Constructor Detail

AssemblyLineConnector

public AssemblyLineConnector()
Method Detail

initialize

public void initialize(Object o)
                throws Exception
Description copied from class: Connector
Initialize the connector. The connector may be passed a parameter of any kind by the user. It is up to the connector to determine whether this object can be used or not. The parameter is typically provided by a user script. When an AssemblyLine initializes it's Connectors, they are passed a ConnectorMode object.

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
o - User provided parameter
Throws:
Exception

terminate

public void terminate()
Description copied from class: Connector
Terminate the connector. This function closes all connection and releases all resources used by the connector. This function also calls the parser's closeParser() method if a parser is active.

Specified by:
terminate in interface ConnectorInterface
Overrides:
terminate in class Connector

selectEntries

public void selectEntries()
                   throws Exception
Description copied from class: Connector
Prepare the Connector for sequential read. If necessary, create a result set to be used for getNextEntry(). When the Connector is used as an Iterator in an AssemblyLine, this method will be called. Default is an empty method.

Specified by:
selectEntries in interface ConnectorInterface
Overrides:
selectEntries in class Connector
Throws:
Exception

getNextEntry

public Entry getNextEntry()
                   throws Exception
Description copied from class: Connector
Returns the next Entry from the connector. The entry is populated with attributes and values from the next entry in the input set.

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
- the next Entry, or null if no more data
Throws:
Exception
See Also:
Connector.selectEntries()

queryReply

public Entry queryReply(Entry entry)
                 throws Exception
Description copied from class: Connector
Performs a query/reply operations.

Specified by:
queryReply in interface ConnectorInterface
Overrides:
queryReply in class Connector
Parameters:
entry - The data used in outgoing call
Returns:
The entry returned by the peer
Throws:
Exception - Any exceptions thrown by the connector's underlying classes

querySchema

public Object querySchema(Object table)
                   throws Exception
Description copied from class: Connector
This function translates to whatever means a connector has to discover schema for a connection. The connector may implement this, in which case a Vector of Entry objects is returned for each column/attribute it discovered. For a database connector this would typically be column names and their attributes.

Each Entry in the Vector returned should contain the following attributes:

NameValue
nameThe name of the column/attribute/field ....
syntaxThe syntax or expected value type
sizeIf specified this will give the user a hint as to how long the field may be

Specified by:
querySchema in interface ConnectorInterface
Overrides:
querySchema in class Connector
Parameters:
table - The object on which to discover schema. This may be an Entry or a string value
Returns:
A Vector of com.ibm.di.entry.Entry objects describing each entity
Throws:
Exception
See Also:
Entry, Vector

getVersion

public String getVersion()
Return version information

Specified by:
getVersion in interface VersionInfoInterface

getModes

public Vector getModes(ConnectorConfig config)
Description copied from class: Connector
Returns the connector's modes.

Overrides:
getModes in class Connector
Parameters:
config - return the modes given this configuration
Returns:
The connector's modes

getALModes

public Vector getALModes(ConnectorConfig config)

deleteEntry

public void deleteEntry(Entry entry,
                        SearchCriteria search)
                 throws Exception
Description copied from class: Connector
Deletes an existing entry. The search criteria specifies which entry to modify. Some connectors may silently ignore the search criteria. For example, the LDAP connector will use the distinguished name ($dn) from the entry parameter (if it exists) rather than expanding the search criteria and search for the entry. Each connector's inner semantics governs wheter the search parameter is used or not.

Specified by:
deleteEntry in interface ConnectorInterface
Overrides:
deleteEntry in class Connector
Parameters:
entry - The entry data
search - The search criteria used to locate the entry to be deleted
Throws:
Exception - Any exceptions thrown by the connector's underlying classes

findEntry

public Entry findEntry(SearchCriteria search)
                throws Exception
Description copied from class: Connector
Finds an existing entry. The search criteria specifies which entry to locate

Specified by:
findEntry in interface ConnectorInterface
Overrides:
findEntry in class Connector
Parameters:
search - The search criteria used to locate the entry to be modified
Returns:
The entry found, or null if no or multiple entries found
Throws:
Exception - Any exceptions thrown by the connector's underlying classes

modEntry

public void modEntry(Entry entry,
                     SearchCriteria search,
                     Entry old)
              throws Exception
Description copied from class: Connector
Modifies an existing entry. The new entry data is given by the entry parameter and the search criteria specifies which entry to modify.

Specified by:
modEntry in interface ConnectorInterface
Overrides:
modEntry in class Connector
Parameters:
entry - The entry data
search - The search criteria used to locate the entry to be modified
old - The old entry found by the search criteria
Throws:
Exception - Any exceptions thrown by the connector's underlying classes

putEntry

public void putEntry(Entry entry)
              throws Exception
Description copied from class: Connector
Adds a new entry to the data source

Specified by:
putEntry in interface ConnectorInterface
Overrides:
putEntry in class Connector
Parameters:
entry - The entry data to add
Throws:
Exception - Any exceptions thrown by the connector's underlying classes

performOperation

public Entry performOperation(Entry workEntry,
                              String operation)
                       throws Exception
This method invokes the named operation in the target AssemblyLine.

Parameters:
workEntry - The work entry provided to the AssemblyLine
operation - The operation to invoke
Returns:
Result from operation
Throws:
Exception

performOperation

public Entry performOperation(Entry workEntry,
                              String operation,
                              Entry opentry)
                       throws Exception
Throws:
Exception