Package com.ibm.di.connector
Class DSMLv2SOAPServerConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- com.ibm.di.connector.DSMLv2SOAPServerConnector
-
- All Implemented Interfaces:
ConnectorInterface
,VersionInfoInterface
public class DSMLv2SOAPServerConnector extends Connector implements ConnectorInterface
The DSMLv2 SOAP Server Connector implements the DSMLv2 standard (http://www.oasis-open.org/committees/dsml/docs/DSMLv2.doc). It listens for DSMLv2 requests over HTTP. Once it receives the request, it parses the request and sends the parsed request to the AssemblyLine workflow to process it. The result is sent back to the client over HTTP. SOAP DSML binding is supported by the Connector.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTR_NAME_HTTP_BODY
An attribute name: "http.body"static java.lang.String
ATTR_NAME_HTTP_CHARACTER_SET
An attribute name: "characterSet"static java.lang.String
ATTR_NAME_HTTP_CONTENT_TYPE
An attribute name: "http.Content-Type"static java.lang.String
ATTR_NAME_HTTP_REMOTE_PASSWORD
An attribute name: "http.remote_pass"static java.lang.String
ATTR_NAME_HTTP_REMOTE_USER
An attribute name: "http.remote_user"static java.lang.String
HTTP_BAD_REQUEST
HTTP Error String: "400 Bad Request"static java.lang.String
HTTP_INTERNAL_SERVER_ERROR
HTTP Error String: "500 Internal Server Error"static java.lang.String
HTTP_PARAM_PARAMETER_USE_CHUNKS
A parameter name: "msgChunked"static java.lang.String
PARAM_REQUIRE_CLIENT_AUTH
A parameter name: "needClientAuth"static java.lang.String
PARAM_SYSTEM_TCP_BACKLOG
A parameter name: "com.ibm.di.tcp.backlog"static java.lang.String
PARAM_TCP_BACKLOG
A parameter name: "backlog"static java.lang.String
PARAMETER_AUTH_REALM
A parameter name: "authRealm"static java.lang.String
PARAMETER_BINARY_ATTRIBUTES
A parameter name: "binaryAttributes"static java.lang.String
PARAMETER_DSML_PORT
A parameter name: "dsmlPort"static java.lang.String
PARAMETER_HTTP_BASIC_AUTH
A parameter name: "httpAuth"static java.lang.String
PARAMETER_SOAPBINDING
A parameter name: "soapbinding"static java.lang.String
PARAMETER_USE_SSL
A parameter name: "useSSL"-
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
-
-
Constructor Summary
Constructors Constructor Description DSMLv2SOAPServerConnector()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectorInterface
getNextClient()
Server mode - return a clone of self that handles the next client instance when running in server mode.Entry
getNextEntry()
Gets the next DSML request, sent by the client.java.lang.String
getPassword()
Retrieves password.DSMLv2SOAPServerConnector
getServerConnector()
Retrieves the server connector.java.lang.String
getUserName()
Retrieves username.java.lang.String
getVersion()
Version information.void
initialize(java.lang.Object aObject)
Initializes the connector.boolean
isAccepting()
Checks whether connector is waiting for a client connectionboolean
isTerminating()
void
putEntry(Entry aEntry)
Sets an entry object in the set of results that will be send back to the client when thereplyEntry(Entry)
method is called.void
rejectClientAuthentication()
Reject the client authentication, send the Forbidden page and terminate the connection.void
replyEntry(Entry aResponseEntry)
If the connector is not configured for communicating with clients using chunks then this method writes the entries stored in the local result set as a whole DSML search response message back to the client.void
setServerConnector(DSMLv2SOAPServerConnector aServerConnector)
Sets the server connector for this connector.void
terminate()
Terminate the connector.void
terminateServer()
This method tries to terminate the server by setting the termination flag for the connector returned by getServerConnector and immediately connecting to its port (which should fail).-
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, deleteEntry, extractExceptionInformation, findEntry, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, getUI, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logError, logmsg, modEntry, modEntry, pushback, queryOperations, queryReply, querySchema, queryTables, reconnect, reconnect, registerScriptBeans, selectEntries, setConfiguration, setContext, setCurrent, setDebugMode, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface
-
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, findEntry, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, modEntry, pushback, queryOperations, queryReply, querySchema, reconnect, registerScriptBeans, selectEntries, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface
-
-
-
-
Field Detail
-
PARAMETER_DSML_PORT
public static final java.lang.String PARAMETER_DSML_PORT
A parameter name: "dsmlPort"- See Also:
- Constant Field Values
-
PARAM_TCP_BACKLOG
public static final java.lang.String PARAM_TCP_BACKLOG
A parameter name: "backlog"- See Also:
- Constant Field Values
-
PARAM_SYSTEM_TCP_BACKLOG
public static final java.lang.String PARAM_SYSTEM_TCP_BACKLOG
A parameter name: "com.ibm.di.tcp.backlog"- See Also:
- Constant Field Values
-
PARAMETER_USE_SSL
public static final java.lang.String PARAMETER_USE_SSL
A parameter name: "useSSL"- See Also:
- Constant Field Values
-
PARAM_REQUIRE_CLIENT_AUTH
public static final java.lang.String PARAM_REQUIRE_CLIENT_AUTH
A parameter name: "needClientAuth"- See Also:
- Constant Field Values
-
PARAMETER_BINARY_ATTRIBUTES
public static final java.lang.String PARAMETER_BINARY_ATTRIBUTES
A parameter name: "binaryAttributes"- See Also:
- Constant Field Values
-
PARAMETER_SOAPBINDING
public static final java.lang.String PARAMETER_SOAPBINDING
A parameter name: "soapbinding"- See Also:
- Constant Field Values
-
PARAMETER_HTTP_BASIC_AUTH
public static final java.lang.String PARAMETER_HTTP_BASIC_AUTH
A parameter name: "httpAuth"- See Also:
- Constant Field Values
-
PARAMETER_AUTH_REALM
public static final java.lang.String PARAMETER_AUTH_REALM
A parameter name: "authRealm"- See Also:
- Constant Field Values
-
HTTP_PARAM_PARAMETER_USE_CHUNKS
public static final java.lang.String HTTP_PARAM_PARAMETER_USE_CHUNKS
A parameter name: "msgChunked"- See Also:
- Constant Field Values
-
HTTP_BAD_REQUEST
public static final java.lang.String HTTP_BAD_REQUEST
HTTP Error String: "400 Bad Request"- See Also:
- Constant Field Values
-
HTTP_INTERNAL_SERVER_ERROR
public static final java.lang.String HTTP_INTERNAL_SERVER_ERROR
HTTP Error String: "500 Internal Server Error"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_REMOTE_USER
public static final java.lang.String ATTR_NAME_HTTP_REMOTE_USER
An attribute name: "http.remote_user"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_REMOTE_PASSWORD
public static final java.lang.String ATTR_NAME_HTTP_REMOTE_PASSWORD
An attribute name: "http.remote_pass"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_BODY
public static final java.lang.String ATTR_NAME_HTTP_BODY
An attribute name: "http.body"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_CONTENT_TYPE
public static final java.lang.String ATTR_NAME_HTTP_CONTENT_TYPE
An attribute name: "http.Content-Type"- See Also:
- Constant Field Values
-
ATTR_NAME_HTTP_CHARACTER_SET
public static final java.lang.String ATTR_NAME_HTTP_CHARACTER_SET
An attribute name: "characterSet"- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(java.lang.Object aObject) throws java.lang.Exception
Initializes the connector. Parses all the configuration parameters.- Specified by:
initialize
in interfaceConnectorInterface
- Overrides:
initialize
in classConnector
- Parameters:
aObject
- if this is an instance ofSocket
then that object is used as a connection with the client.- Throws:
java.lang.Exception
- if the url parameter is missing or the protocol used is neither "http" nor "https".
-
getServerConnector
public DSMLv2SOAPServerConnector getServerConnector()
Retrieves the server connector.- Returns:
- the server connector if this connector is handling an DSML client session.
-
setServerConnector
public void setServerConnector(DSMLv2SOAPServerConnector aServerConnector)
Sets the server connector for this connector.- Parameters:
aServerConnector
- the server connector.
-
isAccepting
public boolean isAccepting()
Checks whether connector is waiting for a client connection- Returns:
- true if this connector is currently waiting for a client connection.
-
isTerminating
public boolean isTerminating()
- Returns:
- true if this connector has the termination flag set.
-
terminate
public void terminate() throws java.lang.Exception
Terminate the connector.- Specified by:
terminate
in interfaceConnectorInterface
- Overrides:
terminate
in classConnector
- Throws:
java.lang.Exception
- if a termination error occurs.
-
terminateServer
public void terminateServer() throws java.lang.Exception
This method tries to terminate the server by setting the termination flag for the connector returned by getServerConnector and immediately connecting to its port (which should fail).- Specified by:
terminateServer
in interfaceConnectorInterface
- Overrides:
terminateServer
in classConnector
- Throws:
java.lang.Exception
- if an error occurs.
-
getNextClient
public ConnectorInterface getNextClient() throws java.lang.Exception
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
Gets the next DSML request, sent by the client.- Specified by:
getNextEntry
in interfaceConnectorInterface
- Overrides:
getNextEntry
in classConnector
- Returns:
- the client request as an Entry object.
- Throws:
java.lang.Exception
- if communication/parsing error occurs.- See Also:
ConnectorInterface.selectEntries()
-
putEntry
public void putEntry(Entry aEntry) throws java.lang.Exception
Sets an entry object in the set of results that will be send back to the client when thereplyEntry(Entry)
method is called. If the connector is configured to transport the data as chunks then the entry will be serialized as a DSML message and will be send right to the client.- Specified by:
putEntry
in interfaceConnectorInterface
- Overrides:
putEntry
in classConnector
- Parameters:
aEntry
- The entry object that will be sent as a part of the result to the client.- Throws:
java.lang.Exception
- if an error occurs.
-
replyEntry
public void replyEntry(Entry aResponseEntry) throws java.lang.Exception
If the connector is not configured for communicating with clients using chunks then this method writes the entries stored in the local result set as a whole DSML search response message back to the client. If chunking is used or the response is not a result of a search request then the provide entry is serialized and send right to the client.- Specified by:
replyEntry
in interfaceConnectorInterface
- Overrides:
replyEntry
in classConnector
- Parameters:
aResponseEntry
- the entry that will be sent back to the client.- Throws:
java.lang.Exception
- if an error occurs.
-
getUserName
public java.lang.String getUserName()
Retrieves username.- Returns:
- the authenticated username.
-
getPassword
public java.lang.String getPassword()
Retrieves password.- Returns:
- the password the user was authenticated with.
-
rejectClientAuthentication
public void rejectClientAuthentication() throws java.lang.Exception
Reject the client authentication, send the Forbidden page and terminate the connection.- Throws:
java.lang.Exception
- if an error occurs.
-
getVersion
public java.lang.String getVersion()
Version information.- Specified by:
getVersion
in interfaceVersionInfoInterface
- Returns:
- the version information.
-
-