Spring Web Services Framework

org.springframework.ws.transport.xmpp
Class XmppReceiverConnection

java.lang.Object
  extended by org.springframework.ws.transport.AbstractWebServiceConnection
      extended by org.springframework.ws.transport.AbstractReceiverConnection
          extended by org.springframework.ws.transport.xmpp.XmppReceiverConnection
All Implemented Interfaces:
WebServiceConnection

public class XmppReceiverConnection
extends AbstractReceiverConnection

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

Constructor Summary
XmppReceiverConnection(org.jivesoftware.smack.XMPPConnection connection, org.jivesoftware.smack.packet.Message requestMessage)
           
 
Method Summary
protected  void addResponseHeader(String name, String value)
          Adds a response header with the given name and value.
 String getErrorMessage()
          Returns the error message.
protected  Iterator<String> getRequestHeaderNames()
          Returns an iteration over all the header names this request contains.
protected  Iterator<String> getRequestHeaders(String name)
          Returns an iteration over all the string values of the specified header.
protected  InputStream getRequestInputStream()
          Returns the input stream to read the response from.
 org.jivesoftware.smack.packet.Message getRequestMessage()
          Returns the request message for this connection.
 org.jivesoftware.smack.packet.Message getResponseMessage()
          Returns the response message, if any, for this connection.
protected  OutputStream getResponseOutputStream()
          Returns the output stream to write the request to.
 URI 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 the TransportOutputStream.
protected  void onSendBeforeWrite(WebServiceMessage message)
          Called before the given message has been written to the TransportOutputStream.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmppReceiverConnection

public XmppReceiverConnection(org.jivesoftware.smack.XMPPConnection connection,
                              org.jivesoftware.smack.packet.Message requestMessage)
Method Detail

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

public URI getUri()
           throws URISyntaxException
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

public String 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:
WebServiceConnection.hasError()

getRequestHeaderNames

protected Iterator<String> getRequestHeaderNames()
                                          throws IOException
Description copied from class: AbstractReceiverConnection
Returns an iteration over all the header names this request contains. Returns an empty Iterator if there are no headers.

Specified by:
getRequestHeaderNames in class AbstractReceiverConnection
Throws:
IOException

getRequestHeaders

protected Iterator<String> getRequestHeaders(String name)
                                      throws IOException
Description copied from class: AbstractReceiverConnection
Returns an iteration over all the string values of the specified header. Returns an empty Iterator if there are no headers of the specified name.

Specified by:
getRequestHeaders in class AbstractReceiverConnection
Throws:
IOException

getRequestInputStream

protected InputStream getRequestInputStream()
                                     throws IOException
Description copied from class: AbstractReceiverConnection
Returns the input stream to read the response from.

Specified by:
getRequestInputStream in class AbstractReceiverConnection
Throws:
IOException

onSendBeforeWrite

protected void onSendBeforeWrite(WebServiceMessage message)
                          throws IOException
Description copied from class: AbstractWebServiceConnection
Called before the given message has been written to the TransportOutputStream. Called from AbstractWebServiceConnection.send(WebServiceMessage).

Default implementation does nothing.

Overrides:
onSendBeforeWrite in class AbstractWebServiceConnection
Parameters:
message - the message
Throws:
IOException - when an I/O exception occurs

addResponseHeader

protected void addResponseHeader(String name,
                                 String value)
                          throws IOException
Description copied from class: AbstractReceiverConnection
Adds a response header with the given name and value. This method can be called multiple times, to allow for headers with multiple values.

Specified by:
addResponseHeader in class AbstractReceiverConnection
Parameters:
name - the name of the header
value - the value of the header
Throws:
IOException

getResponseOutputStream

protected OutputStream getResponseOutputStream()
                                        throws IOException
Description copied from class: AbstractReceiverConnection
Returns the output stream to write the request to.

Specified by:
getResponseOutputStream in class AbstractReceiverConnection
Throws:
IOException

onSendAfterWrite

protected void onSendAfterWrite(WebServiceMessage message)
                         throws IOException
Description copied from class: AbstractWebServiceConnection
Called after the given message has been written to the TransportOutputStream. Called from AbstractWebServiceConnection.send(WebServiceMessage).

Default implementation does nothing.

Overrides:
onSendAfterWrite in class AbstractWebServiceConnection
Parameters:
message - the message
Throws:
IOException - when an I/O exception occurs

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.