Class XmppReceiverConnection
java.lang.Object
org.springframework.ws.transport.AbstractWebServiceConnection
org.springframework.ws.transport.AbstractReceiverConnection
org.springframework.ws.transport.xmpp.XmppReceiverConnection
- All Implemented Interfaces:
AutoCloseable
,HeadersAwareReceiverWebServiceConnection
,WebServiceConnection
Implementation of
WebServiceConnection
that is used for server-side XMPP
access. Exposes a Message
request and response message.- Since:
- 2.0
- Author:
- Gildas Cuisinier, Arjen Poutsma, Greg Turnquist
-
Constructor Summary
ConstructorDescriptionXmppReceiverConnection
(org.jivesoftware.smack.XMPPConnection connection, org.jivesoftware.smack.packet.Message requestMessage) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addResponseHeader
(String name, String value) Adds a response header with the given name and value.Returns the error message.Returns an iteration over all the header names this request contains.getRequestHeaders
(String name) Returns an iteration over all the string values of the specified header.protected InputStream
Returns the input stream to read the response from.org.jivesoftware.smack.packet.Message
Returns the request message for this connection.org.jivesoftware.smack.packet.Message
Returns the response message, if any, for this connection.protected OutputStream
Returns the output stream to write the request to.getUri()
Returns the URI for this connection.boolean
hasError()
Indicates whether this connection has an error.protected void
onSendAfterWrite
(WebServiceMessage message) Called after the given message has been written to theTransportOutputStream
.protected void
onSendBeforeWrite
(WebServiceMessage message) Called before the given message has been written to theTransportOutputStream
.Methods inherited from class org.springframework.ws.transport.AbstractReceiverConnection
createTransportInputStream, createTransportOutputStream, onClose
Methods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, receive, send
-
Constructor Details
-
XmppReceiverConnection
public XmppReceiverConnection(org.jivesoftware.smack.XMPPConnection connection, org.jivesoftware.smack.packet.Message requestMessage)
-
-
Method Details
-
getRequestMessage
public org.jivesoftware.smack.packet.Message getRequestMessage()Returns the request message for this connection. -
getResponseMessage
public org.jivesoftware.smack.packet.Message getResponseMessage()Returns the response message, if any, for this connection. -
getUri
Description copied from interface:WebServiceConnection
Returns the URI for this connection.- Throws:
URISyntaxException
-
hasError
public boolean hasError()Description copied from interface:WebServiceConnection
Indicates whether this connection has an error. Typically, error detection is done by inspecting connection error codes, etc.- Returns:
true
if this connection has an error;false
otherwise.
-
getErrorMessage
Description copied from interface:WebServiceConnection
Returns the error message.- Returns:
- the connection error message, if any; returns
null
when no error is present - See Also:
-
getRequestHeaderNames
Description copied from interface:HeadersAwareReceiverWebServiceConnection
Returns an iteration over all the header names this request contains. Returns an emptyIterator
if there are no headers.- Throws:
IOException
-
getRequestHeaders
Description copied from interface:HeadersAwareReceiverWebServiceConnection
Returns an iteration over all the string values of the specified header. Returns an emptyIterator
if there are no headers of the specified name.- Throws:
IOException
-
getRequestInputStream
Description copied from class:AbstractReceiverConnection
Returns the input stream to read the response from.- Specified by:
getRequestInputStream
in classAbstractReceiverConnection
- Throws:
IOException
-
onSendBeforeWrite
Description copied from class:AbstractWebServiceConnection
Called before the given message has been written to theTransportOutputStream
. Called fromAbstractWebServiceConnection.send(WebServiceMessage)
.Default implementation does nothing.
- Overrides:
onSendBeforeWrite
in classAbstractWebServiceConnection
- Parameters:
message
- the message- Throws:
IOException
- when an I/O exception occurs
-
addResponseHeader
Description copied from interface:HeadersAwareReceiverWebServiceConnection
Adds a response header with the given name and value. This method can be called multiple times, to allow for headers with multiple values.- Parameters:
name
- the name of the headervalue
- the value of the header- Throws:
IOException
-
getResponseOutputStream
Description copied from class:AbstractReceiverConnection
Returns the output stream to write the request to.- Specified by:
getResponseOutputStream
in classAbstractReceiverConnection
- Throws:
IOException
-
onSendAfterWrite
Description copied from class:AbstractWebServiceConnection
Called after the given message has been written to theTransportOutputStream
. Called fromAbstractWebServiceConnection.send(WebServiceMessage)
.Default implementation does nothing.
- Overrides:
onSendAfterWrite
in classAbstractWebServiceConnection
- Parameters:
message
- the message- Throws:
IOException
- when an I/O exception occurs
-