com.ibm.di.connector.WSReceiverServerConnector
Class WSReceiverServerConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.WSReceiverServerConnector.WSReceiverServerConnector
All Implemented Interfaces:
ConnectorInterface, VersionInfoInterface
Direct Known Subclasses:
AxisEasyWSServerConnector

public class WSReceiverServerConnector
extends Connector
implements ConnectorInterface

The Web Service Receiver Server Connector is part of the IBM Tivoli Directory Integrator Web Services suite. This Connector is basically an HTTP Server specialized for servicing SOAP requests over HTTP. It operates in Server mode only.


Field Summary
static String ATTR_HOST
          Host - attribute name.
static String ATTR_REQUESTED_RESOURCE
          Requested resource - attribute name.
static String ATTR_RESPONSE_CONTENT_TYPE
          Response content type - attribute name.
static String ATTR_SOAP_ACTION
          SOAP action - attribute name.
static String ATTR_SOAP_REQUEST
          SOAP request - attribute name.
static String ATTR_SOAP_RESPONSE
          SOAP response - attribute name.
static String ATTR_WSDL_REQUESTED
          WSDL requested - attribute name.
protected  String CHARSET
          Charset constant.
static String CONTENT_TYPE_HTML
          Content type - "text/html"
static String CONTENT_TYPE_XML
          Content type - "text/xml"
protected static String FALSE
          Boolean value represented as String.
protected  String mInputXMLType
          Specifies the type of the SOAP Request message input to the AssemblyLine
protected  boolean mNoNextEntry
          Next entry is not available.
protected  int mPort
          The port number the service is running (listening) on.
protected  boolean mRequireClientAuth
          If checked clients will be required to provide SSL certificates for client authentication
protected  String mReturnXMLType
          Specifies the type of the SOAP Response message output from the AssemblyLine
protected  SAXParserFactory mSAXParserFactory
          SAXParserFactory
protected  WSReceiverServerConnector mServerConnector
          Server Connector
protected  ServerSocket mServerSocket
          Server socket.
protected  Socket mSocket
          Client socket
protected  boolean mTagOpEntry
          Specifies whether the $operation attribute of the op-entry is set to the name of the web service operation.
protected  boolean mUseSSL
          If checked the server will only accept SSL (https) connections
protected static String PARAM_INPUT_TYPE
          Parameter name.Specifies the type of the SOAP Request message input to the AssemblyLine
protected static String PARAM_REQUIRE_CLIENT_AUTH
          Parameter name.Is client authentication required.If checked clients will be required to provide SSL certificates for client authentication
protected static String PARAM_RETURN_XML_TYPE
          Parameter name.Parameter name.Specifies the type of the SOAP Response message output from the AssemblyLine
protected static String PARAM_SYSTEM_TCP_BACKLOG
          System backlog.
protected static String PARAM_TAG_OPENTRY
          Parameter name.Specifies whether the $operation attribute of the op-entry is set to the name of the web service operation.
protected static String PARAM_TCP_BACKLOG
          Parameter name.Backlog.
protected static String PARAM_TCP_PORT
          Parameter name.The port number the service is running (listening) on
protected static String PARAM_USE_SSL
          Parameter name.Enable/Disable SSL.If checked the server will only accept SSL (https) connections
protected static String TRUE
          Boolean value represented as String.
static String WSDL_ID
          WSDL suffix
static String XML_DOM
          Public constant representing XML DOM format.
static String XML_STRING
          Public constant representing XML String format.
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
WSReceiverServerConnector()
          Default constructor
 
Method Summary
protected  String getAuthorization(StringBuffer headers)
          Gets the username and password return by client.
protected  StringBuffer getHeaders()
          Gets the header information send by client.
 ConnectorInterface getNextClient()
          Server mode - return a clone of self that handles the next client instance when running in server mode.
 Entry getNextEntry()
          Returns the next Entry from the connector.
 WSReceiverServerConnector getServerConnector()
           
 String getVersion()
          Version information.
protected  void httpAuthenticationRequest(String realm)
          Send request to client to authenticate.
 void initialize(Object obj)
          Initialize the connector.
 boolean isAccepting()
           
 boolean isTerminating()
           
 String readFile(String aFileName)
          This method is supposed to be used in scripts for reading WSDL files.
