|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConnectorInterface
The interface object which all Connectors should implement.
Connector
Method Summary | |
---|---|
void |
deleteEntry(Entry entry,
SearchCriteria search)
Deletes an existing entry. |
Entry |
findEntry(SearchCriteria search)
Finds an existing entry. |
java.lang.Object |
getConfiguration()
Returns the current configuration for this connector |
java.lang.Object |
getContext()
Returns the parent task of the connector - an AssemblyLine
object. |
int |
getFindEntryCount()
Returns the number of duplicate entries in the list. |
Entry |
getFirstFindEntry()
Returns the first entry from the list of duplicate entries found. |
int |
getMaxDuplicateEntries()
Returns the current maximum number of duplicate entries buffered up by the connector. |
java.lang.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. |
java.lang.String |
getParam(java.lang.String param)
Returns the value of a parameter as a java.lang.String object. |
Entry |
getPushbackEntry()
Returns the pushed back entry for the connector. |
BaseConfiguration |
getRawConnectorConfiguration()
Returns the current configuration for the raw connector |
void |
initialize(java.lang.Object o)
Initialize the connector. |
boolean |
isDeltaSupported()
Returns true if this connector is able to perform delta updates |
boolean |
isExceptionFatal(java.lang.Exception e)
Returns true if the exception is considered to be fatal. |
boolean |
isIOException(java.lang.Throwable e)
Returns true if this connector considers the
Throwable to be an IOException . |
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. |
java.lang.Object |
querySchema(java.lang.Object source)
This function translates to whatever means a connector has to discover schema for a connection. |
void |
reconnect(java.lang.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(java.lang.Object config)
Sets the configuration for use by this connector. |
void |
setContext(java.lang.Object aContext)
Sets the parent task of the connector - an AssemblyLine object. |
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 |
setName(java.lang.String name)
Set the name for the connector. |
void |
setParam(java.lang.String param,
java.lang.String value)
Adds or replaces a connector configuration parameter. |
void |
setRSInterface(RSInterface rsi)
Sets the RSInterface for this connector to use. |
void |
terminate()
Terminate the connector. |
void |
terminateServer()
Interrupts and shuts down the Connector if it runs in Server Mode. |
Method Detail |
---|
void setName(java.lang.String name)
name
- The name for the connectorjava.lang.String getName()
void setParam(java.lang.String param, java.lang.String value)
param
- The parameter namevalue
- The parameter valuejava.lang.String getParam(java.lang.String param)
param
- The connector configuration parameter name
void setConfiguration(java.lang.Object config)
config
- The configuration object (an instance of ConnectorConfig)java.lang.Object getConfiguration()
BaseConfiguration getRawConnectorConfiguration()
void setRSInterface(RSInterface rsi)
rsi
- The RSInterface objectvoid setLog(Log logger)
logger
- The Log
objectRSInterface.logmsg(String)
void setMaxDuplicateEntries(int mde)
mde
- The maximum number of entries to buffer upint getMaxDuplicateEntries()
void registerScriptBeans(ScriptEngine se) throws java.lang.Exception
se
- The script engine context
java.lang.Exception
- if an error occurs.void queryOperations(ConnectorConfig config) throws java.lang.Exception
config
- The configuration
java.lang.Exception
- if an error occurs in the derived class implementation.java.lang.Object querySchema(java.lang.Object source) throws java.lang.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 |
source
- The object on which to discover schema. This may be an Entry
or a string value
java.lang.Exception
- if an error while retrieving the schema occurs.Entry
,
Vector
void initialize(java.lang.Object o) throws java.lang.Exception
o
- User provided parameter
java.lang.Exception
- if the initialization of this connector fails.void terminate() throws java.lang.Exception
java.lang.Exception
- if an error occurs.boolean isExceptionFatal(java.lang.Exception e)
e
- The exception object
ConnectorInterface getNextClient() throws java.lang.Exception
java.lang.Exception
- if an error occurs.void selectEntries() throws java.lang.Exception
java.lang.Exception
- if an error occurs.Entry getNextEntry() throws java.lang.Exception
Example:
var ctor = input.getConnector(); var entry = ctor.getNextEntry(); for (; entry != null; entry = ctor.getNextEntry()) { main.logmsg("Read entry..."); main.dumpEntry(entry); }
java.lang.Exception
- if an error occurs.selectEntries()
Entry getFirstFindEntry() throws java.lang.Exception
java.lang.Exception
- if an error occurs.Entry getNextFindEntry() throws java.lang.Exception
java.lang.Exception
- if an error occurs.void putEntry(Entry entry) throws java.lang.Exception
Example:
var ctor = write.getConnector(); for (i = 0; i < 10; i++) { var entry = system.newEntry(); entry.setAttribute("linenumber", i); entry.setAttribute("line", i + " line of text..."); main.logmsg("Writes entry to output..."); main.dumpEntry(entry); ctor.putEntry(entry); }
entry
- The entry data to add
java.lang.Exception
- if an error occurs.void replyEntry(Entry entry) throws java.lang.Exception
entry
- the information as an Entry
java.lang.Exception
- if an error occurs.void modEntry(Entry entry, SearchCriteria search) throws java.lang.Exception
entry
- The entry datasearch
- The search criteria used to locate the entry to be modified
java.lang.Exception
- if an error occurs.void modEntry(Entry entry, SearchCriteria search, Entry old) throws java.lang.Exception
entry
- The entry datasearch
- The search criteria used to locate the entry to be modifiedold
- The old entry found by the search criteria
java.lang.Exception
- if an error occurs.void deleteEntry(Entry entry, SearchCriteria search) throws java.lang.Exception
entry
- The entry datasearch
- The search criteria used to locate the entry to be deleted
java.lang.Exception
- if an error occurs.Entry findEntry(SearchCriteria search) throws java.lang.Exception
Here is an example of how to find all people with names starting with 'J' which are from IBM organization in US.
Example:
var ctor = input.getConnector(); var crit = new com.ibm.di.SearchCriteria("$dn", com.ibm.di.SearchCriteria.SUBSTRING, "c=US,o=IBM"); crit.addCriteria("name", com.ibm.di.SearchCriteria.INITIAL_STRING, "J"); crit.addCriteria("objectclass", com.ibm.di.SearchCriteria.SUBSTRING, "person"); var res = ctor.findEntry(crit); if (res != null) { main.logmsg("Found entry:"); main.dumpEntry(res); } else { if( getFindEntryCount()> 1 ){ main.logmsg("Found these entries:"); while ( (entry = ctor.getNextFindEntry()) != null ) { main.dumpEntry(entry); } } else { main.logmsg("Entry not found!"); } }
search
- The search criteria used to locate the entry to be modified
java.lang.Exception
- if an error occurs.Entry queryReply(Entry entry) throws java.lang.Exception
entry
- The data used in outgoing call
java.lang.Exception
- if an error occurs.int getFindEntryCount()
void setCurrent(Entry entry, SearchCriteria search)
entry
- The entry we want to find for modification/deletesearch
- The SearchCriteria we want to changeEntry getPushbackEntry()
pushback( Entry )
void pushback(Entry e)
getNextEntry()
call. The task
component first checks if there is a pushback entry available, and if so,
returns that entry as the next input entry.
e
- The entry to be returned at the next getNextEntry()
callvoid reconnect(java.lang.Object o) throws java.lang.Exception
o
- User provided parameter, which is sent to initialize()
java.lang.Exception
- if an error occurs.initialize(Object)
boolean isDeltaSupported()
boolean isIOException(java.lang.Throwable e)
true
if this connector considers the
Throwable
to be an IOException
. This is needed because
we only try reconnection for IO Exceptions, and some Connectors do not
return an IOException for an IO Exception.
e
- The Throwable
to be determined
void terminateServer() throws java.lang.Exception
java.lang.Exception
- if an error occursjava.lang.Object getContext()
AssemblyLine
object.
Here is an example hook of how to print the names of all enabled or passive components in the current running assembly line.
Example:
var ctx = thisConnector.getConnector().getContext(); var clist = ctx.getConnectors(); for (i = 0; i < clist.size(); i++) main.logmsg(clist.get(i).getName());
void setContext(java.lang.Object aContext)
AssemblyLine
object.
aContext
- the new context to which the connector will belong.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |