Package com.ibm.di.connector
Class HTTPClientConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- 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
Fields Modifier and Type Field Description static java.lang.String
AUTHENTICATE
static java.lang.String
AUTHORIZATION
static java.lang.String[]
CONNECTOR_MODES
Supported modesstatic 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
Constructors Constructor Description HTTPClientConnector()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Entry
findEntry(SearchCriteria search)
The findEntry function is called during Lookup operations.java.lang.String
getClientCertificateAlias()
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
setClientCertificateAlias(java.lang.String clientCertificateAlias)
Sets the Client Certificate that should be used when connection.void
setClientCertificateAlias(java.lang.String clientCertificateAlias, java.lang.String keyStorePath, java.lang.String keyStorePass, java.lang.String keyStoreType)
Sets the Client Certificate that should be used when connection.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
-
-
-
-
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
-
AUTHORIZATION
public static final java.lang.String AUTHORIZATION
- See Also:
- Constant Field Values
-
AUTHENTICATE
public static final java.lang.String AUTHENTICATE
- See Also:
- Constant Field Values
-
-
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 interfaceConnectorInterface
- Overrides:
terminate
in classConnector
- 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 interfaceConnectorInterface
- Overrides:
initialize
in classConnector
- 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 interfaceConnectorInterface
- Overrides:
selectEntries
in classConnector
- 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 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()
-
putEntry
public void putEntry(Entry entry) throws java.lang.Exception
The putEntry function is called during AddOnly or Update operations.- Specified by:
putEntry
in interfaceConnectorInterface
- Overrides:
putEntry
in classConnector
- 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 interfaceConnectorInterface
- Overrides:
queryReply
in classConnector
- 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 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.
-
getVersion
public java.lang.String getVersion()
Version information.- Returns:
- version information
-
getClientCertificateAlias
public java.lang.String getClientCertificateAlias()
-
setClientCertificateAlias
public void setClientCertificateAlias(java.lang.String clientCertificateAlias)
Sets the Client Certificate that should be used when connection. Equivalent to setClientCertificateAlias(clientCertificateAlias, null, null, null)- Parameters:
clientCertificateAlias
- - Name of the alias in the default keystore.
-
setClientCertificateAlias
public void setClientCertificateAlias(java.lang.String clientCertificateAlias, java.lang.String keyStorePath, java.lang.String keyStorePass, java.lang.String keyStoreType)
Sets the Client Certificate that should be used when connection. If the alias is null, resets behavior to default Java behavior. If the alias is an empty string, do not send any certificate at all.- Parameters:
clientCertificateAlias
- - Name of the alias in the key store.keyStorePath
- - Path to key store. null means to use the javax.net.ssl.keyStore.keyStorePass
- - Password for key store. null means javax.net.ssl.keyStorePassword.keyStoreType
- - The key store type. null means javax.net.ssl.keyStoreType or default.
-
-