Spring Integration

org.springframework.integration.xmpp.presence
Class XmppPresenceMessageMapper

java.lang.Object
  extended by org.springframework.integration.xmpp.presence.XmppPresenceMessageMapper
All Implemented Interfaces:
InboundMessageMapper<org.jivesoftware.smack.packet.Presence>, OutboundMessageMapper<org.jivesoftware.smack.packet.Presence>

public class XmppPresenceMessageMapper
extends Object
implements OutboundMessageMapper<org.jivesoftware.smack.packet.Presence>, InboundMessageMapper<org.jivesoftware.smack.packet.Presence>

Implementation of the strategy interface OutboundMessageMapper. This is the hook that lets the adapter receive various payloads from components inside Spring Integration and forward them correctly as Presence instances.

Since:
2.0
Author:
Josh Long

Constructor Summary
XmppPresenceMessageMapper()
           
 
Method Summary
 org.jivesoftware.smack.packet.Presence fromMessage(Message<?> message)
          Builds a Presence object from the inbound Message headers, if possible.
 Message<?> toMessage(org.jivesoftware.smack.packet.Presence presence)
          Returns a Message with payload Presence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmppPresenceMessageMapper

public XmppPresenceMessageMapper()
Method Detail

toMessage

public Message<?> toMessage(org.jivesoftware.smack.packet.Presence presence)
                     throws Exception
Returns a Message with payload Presence

Specified by:
toMessage in interface InboundMessageMapper<org.jivesoftware.smack.packet.Presence>
Parameters:
presence - the presence object that can be used to present the priority, status, mode, and type of a given roster entry. This will be decomposed into a series of headers, as well as a payload
Returns:
the Message
Throws:
Exception - thrown if conversion should fail

fromMessage

public org.jivesoftware.smack.packet.Presence fromMessage(Message<?> message)
                                                   throws Exception
Builds a Presence object from the inbound Message headers, if possible.

Specified by:
fromMessage in interface OutboundMessageMapper<org.jivesoftware.smack.packet.Presence>
Parameters:
message - the Message whose headers and payload willl b
Returns:
the presence object as constructed from the Message object
Throws:
Exception - if there is a problem

Spring Integration

Copyright © 2010. All Rights Reserved.