|
|||||||||||
| 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. |
Object |
getConfiguration()
Returns the current configuration for this connector |
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. |
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. |
Entry |
getPushbackEntry()
Returns the pushed back entry for the connector. |
BaseConfiguration |
getRawConnectorConfiguration()
Returns the current configuration for the raw connector |
void |
initialize(Object o)
Initialize the connector. |
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 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. |
Object |
querySchema(Object source)
This function translates to whatever means a connector has to discover 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)
Sets the configuration for use by this connector. |
void |
setContext(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(String name)
Set the name for the connector. |
void |
setParam(String param,
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(String name)
name - The name for the connectorString getName()
void setParam(String param,
String value)
param - The parameter namevalue - The parameter valueString getParam(String param)
param - The connector configuration parameter name
void setConfiguration(Object config)
config - The configuration object (an instance of ConnectorConfig)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 Exception
se - The script engine context
Exception - if an error occurs.
void queryOperations(ConnectorConfig config)
throws Exception
config - The configuration
Exception - if an error occurs in the derived class implementation.
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 |
source - The object on which to discover schema. This may be an Entry
or a string value
Exception - if an error while retrieving the schema occurs.Entry,
Vector
void initialize(Object o)
throws Exception
o - User provided parameter
Exception - if the initialization of this connector fails.
void terminate()
throws Exception
Exception - if an error occurs.boolean isExceptionFatal(Exception e)
e - The exception object
ConnectorInterface getNextClient()
throws Exception
Exception - if an error occurs.
void selectEntries()
throws Exception
Exception - if an error occurs.
Entry getNextEntry()
throws Exception
Example:
var ctor = input.getConnector();
var entry = ctor.getNextEntry();
for (; entry != null; entry = ctor.getNextEntry()) {
main.logmsg("Read entry...");
main.dumpEntry(entry);
}
Exception - if an error occurs.selectEntries()
Entry getFirstFindEntry()
throws Exception
Exception - if an error occurs.
Entry getNextFindEntry()
throws Exception
Exception - if an error occurs.
void putEntry(Entry entry)
throws 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
Exception - if an error occurs.
void replyEntry(Entry entry)
throws Exception
entry - the information as an Entry
Exception - if an error occurs.
void modEntry(Entry entry,
SearchCriteria search)
throws Exception
entry - The entry datasearch - The search criteria used to locate the entry to be modified
Exception - if an error occurs.
void modEntry(Entry entry,
SearchCriteria search,
Entry old)
throws Exception
entry - The entry datasearch - The search criteria used to locate the entry to be modifiedold - The old entry found by the search criteria
Exception - if an error occurs.
void deleteEntry(Entry entry,
SearchCriteria search)
throws Exception
entry - The entry datasearch - The search criteria used to locate the entry to be deleted
Exception - if an error occurs.
Entry findEntry(SearchCriteria search)
throws 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
Exception - if an error occurs.
Entry queryReply(Entry entry)
throws Exception
entry - The data used in outgoing call
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()
call
void reconnect(Object o)
throws Exception
o - User provided parameter, which is sent to initialize()
Exception - if an error occurs.initialize(Object)boolean isDeltaSupported()
boolean isIOException(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 Exception
Exception - if an error occursObject 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(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 | ||||||||||