com.ibm.di.connector
Class DSMLv2SOAPServerConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by 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
static String ATTR_NAME_HTTP_BODY
          An attribute name: "http.body"
static String ATTR_NAME_HTTP_CHARACTER_SET
          An attribute name: "characterSet"
static String ATTR_NAME_HTTP_CONTENT_TYPE
          An attribute name: "http.Content-Type"
static String ATTR_NAME_HTTP_REMOTE_PASSWORD
          An attribute name: "http.remote_pass"
static String ATTR_NAME_HTTP_REMOTE_USER
          An attribute name: "http.remote_user"
static String HTTP_BAD_REQUEST
          HTTP Error String: "400 Bad Request"
static String HTTP_INTERNAL_SERVER_ERROR
          HTTP Error String: "500 Internal Server Error"
static String HTTP_PARAM_PARAMETER_USE_CHUNKS
          A parameter name: "msgChunked"
static String PARAM_REQUIRE_CLIENT_AUTH
          A parameter name: "needClientAuth"
static String PARAM_SYSTEM_TCP_BACKLOG
          A parameter name: "com.ibm.di.tcp.backlog"
static String PARAM_TCP_BACKLOG
          A parameter name: "backlog"
static String PARAMETER_AUTH_REALM
          A parameter name: "authRealm"
static String PARAMETER_BINARY_ATTRIBUTES
          A parameter name: "binaryAttributes"
static String PARAMETER_DSML_PORT
          A parameter name: "dsmlPort"
static String PARAMETER_HTTP_BASIC_AUTH
          A parameter name: "httpAuth"
static String PARAMETER_SOAPBINDING
          A parameter name: "soapbinding"
static 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
DSMLv2SOAPServerConnector()
          Default constructor.
 
Method Summary
 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.
 String getPassword()
          Retrieves password.
 DSMLv2SOAPServerConnector getServerConnector()
          Retrieves the server connector.
 String getUserName()
          Retrieves username.
 String getVersion()
          Version information.
 void initialize(Object aObject)
          Initializes the connector.
 boolean isAccepting()
          Checks whether connector is waiting for a client connection
 boolean isTerminating()
           
 void putEntry(Entry aEntry)
          Sets an entry object in the set of results that will be send back to the client when the replyEntry(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, 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 String PARAMETER_DSML_PORT
A parameter name: "dsmlPort"

See Also:
Constant Field Values

PARAM_TCP_BACKLOG

public static final String PARAM_TCP_BACKLOG
A parameter name: "backlog"

See Also:
Constant Field Values

PARAM_SYSTEM_TCP_BACKLOG

public static final String PARAM_SYSTEM_TCP_BACKLOG
A parameter name: "com.ibm.di.tcp.backlog"

See Also:
Constant Field Values

PARAMETER_USE_SSL

public static final String PARAMETER_USE_SSL
A parameter name: "useSSL"

See Also:
Constant Field Values

PARAM_REQUIRE_CLIENT_AUTH

public static final String PARAM_REQUIRE_CLIENT_AUTH
A parameter name: "needClientAuth"

See Also:
Constant Field Values

PARAMETER_BINARY_ATTRIBUTES

public static final String PARAMETER_BINARY_ATTRIBUTES
A parameter name: "binaryAttributes"

See Also:
Constant Field Values

PARAMETER_SOAPBINDING

public static final String PARAMETER_SOAPBINDING
A parameter name: "soapbinding"

See Also:
Constant Field Values

PARAMETER_HTTP_BASIC_AUTH

public static final String PARAMETER_HTTP_BASIC_AUTH
A parameter name: "httpAuth"

See Also:
Constant Field Values

PARAMETER_AUTH_REALM

public static final String PARAMETER_AUTH_REALM
A parameter name: "authRealm"

See Also:
Constant Field Values

HTTP_PARAM_PARAMETER_USE_CHUNKS

public static final String HTTP_PARAM_PARAMETER_USE_CHUNKS
A parameter name: "msgChunked"

See Also:
Constant Field Values

HTTP_BAD_REQUEST

public static final String HTTP_BAD_REQUEST
HTTP Error String: "400 Bad Request"

See Also:
Constant Field Values

HTTP_INTERNAL_SERVER_ERROR

public static final 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 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 String ATTR_NAME_HTTP_REMOTE_PASSWORD
An attribute name: "http.remote_pass"

See Also:
Constant Field Values

ATTR_NAME_HTTP_BODY

public static final String ATTR_NAME_HTTP_BODY
An attribute name: "http.body"

See Also:
Constant Field Values

ATTR_NAME_HTTP_CONTENT_TYPE

public static final 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 String ATTR_NAME_HTTP_CHARACTER_SET
An attribute name: "characterSet"

See Also:
Constant Field Values
Constructor Detail

DSMLv2SOAPServerConnector

public DSMLv2SOAPServerConnector()
Default constructor. Instantiates the internally used DSMLv2 Parser and HTTP Parser.

Method Detail

initialize

public void initialize(Object aObject)
                throws Exception
Initializes the connector. Parses all the configuration parameters.

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
aObject - if this is an instance of Socket then that object is used as a connection with the client.
Throws:
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 Exception
Terminate the connector.

Specified by:
terminate in interface ConnectorInterface
Overrides:
terminate in class Connector
Throws:
Exception - if a termination error occurs.

terminateServer

public void terminateServer()
                     throws 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 interface ConnectorInterface
Overrides:
terminateServer in class Connector
Throws:
Exception - if an error occurs.

getNextClient

public ConnectorInterface getNextClient()
                                 throws 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 interface ConnectorInterface
Overrides:
getNextClient in class Connector
Returns:
the clone of itself
Throws:
Exception - if an error occurs.

getNextEntry

public Entry getNextEntry()
                   throws Exception
Gets the next DSML request, sent by the client.

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
the client request as an Entry object.
Throws:
Exception - if communication/parsing error occurs.
See Also:
ConnectorInterface.selectEntries()

putEntry

public void putEntry(Entry aEntry)
              throws Exception
Sets an entry object in the set of results that will be send back to the client when the replyEntry(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 interface ConnectorInterface
Overrides:
putEntry in class Connector
Parameters:
aEntry - The entry object that will be sent as a part of the result to the client.
Throws:
Exception - if an error occurs.

replyEntry

public void replyEntry(Entry aResponseEntry)
                throws 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 interface ConnectorInterface
Overrides:
replyEntry in class Connector
Parameters:
aResponseEntry - the entry that will be sent back to the client.
Throws:
Exception - if an error occurs.

getUserName

public String getUserName()
Retrieves username.

Returns:
the authenticated username.

getPassword

public String getPassword()
Retrieves password.

Returns:
the password the user was authenticated with.

rejectClientAuthentication

public void rejectClientAuthentication()
                                throws Exception
Reject the client authentication, send the Forbidden page and terminate the connection.

Throws:
Exception - if an error occurs.

getVersion

public String getVersion()
Version information.

Specified by:
getVersion in interface VersionInfoInterface
Returns:
the version information.