protected  String readLine()
          Read line from client.
 void replyEntry(Entry conn)
          Send a reply to the connector.
 void setServerConnector(WSReceiverServerConnector aServerConnector)
          Sets the WSReceiverServerConnector
 void terminate()
          Terminate the connector.
 void terminateServer()
          Interrupts and shuts down the Connector if it runs in Server Mode.
 
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, putEntry, 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, putEntry, queryOperations, queryReply, querySchema, reconnect, registerScriptBeans, selectEntries, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface
 

Field Detail

PARAM_TCP_PORT

protected static final String PARAM_TCP_PORT
Parameter name.The port number the service is running (listening) on

See Also:
Constant Field Values

PARAM_TCP_BACKLOG

protected static final String PARAM_TCP_BACKLOG
Parameter name.Backlog. The maximum queue length for incoming connections. If a connection request arrives when the queue is full, the connection will be refused.

See Also:
Constant Field Values

PARAM_SYSTEM_TCP_BACKLOG

protected static final String PARAM_SYSTEM_TCP_BACKLOG
System backlog.

See Also:
Constant Field Values

PARAM_RETURN_XML_TYPE

protected static final String PARAM_RETURN_XML_TYPE
Parameter name.Parameter name.Specifies the type of the SOAP Response message output from the AssemblyLine

See Also:
Constant Field Values

PARAM_INPUT_TYPE

protected static final String PARAM_INPUT_TYPE
Parameter name.Specifies the type of the SOAP Request message input to the AssemblyLine

See Also:
Constant Field Values

PARAM_USE_SSL

protected static final String PARAM_USE_SSL
Parameter name.Enable/Disable SSL.If checked the server will only accept SSL (https) connections

See Also:
Constant Field Values

PARAM_REQUIRE_CLIENT_AUTH

protected static final String PARAM_REQUIRE_CLIENT_AUTH
Parameter name.Is client authentication required.If checked clients will be required to provide SSL certificates for client authentication

See Also:
Constant Field Values

PARAM_TAG_OPENTRY

protected static final String PARAM_TAG_OPENTRY
Parameter name.Specifies whether the $operation attribute of the op-entry is set to the name of the web service operation.

See Also:
Constant Field Values

mPort

protected int mPort
The port number the service is running (listening) on.


mInputXMLType

protected String mInputXMLType
Specifies the type of the SOAP Request message input to the AssemblyLine


mReturnXMLType

protected String mReturnXMLType
Specifies the type of the SOAP Response message output from the AssemblyLine


mUseSSL

protected boolean mUseSSL
If checked the server will only accept SSL (https) connections


mRequireClientAuth

protected boolean mRequireClientAuth
If checked clients will be required to provide SSL certificates for client authentication


mTagOpEntry

protected boolean mTagOpEntry
Specifies whether the $operation attribute of the op-entry is set to the name of the web service operation.


mSocket

protected Socket mSocket
Client socket

See Also:
Socket

mServerSocket

protected ServerSocket mServerSocket
Server socket.

See Also:
ServerSocket

mServerConnector

protected WSReceiverServerConnector mServerConnector
Server Connector


CHARSET

protected String CHARSET
Charset constant.


ATTR_SOAP_RESPONSE

public static final String ATTR_SOAP_RESPONSE
SOAP response - attribute name.

See Also:
Constant Field Values

ATTR_HOST

public static final String ATTR_HOST
Host - attribute name.

See Also:
Constant Field Values

ATTR_REQUESTED_RESOURCE

public static final String ATTR_REQUESTED_RESOURCE
Requested resource - attribute name.

See Also:
Constant Field Values

ATTR_SOAP_REQUEST

public static final String ATTR_SOAP_REQUEST
SOAP request - attribute name.

See Also:
Constant Field Values

ATTR_SOAP_ACTION

public static final String ATTR_SOAP_ACTION
SOAP action - attribute name.

See Also:
Constant Field Values

ATTR_WSDL_REQUESTED

public static final String ATTR_WSDL_REQUESTED
WSDL requested - attribute name.

See Also:
Constant Field Values

ATTR_RESPONSE_CONTENT_TYPE

