|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.connector.Connector
public abstract class Connector
The Connector class provides a default implementation of the ConnectorInterface.
If the entry/search results in multiple candidates for modify, delete etc the connector should use the clearFindEntries and addFindEntry methods to signal that the connector was unable to identify a single target entry. For example, the getFindEntryCount method is used by the AssemblyLine to detect this condition and branch off to the Multiple Entries Found hook so the user can deal with those situations. You should also use the getMaxDuplicateEntries method to obtain the maximum number of entries the user wants back in this case.
Field Summary | |
---|---|
static String[] |
ALL_MODES
|
protected Log |
myLog
The log object for logging messages |
static String |
PROPERTY_MESSAGE
|
static String |
PROPERTY_READER
|
static String |
PROPERTY_WRITER
|
Constructor Summary | |
---|---|
Connector()
Default constructor. |
Method Summary | |
---|---|
boolean |
addFindEntry(Object entry)
Adds an entry to the list of duplicate entries found. |
static Vector |
allModes()
Returns all Modes |
void |
clearFindEntries()
Removes all entries from the duplicate entry list. |
void |
debug(String msg)
Log a debug message to the connector's log |
boolean |
debugMode()
Returns whether debug mode is set or not. |
void |
deleteEntry(Entry entry,
SearchCriteria search)
Deletes an existing entry. |
Entry |
findEntry(Object key,
Object value)
Locates an entry based on a key/value pair. |
Entry |
findEntry(SearchCriteria search)
Finds an existing entry. |
Boolean |
getBoolean(Object p1)
Returns the value of a config parameter as a Boolean |
static Object |
getClassInstance(String className)
Returns a class instance of the specified classname |
Object |
getConfiguration()
Returns the current configuration for this connector |
Object |
getContext()
|
int |
getFindEntryCount()
Returns the number of duplicate entries in the list. |
Entry |
getFirstFindEntry()
Returns the first entry from the list of duplicate entries found. |
Log |
getLog()
Returns the current Log object. |
int |
getMaxDuplicateEntries()
Returns the current maximum number of duplicate entries buffered up by the connector. |
Vector |
getModes()
Returns the connector's modes. |
Vector |
getModes(ConnectorConfig config)
Returns the connector's modes. |
String |
getName()
Returns the name for this connector. |
ConnectorInterface |
getNextClient()
Server mode - return a clone of self that handles the next client instance when running in server mode. |
Entry |
getNextEntry()
Returns the next Entry from the connector. |
Entry |
getNextFindEntry()
Returns the next entry from the list of duplicate entries found. |
String |
getParam(String param)
Returns the value of a parameter as a java.lang.String object. |
ParserInterface |
getParser()
Returns the parser interface used by this connector. |
Object |
getProperty(Object p1)
Return a connector property. |
Entry |
getPushbackEntry()
Returns the pushed back entry for the connector. |
BaseConfiguration |
getRawConnectorConfiguration()
Returns the current configuration for the raw connector |
RSInterface |
getRSInterface()
Returns the current RSInterface object in use by this connector. |
boolean |
hasConfigValue(Object p1)
Return true if we have a configuration value for configName. |
boolean |
hasParser()
Check if the configuration includes a parser. |
void |
initialize(Object o)
Initialize the connector. |
void |
initParser(Object is,
Object os)
Initialize the connector's parser with input and output streams. |
boolean |
isDeltaSupported()
Returns true if this connector is able to perform delta updates |
boolean |
isExceptionFatal(Exception e)
Returns true if the exception is considered to be fatal. |
boolean |
isIOException(Throwable e)
Returns true if this connector considers the Throwable to be an IO Exception. |
void |
logmsg(String msg)
Log a message to the connector's log. |
void |
modEntry(Entry entry,
SearchCriteria search)
Modifies an existing entry. |
void |
modEntry(Entry entry,
SearchCriteria search,
Entry old)
Modifies an existing entry. |
void |
pushback(Entry e)
Make an entry the next entry to be iterated from the connector. |
void |
putEntry(Entry entry)
Adds 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)
Performs a query/reply operations. |
Object |
querySchema(Object source)
This function translates to whatever means a connector has to discover schema for a connection. |
Vector |
queryTables()
This function translates to whatever means a connector have to discover "tables" for a connection. |
void |
reconnect()
Reconnect to the underlying data source. |
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)
Sets the configuration for use by this 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)
Sets the Log object to use for logging messages |
void |
setMaxDuplicateEntries(int mde)
Sets the maximum number of duplicate entries to buffer up. |
void |
setModes(String[] modes)
Sets the connector's modes. |
void |
setModes(Vector modes)
Sets the connector's modes. |
void |
setName(String name)
Set the name for the connector. |
void |
setParam(String param,
String value)
Adds or replaces a connnector configuration parameter. |
void |
setParser(ParserInterface parser)
Sets the connector's parser. |
void |
setProperty(Object p1,
Object p2)
Set connector property. |
void |
setRSInterface(RSInterface rsi)
Sets the RSInterface for this connector to use. |
void |
terminate()
Terminate the connector. |
void |
terminateServer()
Default implementation - does nothing. |
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.server.VersionInfoInterface |
---|
getVersion |
Field Detail |
---|
public static final String PROPERTY_MESSAGE
public static final String PROPERTY_READER
public static final String PROPERTY_WRITER
public static final String[] ALL_MODES
protected Log myLog
Constructor Detail |
---|
public Connector()
Method Detail |
---|
public void setLog(Log logger)
setLog
in interface ConnectorInterface
logger
- The Log objectlogmsg(java.lang.String)
public Log getLog()
Log
public Boolean getBoolean(Object p1)
public boolean hasConfigValue(Object p1)
public void setMaxDuplicateEntries(int mde)
setMaxDuplicateEntries
in interface ConnectorInterface
mde
- The maximum number of entries to buffer uppublic int getMaxDuplicateEntries()
getMaxDuplicateEntries
in interface ConnectorInterface
public Entry getPushbackEntry()
getPushbackEntry
in interface ConnectorInterface
ConnectorInterface.pushback( Entry )
public void pushback(Entry e)
pushback
in interface ConnectorInterface
e
- The entry to be returned at the next getnext callpublic void logmsg(String msg)
msg
- The message to write to the logpublic void debug(String msg)
msg
- The message to write to the logpublic void setName(String name)
setName
in interface ConnectorInterface
name
- The name for the connectorpublic String getName()
getName
in interface ConnectorInterface
public void setModes(Vector modes)
modes
- The connector's modespublic void setModes(String[] modes)
modes
- The connector's modespublic Vector getModes()
public Vector getModes(ConnectorConfig config)
config
- return the modes given this configuration
public static Vector allModes()
public void setParam(String param, String value)
setParam
in interface ConnectorInterface
param
- The parameter namevalue
- The parameter valuepublic String getParam(String param)
getParam
in interface ConnectorInterface
param
- The connector configuration parameter name
public void setConfiguration(Object config)
setConfiguration
in interface ConnectorInterface
config
- The configuration object (an instance of ConnectorConfig)public Object getConfiguration()
getConfiguration
in interface ConnectorInterface
public BaseConfiguration getRawConnectorConfiguration()
getRawConnectorConfiguration
in interface ConnectorInterface
public void setRSInterface(RSInterface rsi)
setRSInterface
in interface ConnectorInterface
rsi
- The RSInterface objectpublic RSInterface getRSInterface()
public boolean debugMode()
public boolean isExceptionFatal(Exception e)
isExceptionFatal
in interface ConnectorInterface
e
- The exception object
public static Object getClassInstance(String className) throws Exception
className
- The fully qualified Java class name
Any
- exception thrown by the class loader
Exception
public void initialize(Object o) throws Exception
initialize
in interface ConnectorInterface
o
- User provided parameter
Exception
public boolean hasParser()
public void initParser(Object is, Object os) throws Exception
is
- The input object.os
- the output object.
Any
- exception thrown by the parser
Exception
getParser()
public void setParser(ParserInterface parser) throws IOException
parser
- The parser interface to use
IOException
public ParserInterface getParser()
public void terminate() throws Exception
terminate
in interface ConnectorInterface
Exception
public void selectEntries() throws Exception
selectEntries
in interface ConnectorInterface
Exception
public Entry getNextEntry() throws Exception
getNextEntry
in interface ConnectorInterface
Exception
selectEntries()
public ConnectorInterface getNextClient() throws Exception
getNextClient
in interface ConnectorInterface
Exception
public void replyEntry(Entry entry) throws Exception
replyEntry
in interface ConnectorInterface
Exception
public void modEntry(Entry entry, SearchCriteria search) throws Exception
modEntry
in interface ConnectorInterface
entry
- The entry datasearch
- The search criteria used to locate the entry to be modified
Exception
- Any exceptions thrown by the connector's underlying classespublic void modEntry(Entry entry, SearchCriteria search, Entry old) throws Exception
modEntry
in interface ConnectorInterface
entry
- The entry datasearch
- The search criteria used to locate the entry to be modifiedold
- The old entry found by the search criteria
Exception
- Any exceptions thrown by the connector's underlying classespublic void deleteEntry(Entry entry, SearchCriteria search) throws Exception
deleteEntry
in interface ConnectorInterface
entry
- The entry datasearch
- The search criteria used to locate the entry to be deleted
Exception
- Any exceptions thrown by the connector's underlying classespublic Entry findEntry(SearchCriteria search) throws Exception
findEntry
in interface ConnectorInterface
search
- The search criteria used to locate the entry to be modified
Exception
- Any exceptions thrown by the connector's underlying classespublic void putEntry(Entry entry) throws Exception
putEntry
in interface ConnectorInterface
entry
- The entry data to add
Exception
- Any exceptions thrown by the connector's underlying classespublic Entry queryReply(Entry entry) throws Exception
queryReply
in interface ConnectorInterface
entry
- The data used in outgoing call
Exception
- Any exceptions thrown by the connector's underlying classespublic Entry getFirstFindEntry() throws Exception
getFirstFindEntry
in interface ConnectorInterface
Exception
- Any exceptions thrown by the connector's underlying classespublic Entry getNextFindEntry() throws Exception
getNextFindEntry
in interface ConnectorInterface
Excepton
- Any exceptions thrown by the connector's underlying classes
Exception
public Entry findEntry(Object key, Object value)
key
- The attribute namevalue
- The attribute value match
public int getFindEntryCount()
getFindEntryCount
in interface ConnectorInterface
public void clearFindEntries()
public boolean addFindEntry(Object entry)
entry
- The entry object to addpublic void setCurrent(Entry entry, SearchCriteria search)
setCurrent
in interface ConnectorInterface
entry
- The entry we want to find for modification/deletesearch
- The SearchCriteria we want to changepublic void queryOperations(ConnectorConfig config) throws Exception
queryOperations
in interface ConnectorInterface
config
- The configuration
Exception
public Object querySchema(Object source) throws Exception
Each Entry in the Vector returned should contain the following attributes:
Name | Value |
---|---|
name | The name of the column/attribute/field .... |
syntax | The syntax or expected value type |
size | If specified this will give the user a hint as to how long the field may be |
querySchema
in interface ConnectorInterface
source
- The object on which to discover schema. This may be an Entry or a string value
Exception
Entry
,
Vector
public Vector queryTables() throws Exception
Exception
Vector
public Object getProperty(Object p1)
p1
- The property name
public void setProperty(Object p1, Object p2)
p1
- The property namep2
- The property valuepublic void registerScriptBeans(ScriptEngine se) throws Exception
registerScriptBeans
in interface ConnectorInterface
se
- The script engine context
Exception
public void reconnect(Object o) throws Exception
reconnect
in interface ConnectorInterface
o
- User provided parameter, which is sent to initialize()
Exception
initialize(Object)
public void reconnect() throws Exception
Exception
public boolean isDeltaSupported()
isDeltaSupported
in interface ConnectorInterface
public boolean isIOException(Throwable e)
ConnectorInterface
isIOException
in interface ConnectorInterface
e
- The Throwable to be determined
public void terminateServer() throws Exception
terminateServer
in interface ConnectorInterface
Exception
public Object getContext()
getContext
in interface ConnectorInterface
public void setContext(Object aContext)
setContext
in interface ConnectorInterface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |