Class ConnectorDelegate
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- com.ibm.di.osgi.ConnectorDelegate
-
- All Implemented Interfaces:
ConnectorInterface
,VersionInfoInterface
- Direct Known Subclasses:
ChangeDetectionConnectorDelegate
public class ConnectorDelegate extends Connector
Used to act as a way for accessing ConnectorComponent services from the OSGi layer.
Note: This class is for internal usage only. Any dependency from the end-user will not be supported. Changes to this class will happen without a warning.- Since:
- 7.2
-
-
Field Summary
Fields Modifier and Type Field Description protected Connector
worker
-
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
-
-
Constructor Summary
Constructors Constructor Description ConnectorDelegate()
ConnectorDelegate(java.lang.String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addFindEntry(java.lang.Object entry)
Adds an entry to the list of duplicate entries found.void
clearFindEntries()
Removes all entries from the duplicate entry list.protected java.lang.Object
clone()
void
debug(java.lang.String msg)
Log a debug message to the connector's logboolean
debugMode()
Returns whether debug mode is set or not.void
deleteEntry(Entry entry, SearchCriteria search)
Deletes an existing entry.boolean
equals(java.lang.Object o)
Entry
findEntry(SearchCriteria search)
Finds an existing entry.Entry
findEntry(java.lang.Object arg0, java.lang.Object arg1)
Locates an entry based on a key/value pair.java.lang.Boolean
getBoolean(java.lang.Object p1)
Returns the value of a config parameter as a Booleanjava.lang.Object
getConfiguration()
Returns the current configuration for this connectorjava.lang.Object
getContext()
Returns the parent task of the connector - anAssemblyLine
object.ConnectorInterface
getDelegate()
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.java.util.Vector<java.lang.String>
getModes()
Returns the connector's modes.java.util.Vector<java.lang.String>
getModes(ConnectorConfig config)
Returns the connector's modes.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.ParserInterface
getParser()
Returns the parser interface used by this connector.java.lang.Object
getProperty(java.lang.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 connectorRSInterface
getRSInterface()
Returns the current RSInterface object in use by this connector.javax.swing.JComponent
getUI()
This method returns the user interface component presented to the user to configure the connector.java.lang.String
getVersion()
Version information.boolean
hasConfigValue(java.lang.Object p1)
Return true if we have a configuration value for configName.int
hashCode()
boolean
hasParser()
Check if the configuration includes a parser.void
initialize(java.lang.Object o)
Initialize the connector.void
initParser(java.lang.Object is, java.lang.Object os)
Initialize the connector's parser with input and output streams.boolean
isDeltaSupported()
Returns true if this connector is able to perform delta updatesboolean
isExceptionFatal(java.lang.Exception e)
Returns true if the exception is considered to be fatal.boolean
isIOException(java.lang.Throwable e)
Returnstrue
if this connector considers theThrowable
to be anIOException
.void
logError(java.lang.String msg)
Log an error message to the connector's logvoid
logmsg(java.lang.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 sourcevoid
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.java.util.Vector<java.lang.String>
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(java.lang.Object o)
Reconnect to the underlying data sourcevoid
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 - anAssemblyLine
object.void
setCurrent(Entry entry, SearchCriteria search)
Change the SearchCriteria search to find the entry sent as a parameter.void
setDebugMode(boolean debug)
Modify the debug mode of the component.void
setId(java.lang.String id)
void
setLog(Log logger)
Sets the Log object to use for logging messagesvoid
setMaxDuplicateEntries(int mde)
Sets the maximum number of duplicate entries to buffer up.void
setModes(java.lang.String[] modes)
Sets the connector's modes.void
setModes(java.util.Vector<java.lang.String> modes)
Sets the connector's modes.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
setParser(ParserInterface parser)
Sets the connector's parser.void
setProperty(java.lang.Object p1, java.lang.Object p2)
Set connector property.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.java.lang.String
toString()
-
Methods inherited from class com.ibm.di.connector.Connector
allModes, extractExceptionInformation, getClassInstance
-
-
-
-
Field Detail
-
worker
protected Connector worker
-
-
Method Detail
-
getVersion
public java.lang.String getVersion()
Description copied from interface:VersionInfoInterface
Version information.- Returns:
- version information
-
initialize
public void initialize(java.lang.Object o) throws java.lang.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 interfaceConnectorInterface
- Overrides:
initialize
in classConnector
- Parameters:
o
- User provided parameter- Throws:
java.lang.Exception
- if the initialization of this connector fails.
-
addFindEntry
public boolean addFindEntry(java.lang.Object entry)
Description copied from class:Connector
Adds an entry to the list of duplicate entries found.- Overrides:
addFindEntry
in classConnector
- Parameters:
entry
- The entry object to add- Returns:
- true if the entry was successfully added, false if the passed
entry is
null
or the found entries are more than the maximumDuplicatEntriesReturned limit.
-
clearFindEntries
public void clearFindEntries()
Description copied from class:Connector
Removes all entries from the duplicate entry list.- Overrides:
clearFindEntries
in classConnector
-
debug
public void debug(java.lang.String msg)
Description copied from class:Connector
Log a debug message to the connector's log
-
debugMode
public boolean debugMode()
Description copied from class:Connector
Returns whether debug mode is set or not. May be accessed by different threads.
-
deleteEntry
public void deleteEntry(Entry entry, SearchCriteria search) throws java.lang.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 whether the search parameter is used or not.- Specified by:
deleteEntry
in interfaceConnectorInterface
- Overrides:
deleteEntry
in classConnector
- Parameters:
entry
- The entry datasearch
- The search criteria used to locate the entry to be deleted- Throws:
java.lang.Exception
- if an error occurs.
-
findEntry
public Entry findEntry(java.lang.Object arg0, java.lang.Object arg1)
Description copied from class:Connector
Locates an entry based on a key/value pair. The search is translated to the connector's format for searching.
-
findEntry
public Entry findEntry(SearchCriteria search) throws java.lang.Exception
Description copied from class:Connector
Finds an existing entry. The search criteria specifies which entry to locateHere 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!"); } }
- Specified by:
findEntry
in interfaceConnectorInterface
- Overrides:
findEntry
in classConnector
- 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:
java.lang.Exception
- if an error occurs.
-
getBoolean
public java.lang.Boolean getBoolean(java.lang.Object p1)
Description copied from class:Connector
Returns the value of a config parameter as a Boolean- Overrides:
getBoolean
in classConnector
- Parameters:
p1
- the key that boolean value is mapped under.- Returns:
- the Boolean value or null if not found.
-
getConfiguration
public java.lang.Object getConfiguration()
Description copied from class:Connector
Returns the current configuration for this connector- Specified by:
getConfiguration
in interfaceConnectorInterface
- Overrides:
getConfiguration
in classConnector
- Returns:
- The configuration object (an instance of ConnectorConfig), or null if the configuration is not established
-
getContext
public java.lang.Object getContext()
Description copied from class:Connector
Returns the parent task of the connector - anAssemblyLine
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());
- Specified by:
getContext
in interfaceConnectorInterface
- Overrides:
getContext
in classConnector
- Returns:
- the context to which the connector belongs
-
getFindEntryCount
public int getFindEntryCount()
Description copied from class:Connector
Returns the number of duplicate entries in the list.- Specified by:
getFindEntryCount
in interfaceConnectorInterface
- Overrides:
getFindEntryCount
in classConnector
- Returns:
- Number of duplicate entries in the list
-
getFirstFindEntry
public Entry getFirstFindEntry() throws java.lang.Exception
Description copied from class:Connector
Returns the first entry from the list of duplicate entries found. Also resets the counter for getNextFindEntry- Specified by:
getFirstFindEntry
in interfaceConnectorInterface
- Overrides:
getFirstFindEntry
in classConnector
- Returns:
- The first entry from the list or null if list is empty
- Throws:
java.lang.Exception
- if an error occurs.
-
getMaxDuplicateEntries
public int getMaxDuplicateEntries()
Description copied from class:Connector
Returns the current maximum number of duplicate entries buffered up by the connector.- Specified by:
getMaxDuplicateEntries
in interfaceConnectorInterface
- Overrides:
getMaxDuplicateEntries
in classConnector
- Returns:
- Max number of duplicate entries
-
getModes
public java.util.Vector<java.lang.String> getModes()
Description copied from class:Connector
Returns the connector's modes.
-
getModes
public java.util.Vector<java.lang.String> getModes(ConnectorConfig config)
Description copied from class:Connector
Returns the connector's modes.
-
getName
public java.lang.String getName()
Description copied from class:Connector
Returns the name for this connector.- Specified by:
getName
in interfaceConnectorInterface
- Overrides:
getName
in classConnector
- Returns:
- The connector's name
-
getNextClient
public ConnectorInterface getNextClient() throws java.lang.Exception
Description copied from class:Connector
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.- Specified by:
getNextClient
in interfaceConnectorInterface
- Overrides:
getNextClient
in classConnector
- Returns:
- the clone of itself
- Throws:
java.lang.Exception
- if an error occurs.
-
getNextEntry
public Entry getNextEntry() throws java.lang.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.Example:
var ctor = input.getConnector(); var entry = ctor.getNextEntry(); for (; entry != null; entry = ctor.getNextEntry()) { main.logmsg("Read entry..."); main.dumpEntry(entry); }
- Specified by:
getNextEntry
in interfaceConnectorInterface
- Overrides:
getNextEntry
in classConnector
- Returns:
- - the next Entry, or null if no more data
- Throws:
java.lang.Exception
- if an error occurs.- See Also:
ConnectorInterface.selectEntries()
-
getNextFindEntry
public Entry getNextFindEntry() throws java.lang.Exception
Description copied from class:Connector
Returns the next entry from the list of duplicate entries found.- Specified by:
getNextFindEntry
in interfaceConnectorInterface
- Overrides:
getNextFindEntry
in classConnector
- Returns:
- The next entry from the list or null if list is empty or at the end
- Throws:
java.lang.Exception
- if an error occurs.
-
getParam
public java.lang.String getParam(java.lang.String param)
Description copied from class:Connector
Returns the value of a parameter as a java.lang.String object.- Specified by:
getParam
in interfaceConnectorInterface
- Overrides:
getParam
in classConnector
- Parameters:
param
- The connector configuration parameter name- Returns:
- The parameter's value or null if no such parameter exists
-
getParser
public ParserInterface getParser()
Description copied from class:Connector
Returns the parser interface used by this connector.
-
getProperty
public java.lang.Object getProperty(java.lang.Object p1)
Description copied from class:Connector
Return a connector property. Each connector may have static or runtime properties which can be accessed with this method. Note that connector properties are very different from the connector configuration.- Overrides:
getProperty
in classConnector
- Parameters:
p1
- The property name- Returns:
- The property value/object
-
getPushbackEntry
public Entry getPushbackEntry()
Description copied from class:Connector
Returns the pushed back entry for the connector.- Specified by:
getPushbackEntry
in interfaceConnectorInterface
- Overrides:
getPushbackEntry
in classConnector
- Returns:
- The pushed back entry or null if no such entry exists.
- See Also:
ConnectorInterface.pushback( Entry )
-
getRawConnectorConfiguration
public BaseConfiguration getRawConnectorConfiguration()
Description copied from class:Connector
Returns the current configuration for the raw connector- Specified by:
getRawConnectorConfiguration
in interfaceConnectorInterface
- Overrides:
getRawConnectorConfiguration
in classConnector
- Returns:
- The configuration object or null if the configuration is not established
-
getRSInterface
public RSInterface getRSInterface()
Description copied from class:Connector
Returns the current RSInterface object in use by this connector. If not set, returncom.ibm.di.server.RS.getServer()
- Overrides:
getRSInterface
in classConnector
- Returns:
- Connector's RSInterface object
-
getUI
public javax.swing.JComponent getUI()
Description copied from class:Connector
This method returns the user interface component presented to the user to configure the connector.
-
hasConfigValue
public boolean hasConfigValue(java.lang.Object p1)
Description copied from class:Connector
Return true if we have a configuration value for configName. The value must be present and have a value not equal to the empty string.- Overrides:
hasConfigValue
in classConnector
- Parameters:
p1
- the key name of the value- Returns:
- true if a value with that key is present, false otherwise.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
clone
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
hasParser
public boolean hasParser()
Description copied from class:Connector
Check if the configuration includes a parser.
-
initParser
public void initParser(java.lang.Object is, java.lang.Object os) throws java.lang.Exception
Description copied from class:Connector
Initialize the connector's parser with input and output streams. If the parser has not been loaded then an attempt is made to load it. The input and output objects may be one of InputStream, OutputStream or Socket.- Overrides:
initParser
in classConnector
- Parameters:
is
- The input object.os
- the output object.- Throws:
java.lang.Exception
- if a parser is not configured or the exception is derived from the parser- See Also:
Connector.getParser()
-
isDeltaSupported
public boolean isDeltaSupported()
Description copied from class:Connector
Returns true if this connector is able to perform delta updates- Specified by:
isDeltaSupported
in interfaceConnectorInterface
- Overrides:
isDeltaSupported
in classConnector
- Returns:
- true if delta updates are supported, false otherwise
-
isExceptionFatal
public boolean isExceptionFatal(java.lang.Exception e)
Description copied from class:Connector
Returns true if the exception is considered to be fatal. This governs whether the AssemblyLine logs the error as a warning or terminates. By default all exceptions are fatal.- Specified by:
isExceptionFatal
in interfaceConnectorInterface
- Overrides:
isExceptionFatal
in classConnector
- Parameters:
e
- The exception object- Returns:
- whether the exception is fatal or not
-
isIOException
public boolean isIOException(java.lang.Throwable e)
Description copied from class:Connector
Returnstrue
if this connector considers theThrowable
to be anIOException
. This is needed because we only try reconnection for IO Exceptions, and some Connectors do not return an IOException for an IO Exception.- Specified by:
isIOException
in interfaceConnectorInterface
- Overrides:
isIOException
in classConnector
- Parameters:
e
- TheThrowable
to be determined- Returns:
- true if this Throwable is an IO Exception
-
logError
public void logError(java.lang.String msg)
Description copied from class:Connector
Log an error message to the connector's log
-
logmsg
public void logmsg(java.lang.String msg)
Description copied from class:Connector
Log a message to the connector's log. The message is prefixed by the connector's name.
-
modEntry
public void modEntry(Entry entry, SearchCriteria search) throws java.lang.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 interfaceConnectorInterface
- Overrides:
modEntry
in classConnector
- Parameters:
entry
- The entry datasearch
- The search criteria used to locate the entry to be modified- Throws:
java.lang.Exception
- if an error occurs.
-
modEntry
public void modEntry(Entry entry, SearchCriteria search, Entry old) throws java.lang.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 interfaceConnectorInterface
- Overrides:
modEntry
in classConnector
- Parameters:
entry
- The entry datasearch
- The search criteria used to locate the entry to be modifiedold
- The old entry found by the search criteria- Throws:
java.lang.Exception
- if an error occurs.
-
pushback
public void pushback(Entry e)
Description copied from class:Connector
Make an entry the next entry to be iterated from the connector. This method along with getPushbackEntry is used by the AssemblyLineComponent when it iterates the connector. A connector may read one record and then push it back for the subsequentConnectorInterface.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.- Specified by:
pushback
in interfaceConnectorInterface
- Overrides:
pushback
in classConnector
- Parameters:
e
- The entry to be returned at the nextConnectorInterface.getNextEntry()
call
-
putEntry
public void putEntry(Entry entry) throws java.lang.Exception
Description copied from class:Connector
Adds a new entry to the data sourceExample:
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); }
- Specified by:
putEntry
in interfaceConnectorInterface
- Overrides:
putEntry
in classConnector
- Parameters:
entry
- The entry data to add- Throws:
java.lang.Exception
- if an error occurs.
-
queryOperations
public void queryOperations(ConnectorConfig config) throws java.lang.Exception
Description copied from class:Connector
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.- Specified by:
queryOperations
in interfaceConnectorInterface
- Overrides:
queryOperations
in classConnector
- Parameters:
config
- The configuration- Throws:
java.lang.Exception
- if an error occurs in the derived class implementation.
-
queryReply
public Entry queryReply(Entry entry) throws java.lang.Exception
Description copied from class:Connector
Performs a query/reply operations.- Specified by:
queryReply
in interfaceConnectorInterface
- Overrides:
queryReply
in classConnector
- Parameters:
entry
- The data used in outgoing call- Returns:
- The entry returned by the peer
- Throws:
java.lang.Exception
- if an error occurs.
-
querySchema
public java.lang.Object querySchema(java.lang.Object source) throws java.lang.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:
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 - Specified by:
querySchema
in interfaceConnectorInterface
- Overrides:
querySchema
in classConnector
- Parameters:
source
- 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:
java.lang.Exception
- if an error while retrieving the schema occurs.- See Also:
Entry
,Vector
-
queryTables
public java.util.Vector<java.lang.String> queryTables() throws java.lang.Exception
Description copied from class:Connector
This function translates to whatever means a connector have to discover "tables" for a connection. The connector may implement this in which case a Vector of strings is returned. For a database connector this would typically be a list of table/view names the user can access with the current set of parameters. For other connectors this might translate to different concepts.- Overrides:
queryTables
in classConnector
- Returns:
- A list of table names
- Throws:
java.lang.Exception
- if an error occurs.- See Also:
Vector
-
reconnect
public void reconnect() throws java.lang.Exception
Description copied from class:Connector
Reconnect to the underlying data source.The following code could be placed in the 'On Connection lost' hook to change the connector's
ldapUrl
to another server in case the connection is lost.Example:
thisConnector.setParam("ldapURL", "ldap://backupserver.acme.com:389"); // reconnect to backup server thisConnector.reconnect();
- Overrides:
reconnect
in classConnector
- Throws:
java.lang.Exception
- if an error occurs.- See Also:
Connector.initialize(Object)
-
reconnect
public void reconnect(java.lang.Object o) throws java.lang.Exception
Description copied from class:Connector
Reconnect to the underlying data source- Specified by:
reconnect
in interfaceConnectorInterface
- Overrides:
reconnect
in classConnector
- Parameters:
o
- User provided parameter, which is sent to initialize()- Throws:
java.lang.Exception
- if an error occurs.- See Also:
ConnectorInterface.initialize(Object)
-
registerScriptBeans
public void registerScriptBeans(ScriptEngine se) throws java.lang.Exception
Description copied from class:Connector
This method is called to register specific objects in the script context. If the connector has a parser, the parser's registerScriptBeans method is also called.- Specified by:
registerScriptBeans
in interfaceConnectorInterface
- Overrides:
registerScriptBeans
in classConnector
- Parameters:
se
- The script engine context- Throws:
java.lang.Exception
- if an error occurs.
-
replyEntry
public void replyEntry(Entry entry) throws java.lang.Exception
Description copied from class:Connector
Send a reply to the connector.- Specified by:
replyEntry
in interfaceConnectorInterface
- Overrides:
replyEntry
in classConnector
- Parameters:
entry
- the information as an Entry- Throws:
java.lang.Exception
- if an error occurs.
-
selectEntries
public void selectEntries() throws java.lang.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 interfaceConnectorInterface
- Overrides:
selectEntries
in classConnector
- Throws:
java.lang.Exception
- if an error occurs.
-
setConfiguration
public void setConfiguration(java.lang.Object config)
Description copied from class:Connector
Sets the configuration for use by this connector.- Specified by:
setConfiguration
in interfaceConnectorInterface
- Overrides:
setConfiguration
in classConnector
- Parameters:
config
- The configuration object (an instance of ConnectorConfig)
-
setContext
public void setContext(java.lang.Object aContext)
Description copied from class:Connector
Sets the parent task of the connector - anAssemblyLine
object.- Specified by:
setContext
in interfaceConnectorInterface
- Overrides:
setContext
in classConnector
- Parameters:
aContext
- the new context to which the connector will belong.
-
setCurrent
public void setCurrent(Entry entry, SearchCriteria search)
Description copied from class:Connector
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.- Specified by:
setCurrent
in interfaceConnectorInterface
- Overrides:
setCurrent
in classConnector
- Parameters:
entry
- The entry we want to find for modification/deletesearch
- The SearchCriteria we want to change
-
setDebugMode
public void setDebugMode(boolean debug)
Description copied from class:Connector
Modify the debug mode of the component. Also modifies the debug mode of the associated Parser. May be accessed by different threads.
This method is for internal use only. Do not call it from user code.
- Overrides:
setDebugMode
in classConnector
- Parameters:
debug
- the debug mode setting
-
setLog
public void setLog(Log logger)
Description copied from class:Connector
Sets the Log object to use for logging messages- Specified by:
setLog
in interfaceConnectorInterface
- Overrides:
setLog
in classConnector
- Parameters:
logger
- TheLog
object- See Also:
RSInterface.logmsg(String)
-
setMaxDuplicateEntries
public void setMaxDuplicateEntries(int mde)
Description copied from class:Connector
Sets the maximum number of duplicate entries to buffer up. This is used by the lookup functions when a lookup returns more than one entry.- Specified by:
setMaxDuplicateEntries
in interfaceConnectorInterface
- Overrides:
setMaxDuplicateEntries
in classConnector
- Parameters:
mde
- The maximum number of entries to buffer up
-
setModes
public void setModes(java.lang.String[] modes)
Description copied from class:Connector
Sets the connector's modes.
-
setModes
public void setModes(java.util.Vector<java.lang.String> modes)
Description copied from class:Connector
Sets the connector's modes.
-
setName
public void setName(java.lang.String name)
Description copied from class:Connector
Set the name for the connector. This name is used by the logmsg/debug functions.- Specified by:
setName
in interfaceConnectorInterface
- Overrides:
setName
in classConnector
- Parameters:
name
- The name for the connector
-
setParam
public void setParam(java.lang.String param, java.lang.String value)
Description copied from class:Connector
Adds or replaces a connector configuration parameter.- Specified by:
setParam
in interfaceConnectorInterface
- Overrides:
setParam
in classConnector
- Parameters:
param
- The parameter namevalue
- The parameter value
-
setParser
public void setParser(ParserInterface parser) throws java.io.IOException
Description copied from class:Connector
Sets the connector's parser.
-
setProperty
public void setProperty(java.lang.Object p1, java.lang.Object p2)
Description copied from class:Connector
Set connector property. This method sets a named property to a given value. Note that connector properties are very different from the connector configuration.- Overrides:
setProperty
in classConnector
- Parameters:
p1
- The property namep2
- The property value
-
setRSInterface
public void setRSInterface(RSInterface rsi)
Description copied from class:Connector
Sets the RSInterface for this connector to use. The RSInterface object is used to get access system wide parameters such as parser configurations.- Specified by:
setRSInterface
in interfaceConnectorInterface
- Overrides:
setRSInterface
in classConnector
- Parameters:
rsi
- The RSInterface object
-
terminate
public void terminate() throws java.lang.Exception
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 interfaceConnectorInterface
- Overrides:
terminate
in classConnector
- Throws:
java.lang.Exception
- if an error occurs.
-
terminateServer
public void terminateServer() throws java.lang.Exception
Description copied from class:Connector
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.- Specified by:
terminateServer
in interfaceConnectorInterface
- Overrides:
terminateServer
in classConnector
- Throws:
java.lang.Exception
- if an error occurs
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getDelegate
public ConnectorInterface getDelegate()
-
setId
public void setId(java.lang.String id)
- Parameters:
id
- the id to set
-
-