public static final String ATTR_RESPONSE_CONTENT_TYPE
Response content type - attribute name.

See Also:
Constant Field Values

XML_STRING

public static final String XML_STRING
Public constant representing XML String format.

See Also:
Constant Field Values

XML_DOM

public static final String XML_DOM
Public constant representing XML DOM format.

See Also:
Constant Field Values

WSDL_ID

public static final String WSDL_ID
WSDL suffix

See Also:
Constant Field Values

CONTENT_TYPE_XML

public static final String CONTENT_TYPE_XML
Content type - "text/xml"

See Also:
Constant Field Values

CONTENT_TYPE_HTML

public static final String CONTENT_TYPE_HTML
Content type - "text/html"

See Also:
Constant Field Values

TRUE

protected static final String TRUE
Boolean value represented as String.

See Also:
Constant Field Values

FALSE

protected static final String FALSE
Boolean value represented as String.

See Also:
Constant Field Values

mNoNextEntry

protected boolean mNoNextEntry
Next entry is not available. Default false


mSAXParserFactory

protected SAXParserFactory mSAXParserFactory
SAXParserFactory

Constructor Detail

WSReceiverServerConnector

public WSReceiverServerConnector()
Default constructor

Method Detail

initialize

public void initialize(Object obj)
                throws Exception
Initialize the connector. The connector may be passed a parameter of any kind by the user. Assigns parameters specified by the user to the connector

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
obj - User provided parameter
Throws:
Exception - if the initialization of this connector fails.

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 the server socket is not specified.

getServerConnector

public WSReceiverServerConnector getServerConnector()
Returns:
WSReceiverServerConnector

setServerConnector

public void setServerConnector(WSReceiverServerConnector aServerConnector)
Sets the WSReceiverServerConnector

Parameters:
aServerConnector - WSReceiverServerConnector

terminateServer

public void terminateServer()
                     throws Exception
Interrupts and shuts down the Connector if it runs in Server Mode. Does not have effect if the Connector is not running in Server Mode.

Specified by:
terminateServer in interface ConnectorInterface
Overrides:
terminateServer in class Connector
Throws:
Exception - if an error occurs

terminate

public void terminate()
               throws Exception
Terminate the connector. This function closes all connection and releases all resources used by the connector.

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

getNextEntry

public Entry getNextEntry()
                   throws Exception
Returns the next Entry from the connector. The entry is populated with attributes and values from the next entry in the input set.

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
the next Entry, or null if no more data
Throws:
Exception - if an error occurs
See Also:
ConnectorInterface.selectEntries()

replyEntry

public void replyEntry(Entry conn)
                throws Exception
Send a reply to the connector.

Specified by:
replyEntry in interface ConnectorInterface
Overrides:
replyEntry in class Connector
Parameters:
conn - Entry
Throws:
Exception - if an error occurs

isAccepting

public boolean isAccepting()
Returns:
true if the server is accepting connection, false otherwise.

isTerminating

public boolean isTerminating()
Returns:
true if a termination request is sent , false otherwise.

getVersion

public String getVersion()
Description copied from interface: VersionInfoInterface
Version information.

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

readFile

public String readFile(String aFileName)
                throws IOException
This method is supposed to be used in scripts for reading WSDL files. This method is not used by this Connector. It is a convenience method only.

Parameters:
aFileName - String
Returns:
String
Throws:
IOException - if an I/O error occurs

getAuthorization

protected String getAuthorization(StringBuffer headers)
                           throws IOException
Gets the username and password return by client.

Parameters:
headers - HTTP headers sent by client.
Returns:
Pair - username and password, separated by colon.
Throws:
IOException

getHeaders

protected StringBuffer getHeaders()
                           throws IOException
Gets the header information send by client.

Returns:
Header information.
Throws:
IOException

readLine

protected String readLine()
                   throws IOException
Read line from client. This method is used when HTTP Basic Authentication is enabled.

Returns:
Returns the line read.
Throws:
IOException

httpAuthenticationRequest

protected void httpAuthenticationRequest(String realm)
                                  throws IOException
Send request to client to authenticate.

Parameters:
realm - String
Throws:
IOException - if an I/O error occurs