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.StringATTR_NAME_HTTP_BODYAn attribute name: "http.body"static java.lang.StringATTR_NAME_HTTP_CHARACTER_SETAn attribute name: "characterSet"static java.lang.StringATTR_NAME_HTTP_CONTENT_TYPEAn attribute name: "http.Content-Type"static java.lang.StringATTR_NAME_HTTP_REMOTE_PASSWORDAn attribute name: "http.remote_pass"static java.lang.StringATTR_NAME_HTTP_REMOTE_USERAn attribute name: "http.remote_user"static java.lang.StringHTTP_BAD_REQUESTHTTP Error String: "400 Bad Request"static java.lang.StringHTTP_INTERNAL_SERVER_ERRORHTTP Error String: "500 Internal Server Error"static java.lang.StringHTTP_PARAM_PARAMETER_USE_CHUNKSA parameter name: "msgChunked"static java.lang.StringPARAM_REQUIRE_CLIENT_AUTHA parameter name: "needClientAuth"static java.lang.StringPARAM_SYSTEM_TCP_BACKLOGA parameter name: "com.ibm.di.tcp.backlog"static java.lang.StringPARAM_TCP_BACKLOGA parameter name: "backlog"static java.lang.StringPARAMETER_AUTH_REALMA parameter name: "authRealm"static java.lang.StringPARAMETER_BINARY_ATTRIBUTESA parameter name: "binaryAttributes"static java.lang.StringPARAMETER_DSML_PORTA parameter name: "dsmlPort"static java.lang.StringPARAMETER_HTTP_BASIC_AUTHA parameter name: "httpAuth"static java.lang.StringPARAMETER_SOAPBINDINGA parameter name: "soapbinding"static java.lang.StringPARAMETER_USE_SSLA 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 ConnectorInterfacegetNextClient()Server mode - return a clone of self that handles the next client instance when running in server mode.EntrygetNextEntry()Gets the next DSML request, sent by the client.java.lang.StringgetPassword()Retrieves password.DSMLv2SOAPServerConnectorgetServerConnector()Retrieves the server connector.java.lang.StringgetUserName()Retrieves username.java.lang.StringgetVersion()Version information.voidinitialize(java.lang.Object aObject)Initializes the connector.booleanisAccepting()Checks whether connector is waiting for a client connectionbooleanisTerminating()voidputEntry(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.voidrejectClientAuthentication()Reject the client authentication, send the Forbidden page and terminate the connection.voidreplyEntry(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.voidsetServerConnector(DSMLv2SOAPServerConnector aServerConnector)Sets the server connector for this connector.voidterminate()Terminate the connector.voidterminateServer()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.ExceptionInitializes the connector. Parses all the configuration parameters.- Specified by:
initializein interfaceConnectorInterface- Overrides:
initializein classConnector- Parameters:
aObject- if this is an instance ofSocketthen 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.ExceptionTerminate the connector.- Specified by:
terminatein interfaceConnectorInterface- Overrides:
terminatein classConnector- Throws:
java.lang.Exception- if a termination error occurs.
-
terminateServer
public void terminateServer() throws java.lang.ExceptionThis 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:
terminateServerin interfaceConnectorInterface- Overrides:
terminateServerin 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:
getNextClientin interfaceConnectorInterface- Overrides:
getNextClientin 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:
getNextEntryin interfaceConnectorInterface- Overrides:
getNextEntryin 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:
putEntryin interfaceConnectorInterface- Overrides:
putEntryin 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:
replyEntryin interfaceConnectorInterface- Overrides:
replyEntryin 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.ExceptionReject 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:
getVersionin interfaceVersionInfoInterface- Returns:
- the version information.
-
-