com.ibm.di.connector
Interface ConnectorInterface

All Known Implementing Classes:
ACTConnector, ADChangelogConnector, ADChangelogConnectorv2, AssemblyLineConnector, AxisEasyWSServerConnector, BTree, CommandLineConnector, Connector, DBChangelogConnector, DominoChangeDetectionConnector, DominoConnector, DominoUsersConnector, DSMLv2SOAPConnector, DSMLv2SOAPServerConnector, ExchangeChangelogConnector, FileConnector, FTPClientConnector, GLAConnector, HTTPClientConnector, HTTPServerConnector, IBMMQConnector, IDSChangelogConnector, ITIMAgentConnector, JDBCConnector, JMSConnector, JMXConnector, JNDIConnector, LDAPConnector, LDAPServerConnector, MailboxConnector, MemQConnector, MQePasswordStoreConnector, NetscapeChangelogConnector, NT4UserMetaDataConnector, OldHTTPCLient, OldHTTPServer, PESConnector, PropertiesConnector, RACConnector, SapALEIDocConnector, SapR3BorConnector, ScriptConnector, ServerNotificationsConnector, SNMPConnector, SNMPServerConnector, StreamConnector, SystemQueueConnector, TAMConnector, TCPConnector, TCPServerConnector, TIMConnector, TimerConnector, URLConnector, UserRegistryConnector, WSReceiverServerConnector, ZOSChangelogConnector

public interface ConnectorInterface


Method Summary
 void deleteEntry(Entry entry, SearchCriteria search)
          Delete an existing entry.
 Entry findEntry(SearchCriteria search)
          Find an existing entry.
 Object getConfiguration()
          Get the configuration object the Connector is using
 Object getContext()
           
 int getFindEntryCount()
          Return the number of duplicate entries from the last search
 Entry getFirstFindEntry()
          Get the first entry found in a search
 int getMaxDuplicateEntries()
          Return the maximum number of duplicate entries buffered up by the connector.
 String getName()
          Get the name of the Connector
 ConnectorInterface getNextClient()
          Server mode - return a clone of self that handles the next client instance when running in server mode.
 Entry getNextEntry()
          Return the next Entry from the connector.
 Entry getNextFindEntry()
          Return the next entry from the list of duplicate entries found.
 String getParam(String param)
          Get the value of a parameter for the Connector
 Entry getPushbackEntry()
          Return the pushed back entry for the connector.
 BaseConfiguration getRawConnectorConfiguration()
          Get the raw connector configuration
 void initialize(Object o)
          Initialize the connector.
 boolean isDeltaSupported()
          Returns true if this connector is able to perform delta updates
 boolean isExceptionFatal(Exception e)
          Return true if this exception is considered to be fatal.
 boolean isIOException(Throwable e)
          Returns true if this connector considers the Throwable to be an IO Exception.
 void modEntry(Entry entry, SearchCriteria search)
          Modify an existing entry.
 void modEntry(Entry entry, SearchCriteria search, Entry old)
          Modify an existing entry.
 void pushback(Entry e)
          Push back an entry.
 void putEntry(Entry entry)
          Add a new entry to the data source
 void queryOperations(ConnectorConfig config)
          Discover the operations for a connection given the provided configuration.
 Entry queryReply(Entry entry)
          This method is used for connectors that needs to combine putEntry/getNextEntry into one operation.
 Object querySchema(Object source)
          Discover the schema for a connection.
 void reconnect(Object o)
          Reconnect to the underlying data source
 void registerScriptBeans(ScriptEngine se)
          This method is called to register specific objects in the script context.
 void replyEntry(Entry entry)
          Send a reply to the connector.
 void selectEntries()
          Prepare the Connector for sequential read.
 void setConfiguration(Object config)
          Set the configuration object for the Connector
 void setContext(Object aContext)
           
 void setCurrent(Entry entry, SearchCriteria search)
          Change the SearchCriteria search to find the entry sent as a parameter.
 void setLog(Log logger)
          Set the log object to use for logging messages
 void setMaxDuplicateEntries(int p1)
          Set the maximum number of duplicate entries to buffer up.
 void setName(String name)
          Set the name of the Connector
 void setParam(String param, String value)
          Set a parameter in the Connector
 void setRSInterface(RSInterface rsi)
          Set the RSInterface (server)
 void terminate()
          Terminate the connector.
 void terminateServer()
          Interrupts and shuts down the Connector if it runs in Server Mode.
 

Method Detail

setName

void setName(String name)
Set the name of the Connector

Parameters:
name - The new name

getName

String getName()
Get the name of the Connector

Returns:
The name

setParam

void setParam(String param,
              String value)
Set a parameter in the Connector

Parameters:
param - The name of the parameter
value - The new parameter value

getParam

String getParam(String param)
Get the value of a parameter for the Connector

Parameters:
param - The name of the parameter
Returns:
The parameter value

setConfiguration

void setConfiguration(Object config)
Set the configuration object for the Connector

Parameters:
config - The new configuration object

getConfiguration

Object getConfiguration()
Get the configuration object the Connector is using

Returns:
The configuration object

getRawConnectorConfiguration

BaseConfiguration getRawConnectorConfiguration()
Get the raw connector configuration

Returns:
The raw connector configuration

setRSInterface

void setRSInterface(RSInterface rsi)
Set the RSInterface (server)

Parameters:
rsi - The new RSInterface value

setLog

void setLog(Log logger)
Set the log object to use for logging messages

Parameters:
logger - The new log object
See Also:
Connector.logmsg(String)

setMaxDuplicateEntries

void setMaxDuplicateEntries(int p1)
Set the maximum number of duplicate entries to buffer up. This is used by the lookup functions when a lookup returns more than one entry.

