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

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 java.lang.String[] CONNECTOR_MODES
          Supported modes
static java.lang.String PARAM_TIMEOUT
          Parameter Name: "timeout"
static java.lang.String VERSION_INFO
          Version info
 
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 operations.
 Entry getNextEntry()
          This function is called to retrieve the next Entry from the connector.
 java.lang.String getVersion()
          Version information.
 void initialize(java.lang.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 AssemblyLine.
 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, extractExceptionInformation, 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
 

Field Detail

CONNECTOR_MODES

public static final java.lang.String[] CONNECTOR_MODES
Supported modes


VERSION_INFO

public static final java.lang.String VERSION_INFO
Version info

See Also:
Constant Field Values

PARAM_TIMEOUT

public static final java.lang.String PARAM_TIMEOUT
Parameter Name: "timeout"

See Also:
Constant Field Values
Constructor Detail

HTTPClientConnector

public HTTPClientConnector()
Constructor

Method Detail

terminate

public void terminate()
               throws java.lang.Exception
This function is called when the connector is no longer needed by the user (AssemblyLine or script).

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

initialize

public void initialize(java.lang.Object o)
                throws java.lang.Exception
This function is called once after the connector configuration file has been provided by the caller.

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

selectEntries

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

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

getNextEntry

public Entry getNextEntry()
                   throws java.lang.Exception
This function is called to retrieve 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:
java.lang.Exception - if an error occurs.
See Also:
ConnectorInterface.selectEntries()

putEntry

public void putEntry(Entry entry)
              throws java.lang.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:
java.lang.Exception - if an error occurs.

queryReply

public Entry queryReply(Entry entry)
                 throws java.lang.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:
java.lang.Exception - if an error occurs.

findEntry

public Entry findEntry(SearchCriteria search)
                throws java.lang.Exception
The findEntry function is called during Lookup operations.

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:
java.lang.Exception - if an error occurs.

getVersion

public java.lang.String getVersion()
Version information.

Returns:
version information