com.ibm.di.connector
Class OldHTTPCLient

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

public class OldHTTPCLient
extends Connector
implements ConnectorInterface, CheckpointRestartInterface


Field Summary
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Fields inherited from interface com.ibm.di.server.CheckpointRestartInterface
RESTART_AFTER, RESTART_BEFORE, RESTART_IN
 
Constructor Summary
OldHTTPCLient()
          Constructor
 
Method Summary
 Entry findEntry(SearchCriteria search)
          The findEntry function is called during Lookup or Update operations.
 Entry getCheckpointInformation()
          Returns the state information for the connector.
 Entry getNextEntry()
          This function is called to retreive the next entry from the connector.
 String getVersion()
          Return version information
 void initialize(Object o)
          This function is called once after the connector configuration file has been provided by the caller.
 boolean isCheckpointRestartEnabled(int mode)
          Components that support checkpoint/restart for a specific mode must return TRUE from this method.
 void prepareForRestart(ALState state, Entry restartInfo, int restartPoint)
          Notifies the connector of a restart situation.
 void putEntry(Entry entry)
          The putEntry function is called during AddOnly or Update operations.
 void selectEntries()
          This function is called when the connector operates in Iterator mode inside an assembly line.
 void terminate()
          Terminate the connector and release resources.
 
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, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logmsg, modEntry, modEntry, pushback, queryOperations, queryReply, querySchema, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, 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, queryReply, querySchema, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
 

Constructor Detail

OldHTTPCLient

public OldHTTPCLient()
Constructor

Method Detail

terminate

public void terminate()
               throws Exception
Terminate the connector and release resources. This function is called when the connector is no longer needed by the user (e.g. assembly line 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

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

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

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
See Also:
Connector.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 - Any exceptions thrown by the connector's underlying classes

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 - Any exceptions thrown by the connector's underlying classes

isCheckpointRestartEnabled

public boolean isCheckpointRestartEnabled(int mode)
Components that support checkpoint/restart for a specific mode must return TRUE from this method. If a restart has no meaning for mode then the connector should still return TRUE.

Specified by:
isCheckpointRestartEnabled in interface CheckpointRestartInterface
Parameters:
mode - The mode the connector runs in
Returns:
true if checkpoint is supported in mode
See Also:
ServerConstants

getCheckpointInformation

public Entry getCheckpointInformation()
                               throws Exception
Returns the state information for the connector. If for some reason the connector decidies that a restart is impossible it must throw an exception. The method is called immediatly before any component methods are called. If there is no need to save any state information a null value should be returned. For eventhandlers this method is called by the dispatcher routine.

Specified by:
getCheckpointInformation in interface CheckpointRestartInterface
Returns:
The entry the connector needs to do a restart or null if that is not needed.
Throws:
Exception

prepareForRestart

public void prepareForRestart(ALState state,
                              Entry restartInfo,
                              int restartPoint)
                       throws Exception
Notifies the connector of a restart situation. This method is called after the connector has been loaded and before any other method calls are made to the connector. If the connector decides it cannot restart it must throw an exception.

Specified by:
prepareForRestart in interface CheckpointRestartInterface
Parameters:
restartInfo - The last entry object returned by the connector in the getCheckpointInformation method
state - The ALState object for the AssemblyLine
restartPoint - The relative point where restarting is taking place (e.g. RESTART_BEFORE ...)
Throws:
Exception
Since:

getVersion

public String getVersion()
Return version information

Specified by:
getVersion in interface VersionInfoInterface