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
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedXmppSenderConnection(org.jivesoftware.smack.XMPPConnection connection, String to, String thread) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequestHeader(String name, String value) Adds a request header with the given name and value.@Nullable StringReturns the error message.org.jivesoftware.smack.packet.MessageReturns the request message for this connection.protected OutputStreamReturns the output stream to write the request to.Return an iteration over all the header names the response contains.getResponseHeaders(String name) Return an iteration over all the string values of the specified response header.protected InputStreamReturns the input stream to read the response from.@Nullable org.jivesoftware.smack.packet.MessageReturns the response message, if any, for this connection.getUri()Returns the URI for this connection.booleanhasError()Indicates whether this connection has an error.protected booleanIndicates whether this connection has a response.protected voidCalled before a message has been read from theTransportInputStream.protected voidonSendAfterWrite(WebServiceMessage message) Called after the given message has been written to theTransportOutputStream.Methods inherited from class AbstractSenderConnection
createTransportInputStream, createTransportOutputStream, onCloseMethods inherited from class AbstractWebServiceConnection
close, onReceiveAfterRead, onSendBeforeWrite, receive, sendMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface WebServiceConnection
close, receive, send
-
Constructor Details
-
XmppSenderConnection
-
-
Method Details
-
getRequestMessage
public org.jivesoftware.smack.packet.Message getRequestMessage()Returns the request message for this connection. -
getResponseMessage
public @Nullable org.jivesoftware.smack.packet.Message getResponseMessage()Returns the response message, if any, for this connection. -
getUri
Description copied from interface:WebServiceConnectionReturns the URI for this connection.- Throws:
URISyntaxException
-
hasError
public boolean hasError()Description copied from interface:WebServiceConnectionIndicates whether this connection has an error. Typically, error detection is done by inspecting connection error codes, etc.- Returns:
trueif this connection has an error;falseotherwise.
-
getErrorMessage
Description copied from interface:WebServiceConnectionReturns the error message.- Returns:
- the connection error message, if any; returns
nullwhen no error is present - See Also:
-
addRequestHeader
Description copied from interface:HeadersAwareSenderWebServiceConnectionAdds 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:AbstractSenderConnectionReturns the output stream to write the request to.- Specified by:
getRequestOutputStreamin classAbstractSenderConnection- Throws:
IOException
-
onSendAfterWrite
Description copied from class:AbstractWebServiceConnectionCalled after the given message has been written to theTransportOutputStream. Called fromAbstractWebServiceConnection.send(WebServiceMessage).Default implementation does nothing.
- Overrides:
onSendAfterWritein classAbstractWebServiceConnection- Parameters:
message- the message- Throws:
IOException- when an I/O exception occurs
-
onReceiveBeforeRead
Description copied from class:AbstractWebServiceConnectionCalled before a message has been read from theTransportInputStream. Called fromAbstractWebServiceConnection.receive(WebServiceMessageFactory).Default implementation does nothing.
- Overrides:
onReceiveBeforeReadin classAbstractWebServiceConnection- Throws:
IOException- when an I/O exception occurs
-
hasResponse
Description copied from class:AbstractSenderConnectionIndicates whether this connection has a response.- Specified by:
hasResponsein classAbstractSenderConnection- Throws:
IOException
-
getResponseHeaderNames
Description copied from interface:HeadersAwareSenderWebServiceConnectionReturn an iteration over all the header names the response contains. Returns an emptyIteratorif there are no headers. -
getResponseHeaders
Description copied from interface:HeadersAwareSenderWebServiceConnectionReturn an iteration over all the string values of the specified response header. Return an emptyIteratorif there is no header of the specified name.- Throws:
IOException
-
getResponseInputStream
Description copied from class:AbstractSenderConnectionReturns the input stream to read the response from.- Specified by:
getResponseInputStreamin classAbstractSenderConnection- Throws:
IOException
-