public class XmppMessageSender extends Object implements WebServiceMessageSender, org.springframework.beans.factory.InitializingBean
WebServiceMessageSender
implementation that uses XMPP Message
s.
Requires a connection
to be set.
This message sender supports URI's of the following format:
xmpp:toThe to represents a Jabber ID.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_MESSAGE_ENCODING
Default encoding used to read from and write to
Message messages. |
static long |
DEFAULT_RECEIVE_TIMEOUT
Default timeout for receive operations: -1 indicates a blocking receive without timeout.
|
Constructor and Description |
---|
XmppMessageSender() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
WebServiceConnection |
createConnection(URI uri)
Create a new
WebServiceConnection to the specified URI. |
protected String |
createThread() |
void |
setConnection(org.jivesoftware.smack.XMPPConnection connection)
Sets the
XMPPConnection . |
void |
setMessageEncoding(String messageEncoding)
Sets the encoding used to read from
Message object. |
void |
setReceiveTimeout(long receiveTimeout)
Set the timeout to use for receive calls.
|
boolean |
supports(URI uri)
Does this
WebServiceMessageSender support the supplied URI? |
public static final long DEFAULT_RECEIVE_TIMEOUT
public static final String DEFAULT_MESSAGE_ENCODING
Message
messages.public void setConnection(org.jivesoftware.smack.XMPPConnection connection)
XMPPConnection
. Setting this property is required.public void setReceiveTimeout(long receiveTimeout)
PacketCollector.nextResult(long)
public void setMessageEncoding(String messageEncoding)
Message
object. Defaults to
UTF-8
.public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public WebServiceConnection createConnection(URI uri) throws IOException
WebServiceMessageSender
WebServiceConnection
to the specified URI.createConnection
in interface WebServiceMessageSender
uri
- the URI to open a connection toIOException
- in case of I/O errorspublic boolean supports(URI uri)
WebServiceMessageSender
WebServiceMessageSender
support the supplied URI?supports
in interface WebServiceMessageSender
uri
- the URI to be checkedtrue
if this WebServiceMessageSender
supports the supplied URIprotected String createThread()