Class 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 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
    • Constructor Detail

      • DSMLv2SOAPServerConnector

        public DSMLv2SOAPServerConnector()
        Default constructor. Instantiates the internally used DSMLv2 Parser and HTTP Parser.
    • 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 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:
        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 interface ConnectorInterface
        Overrides:
        terminate in class Connector
        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 interface ConnectorInterface
        Overrides:
        terminateServer in class Connector
        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 interface ConnectorInterface
        Overrides:
        getNextClient in class Connector
        Returns:
        the clone of itself
        Throws:
        java.lang.Exception - if an error occurs.
      • 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 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:
        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 interface ConnectorInterface
        Overrides:
        replyEntry in class Connector
        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 interface VersionInfoInterface
        Returns:
        the version information.