Class XmppSenderConnection
java.lang.Object
org.springframework.ws.transport.AbstractWebServiceConnection
org.springframework.ws.transport.AbstractSenderConnection
org.springframework.ws.transport.xmpp.XmppSenderConnection
- All Implemented Interfaces:
AutoCloseable
,HeadersAwareSenderWebServiceConnection
,WebServiceConnection
Implementation of
WebServiceConnection
that is used for client-side XMPP
access. Exposes a Message
request and response message.- Since:
- 2.0
- Author:
- Gildas Cuisinier, Arjen Poutsma, Greg Turnquist
-
Constructor Summary
ModifierConstructorDescriptionprotected
XmppSenderConnection
(org.jivesoftware.smack.XMPPConnection connection, String to, String thread) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRequestHeader
(String name, String value) Adds a request header with the given name and value.Returns the error message.org.jivesoftware.smack.packet.Message
Returns the request message for this connection.protected OutputStream
Returns the output stream to write the request to.Returns an iteration over all the header names this request contains.getResponseHeaders
(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 response message, if any, for this connection.getUri()
Returns the URI for this connection.boolean
hasError()
Indicates whether this connection has an error.protected boolean
Indicates whether this connection has a response.protected void
Called before a message has been read from theTransportInputStream
.protected void
onSendAfterWrite
(WebServiceMessage message) Called after the given message has been written to theTransportOutputStream
.Methods inherited from class org.springframework.ws.transport.AbstractSenderConnection
createTransportInputStream, createTransportOutputStream, onClose
Methods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onSendBeforeWrite, receive, send
-
Constructor Details
-
XmppSenderConnection
-
-
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:
-
addRequestHeader
Description copied from interface:HeadersAwareSenderWebServiceConnection
Adds a request 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
-
getRequestOutputStream
Description copied from class:AbstractSenderConnection
Returns the output stream to write the request to.- Specified by:
getRequestOutputStream
in classAbstractSenderConnection
- 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
-
onReceiveBeforeRead
Description copied from class:AbstractWebServiceConnection
Called before a message has been read from theTransportInputStream
. Called fromAbstractWebServiceConnection.receive(WebServiceMessageFactory)
.Default implementation does nothing.
- Overrides:
onReceiveBeforeRead
in classAbstractWebServiceConnection
- Throws:
IOException
- when an I/O exception occurs
-
hasResponse
Description copied from class:AbstractSenderConnection
Indicates whether this connection has a response.- Specified by:
hasResponse
in classAbstractSenderConnection
- Throws:
IOException
-
getResponseHeaderNames
Description copied from interface:HeadersAwareSenderWebServiceConnection
Returns an iteration over all the header names this request contains. Returns an emptyIterator
if there are no headers. -
getResponseHeaders
Description copied from interface:HeadersAwareSenderWebServiceConnection
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
-
getResponseInputStream
Description copied from class:AbstractSenderConnection
Returns the input stream to read the response from.- Specified by:
getResponseInputStream
in classAbstractSenderConnection
- Throws:
IOException
-