Class WSReceiverServerConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- 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
Fields Modifier and Type Field Description static java.lang.String
ATTR_HOST
Host - attribute name.static java.lang.String
ATTR_REQUESTED_RESOURCE
Requested resource - attribute name.static java.lang.String
ATTR_RESPONSE_CONTENT_TYPE
Response content type - attribute name.static java.lang.String
ATTR_SOAP_ACTION
SOAP action - attribute name.static java.lang.String
ATTR_SOAP_REQUEST
SOAP request - attribute name.static java.lang.String
ATTR_SOAP_RESPONSE
SOAP response - attribute name.static java.lang.String
ATTR_WSDL_REQUESTED
WSDL requested - attribute name.protected java.lang.String
CHARSET
Charset constant.static java.lang.String
CONTENT_TYPE_HTML
Content type - "text/html"static java.lang.String
CONTENT_TYPE_XML
Content type - "text/xml"protected static java.lang.String
FALSE
Boolean value represented as String.protected java.lang.String
mInputXMLType
Specifies the type of the SOAP Request message input to the AssemblyLineprotected 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 authenticationprotected java.lang.String
mReturnXMLType
Specifies the type of the SOAP Response message output from the AssemblyLineprotected javax.xml.parsers.SAXParserFactory
mSAXParserFactory
SAXParserFactory
protected WSReceiverServerConnector
mServerConnector
Server Connectorprotected java.net.ServerSocket
mServerSocket
Server socket.protected java.net.Socket
mSocket
Client socketprotected 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) connectionsprotected static java.lang.String
PARAM_INPUT_TYPE
Parameter name.Specifies the type of the SOAP Request message input to the AssemblyLineprotected static java.lang.String
PARAM_REQUIRE_CLIENT_AUTH
Parameter name.Is client authentication required.If checked clients will be required to provide SSL certificates for client authenticationprotected static java.lang.String
PARAM_RETURN_XML_TYPE
Parameter name.Parameter name.Specifies the type of the SOAP Response message output from the AssemblyLineprotected static java.lang.String
PARAM_SYSTEM_TCP_BACKLOG
System backlog.protected static java.lang.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 java.lang.String
PARAM_TCP_BACKLOG
Parameter name.Backlog.protected static java.lang.String
PARAM_TCP_PORT
Parameter name.The port number the service is running (listening) onprotected static java.lang.String
PARAM_USE_SSL
Parameter name.Enable/Disable SSL.If checked the server will only accept SSL (https) connectionsprotected static java.lang.String
TRUE
Boolean value represented as String.static java.lang.String
WSDL_ID
WSDL suffixstatic java.lang.String
XML_DOM
Public constant representing XML DOM format.static java.lang.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
Constructors Constructor Description WSReceiverServerConnector()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getAuthorization(java.lang.StringBuffer headers)
Gets the username and password return by client.protected java.lang.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()
java.lang.String
getVersion()
Version information.protected void
httpAuthenticationRequest(java.lang.String realm)
Send request to client to authenticate.void
initialize(java.lang.Object obj)
Initialize the connector.boolean
isAccepting()
boolean
isTerminating()
java.lang.String
readFile(java.lang.String aFileName)
This method is supposed to be used in scripts for reading WSDL files.protected java.lang.String
readLine()
Read line from client.void
replyEntry(Entry conn)
Send a reply to the connector.void
setServerConnector(WSReceiverServerConnector aServerConnector)
Sets theWSReceiverServerConnector
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, 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, 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 java.lang.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 java.lang.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 java.lang.String PARAM_SYSTEM_TCP_BACKLOG
System backlog.- See Also:
- Constant Field Values
-
PARAM_RETURN_XML_TYPE
protected static final java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.String mInputXMLType
Specifies the type of the SOAP Request message input to the AssemblyLine
-
mReturnXMLType
protected java.lang.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 java.net.Socket mSocket
Client socket- See Also:
Socket
-
mServerSocket
protected java.net.ServerSocket mServerSocket
Server socket.- See Also:
ServerSocket
-
mServerConnector
protected WSReceiverServerConnector mServerConnector
Server Connector
-
CHARSET
protected java.lang.String CHARSET
Charset constant.
-
ATTR_SOAP_RESPONSE
public static final java.lang.String ATTR_SOAP_RESPONSE
SOAP response - attribute name.- See Also:
- Constant Field Values
-
ATTR_HOST
public static final java.lang.String ATTR_HOST
Host - attribute name.- See Also:
- Constant Field Values
-
ATTR_REQUESTED_RESOURCE
public static final java.lang.String ATTR_REQUESTED_RESOURCE
Requested resource - attribute name.- See Also:
- Constant Field Values
-
ATTR_SOAP_REQUEST
public static final java.lang.String ATTR_SOAP_REQUEST
SOAP request - attribute name.- See Also:
- Constant Field Values
-
ATTR_SOAP_ACTION
public static final java.lang.String ATTR_SOAP_ACTION
SOAP action - attribute name.- See Also:
- Constant Field Values
-
ATTR_WSDL_REQUESTED
public static final java.lang.String ATTR_WSDL_REQUESTED
WSDL requested - attribute name.- See Also:
- Constant Field Values
-
ATTR_RESPONSE_CONTENT_TYPE
public static final java.lang.String ATTR_RESPONSE_CONTENT_TYPE
Response content type - attribute name.- See Also:
- Constant Field Values
-
XML_STRING
public static final java.lang.String XML_STRING
Public constant representing XML String format.- See Also:
- Constant Field Values
-
XML_DOM
public static final java.lang.String XML_DOM
Public constant representing XML DOM format.- See Also:
- Constant Field Values
-
WSDL_ID
public static final java.lang.String WSDL_ID
WSDL suffix- See Also:
- Constant Field Values
-
CONTENT_TYPE_XML
public static final java.lang.String CONTENT_TYPE_XML
Content type - "text/xml"- See Also:
- Constant Field Values
-
CONTENT_TYPE_HTML
public static final java.lang.String CONTENT_TYPE_HTML
Content type - "text/html"- See Also:
- Constant Field Values
-
TRUE
protected static final java.lang.String TRUE
Boolean value represented as String.- See Also:
- Constant Field Values
-
FALSE
protected static final java.lang.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 javax.xml.parsers.SAXParserFactory mSAXParserFactory
SAXParserFactory
-
-
Method Detail
-
initialize
public void initialize(java.lang.Object obj) throws java.lang.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 interfaceConnectorInterface
- Overrides:
initialize
in classConnector
- Parameters:
obj
- User provided parameter- Throws:
java.lang.Exception
- if the initialization of this connector fails.
-
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 the server socket is not specified.
-
getServerConnector
public WSReceiverServerConnector getServerConnector()
- Returns:
- WSReceiverServerConnector
-
setServerConnector
public void setServerConnector(WSReceiverServerConnector aServerConnector)
Sets theWSReceiverServerConnector
- Parameters:
aServerConnector
- WSReceiverServerConnector
-
terminateServer
public void terminateServer() throws java.lang.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 interfaceConnectorInterface
- Overrides:
terminateServer
in classConnector
- Throws:
java.lang.Exception
- if an error occurs
-
terminate
public void terminate() throws java.lang.Exception
Terminate the connector. This function closes all connection and releases all resources used by the connector.- Specified by:
terminate
in interfaceConnectorInterface
- Overrides:
terminate
in classConnector
- Throws:
java.lang.Exception
- if an error occurs
-
getNextEntry
public Entry getNextEntry() throws java.lang.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 interfaceConnectorInterface
- Overrides:
getNextEntry
in classConnector
- Returns:
- the next Entry, or null if no more data
- Throws:
java.lang.Exception
- if an error occurs- See Also:
ConnectorInterface.selectEntries()
-
replyEntry
public void replyEntry(Entry conn) throws java.lang.Exception
Send a reply to the connector.- Specified by:
replyEntry
in interfaceConnectorInterface
- Overrides:
replyEntry
in classConnector
- Parameters:
conn
- Entry- Throws:
java.lang.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 java.lang.String getVersion()
Description copied from interface:VersionInfoInterface
Version information.- Specified by:
getVersion
in interfaceVersionInfoInterface
- Returns:
- version information.
-
readFile
public java.lang.String readFile(java.lang.String aFileName) throws java.io.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:
java.io.IOException
- if an I/O error occurs
-
getAuthorization
protected java.lang.String getAuthorization(java.lang.StringBuffer headers) throws java.io.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:
java.io.IOException
-
getHeaders
protected java.lang.StringBuffer getHeaders() throws java.io.IOException
Gets the header information send by client.- Returns:
- Header information.
- Throws:
java.io.IOException
-
readLine
protected java.lang.String readLine() throws java.io.IOException
Read line from client. This method is used when HTTP Basic Authentication is enabled.- Returns:
- Returns the line read.
- Throws:
java.io.IOException
-
httpAuthenticationRequest
protected void httpAuthenticationRequest(java.lang.String realm) throws java.io.IOException
Send request to client to authenticate.- Parameters:
realm
- String- Throws:
java.io.IOException
- if an I/O error occurs
-
-