Parameters:
p1 - The new maxDuplicateEntries value

getMaxDuplicateEntries

int getMaxDuplicateEntries()
Return the maximum number of duplicate entries buffered up by the connector.

Returns:
The maxDuplicateEntries value

registerScriptBeans

void registerScriptBeans(ScriptEngine se)
                         throws Exception
This method is called to register specific objects in the script context.

Parameters:
se - The script engine context
Throws:
Exception

queryOperations

void queryOperations(ConnectorConfig config)
                     throws Exception
Discover the operations for a connection given the provided configuration. The implementation should update the configuration object with available operations. If this method requires the connector to be initialized then the connector must perform init/terminate operations itself.

Parameters:
config - The configuration
Throws:
Exception

querySchema

Object querySchema(Object source)
                   throws Exception
Discover the schema for a connection. For a database connector this would typically be column names and their attributes.

Parameters:
source - The object on which to discover schema
Returns:
A Vector of com.ibm.di.entry.Entry objects describing each entity
Throws:
Exception

initialize

void initialize(Object o)
                throws Exception
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.

Parameters:
o - User provided parameter
Throws:
Exception

terminate

void terminate()
               throws Exception
Terminate the connector. Close all connections and release all resources used by the connector.

Throws:
Exception

isExceptionFatal

boolean isExceptionFatal(Exception e)
Return true if this exception is considered to be fatal.

Parameters:
e - The exception object
Returns:
Whether the exception is fatal or not

getNextClient

ConnectorInterface getNextClient()
                                 throws Exception
Server mode - return a clone of self that handles the next client instance when running in server mode. The returned connector may be used in its own thread to handle a "client" request so if the returned instance is returned more than once it must be thread safe.

Throws:
Exception

selectEntries

void selectEntries()
                   throws Exception
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.

Throws:
Exception

getNextEntry

Entry getNextEntry()
                   throws Exception
Return the next Entry from the connector.

Returns:
- the next Entry, or null if no more data
Throws:
Exception
See Also:
selectEntries()

getFirstFindEntry

Entry getFirstFindEntry()
                        throws Exception
Get the first entry found in a search

Returns:
The first entry found, null if there is no list of found entries
Throws:
Exception

getNextFindEntry

Entry getNextFindEntry()
                       throws Exception
Return the next entry from the list of duplicate entries found.

Returns:
The next entry from the list, null if list is empty or at the end
Throws:
Exception

putEntry

void putEntry(Entry entry)
              throws Exception
Add a new entry to the data source

Parameters:
entry - The entry data to add
Throws:
Exception

replyEntry

void replyEntry(Entry entry)
                throws Exception
Send a reply to the connector.

Throws:
Exception

modEntry

void modEntry(Entry entry,
              SearchCriteria search)
              throws Exception
Modify an existing entry. The new entry data is given by the entry parameter and the search criteria specifies which entry to modify.

Parameters:
entry - The entry data
search - The search criteria used to locate the entry to be modified
Throws:
Exception

modEntry

void modEntry(Entry entry,
              SearchCriteria search,
              Entry old)
              throws Exception
Modify an existing entry. The new entry data is given by the entry parameter and the search criteria specifies which entry to modify.

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
Since:
5.1

deleteEntry

void deleteEntry(Entry entry,
                 SearchCriteria search)
                 throws Exception
Delete an existing entry.

Parameters:
entry - The entry data
search - The search criteria used to locate the entry to be deleted
Throws:
Exception

findEntry

Entry findEntry(SearchCriteria search)
                throws Exception
Find an existing entry. The search criteria specifies which entry to locate

Parameters:
search - The search criteria used to locate the entry
Returns:
The entry found, or null if no or multiple entries found
Throws:
Exception

queryReply

Entry queryReply(Entry entry)
                 throws Exception
This method is used for connectors that needs to combine putEntry/getNextEntry into one operation.

Parameters:
entry - The data used in outgoing call
Returns:
The entry returned by the peer
Throws:
Exception

getFindEntryCount

int getFindEntryCount()
Return the number of duplicate entries from the last search

Returns:
Number of duplicate entries in list

setCurrent

void setCurrent(Entry entry,
                SearchCriteria search)
Change the SearchCriteria search to find the entry sent as a parameter. Used when multiple entries found, and you want to modify or delete one of them. Only a few connectors need to implement this.

Parameters:
entry - The entry we want to find for modification/delete
search - The SearchCriteria we want to change

getPushbackEntry

Entry getPushbackEntry()
Return the pushed back entry for the connector.

Returns:
The pushed back entry or null if no such entry exists.
See Also:
pushback( Entry )

pushback

void pushback(Entry e)
Push back an entry. A connector may read one record and then push it back for subsequent getnext calls.

Parameters:
e - The entry to push back

reconnect

void reconnect(Object o)
               throws Exception
Reconnect to the underlying data source

Parameters:
o - User provided parameter, which is sent to initialize()
Throws:
Exception
See Also:
initialize( Object )

isDeltaSupported

boolean isDeltaSupported()
Returns true if this connector is able to perform delta updates

Returns:
true if delta updates are supported, false otherwise

isIOException

boolean isIOException(Throwable e)
Returns true if this connector considers the Throwable to be an IO Exception. This is needed because we only try reconnection for IO Exceptions, and some Connectors do not return an IOException for an IO Exception.

Parameters:
e - The Throwable to be determined
Returns:
true if this Throwable is an IO Exception

terminateServer

void terminateServer()
                     throws Exception
Interrupts and shuts down the Connector if it runs in Server Mode. Does not have effect if the Connector is not running in Server Mode.

Throws:
Exception

getContext

Object getContext()

setContext

void setContext(Object aContext)