com.ibm.di.connector
Class HTTPClientConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.HTTPClientConnector
All Implemented Interfaces:
ConnectorInterface, VersionInfoInterface

public class HTTPClientConnector
extends Connector
implements ConnectorInterface

HTTPCLientConnector provides a client side HTTP connection where the user can use it in Iterator, Lookup and AddOnly mode. A parser may be specified in which case the contents sent/received on the HTTP connection is parsed. If no parser is specified then all data is conveyed through the entry object. All HTTP headers from the server is entered as is prefixing their names with "http.". The "body" attribute contains the result from the server and also provides the data to be submitted to the server if no parser is specified.


Field Summary
static String PARAM_TIMEOUT
          Parameter Name: "timeout"
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
HTTPClientConnector()
          Constructor
 
Method Summary
 Entry findEntry(SearchCriteria search)
          The findEntry function is called during Lookup or Update operations.
 Entry getNextEntry()
          This function is called to retreive the next entry from the connector.
 String getVersion()
          Version information.
 void initialize(Object o)
          This function is called once after the connector configuration file has been provided by the caller.
 void putEntry(Entry entry)
          The putEntry function is called during AddOnly or Update operations.
 Entry queryReply(Entry entry)
          Performs a query/reply operations.
 void selectEntries()
          This function is called when the connector operates in Iterator mode inside an assembly line.
 void terminate()
          This function is called when the connector is no longer needed by the user (AssemblyLine or script).
 
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, deleteEntry, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextClient, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, getUI, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logError, logmsg, modEntry, modEntry, pushback, queryOperations, querySchema, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setDebugMode, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface, terminateServer
 
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.connector.ConnectorInterface
deleteEntry, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, modEntry, pushback, queryOperations, querySchema, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
 

Field Detail

PARAM_TIMEOUT

public static final String PARAM_TIMEOUT
Parameter Name: "timeout"

See Also:
Constant Field Values
Constructor Detail

HTTPClientConnector

public HTTPClientConnector()
Constructor

Method Detail

terminate

public void terminate()
               throws Exception
This function is called when the connector is no longer needed by the user (AssemblyLine or script). Always call superclass' terminate which will take care of releasing resources, closing parsers etc.

Specified by:
terminate in interface ConnectorInterface
Overrides:
terminate in class Connector
Throws:
Exception - if an error occurs.

initialize

public void initialize(Object o)
                throws Exception
This function is called once after the connector configuration file has been provided by the caller. Always call super class to load parser etc...

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
o - User provided parameter
Throws:
Exception - if the initialization of this connector fails.

selectEntries

public void selectEntries()
                   throws Exception
This function is called when the connector operates in Iterator mode inside an assembly line.

Specified by:
selectEntries in interface ConnectorInterface
Overrides:
selectEntries in class Connector
Throws:
Exception - if an error occurs.

getNextEntry

public Entry getNextEntry()
                   throws Exception
This function is called to retreive the next entry from the connector. When there are no more entries to retrieve the function should return a null value indicating a logical end of file. If the connector has no parser this will never happen since we always make a HTTP connection every time getNextEntry is called.

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
- the next Entry, or null if no more data
Throws:
Exception - if an error occurs.
See Also:
ConnectorInterface.selectEntries()

putEntry

public void putEntry(Entry entry)
              throws Exception
The putEntry function is called during AddOnly or Update operations.

Specified by:
putEntry in interface ConnectorInterface
Overrides:
putEntry in class Connector
Parameters:
entry - The entry data to add
Throws:
Exception - if an error occurs.

queryReply

public Entry queryReply(Entry entry)
                 throws Exception
Performs a query/reply operations.

Specified by:
queryReply in interface ConnectorInterface
Overrides:
queryReply in class Connector
Parameters:
entry - The data used in outgoing call
Returns:
The entry returned by the HTTP server
Throws:
Exception - if an error occurs.

findEntry

public Entry findEntry(SearchCriteria search)
                throws Exception
The findEntry function is called during Lookup or Update operations. Since this connector implements both findEntry and putEntry it is technically possible to use this connector in Update mode. However, the connector does not support the modEntry function so this will eventually fail.

Specified by:
findEntry in interface ConnectorInterface
Overrides:
findEntry in class Connector
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:
Exception - if an error occurs.

getVersion

public String getVersion()
Version information.

Specified by:
getVersion in interface VersionInfoInterface
Returns:
version information