org.apache.servicemix.xmpp.marshaler.impl
Class DefaultXMPPMarshaler

java.lang.Object
  extended by org.apache.servicemix.xmpp.marshaler.impl.DefaultXMPPMarshaler
All Implemented Interfaces:
XMPPMarshalerSupport

public class DefaultXMPPMarshaler
extends java.lang.Object
implements XMPPMarshalerSupport

Marshals Jabber messages into and out of NMS messages

Version:
$Revision: 429277 $

Field Summary
static java.lang.String FROM_PROPERTY
           
 
Constructor Summary
DefaultXMPPMarshaler()
           
DefaultXMPPMarshaler(org.apache.servicemix.jbi.jaxp.SourceMarshaler sourceMarshaler)
           
 
Method Summary
protected  void addJabberProperties(org.jivesoftware.smack.packet.Message message, javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage normalizedMessage)
          Appends properties on the NMS to the JMS Message
protected  void addNmsProperties(javax.jbi.messaging.NormalizedMessage normalizedMessage, org.jivesoftware.smack.packet.Packet message)
           
 void fromJBI(org.jivesoftware.smack.packet.Message message, javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage normalizedMessage)
          converts the normalized message into a XMPP message
 java.lang.String getMessageBodyTag()
           
 org.apache.servicemix.jbi.jaxp.SourceMarshaler getSourceMarshaler()
           
protected  java.lang.String messageAsString(javax.jbi.messaging.NormalizedMessage normalizedMessage)
          Converts the inbound message to a String that can be sent
 void setMessageBodyTag(java.lang.String messageBodyTag)
          Sets the XML open tag used to wrap inbound Jabber text messages
protected  void setProperty(org.jivesoftware.smack.packet.Message message, java.lang.String name, javax.xml.namespace.QName qName)
           
 void setSourceMarshaler(org.apache.servicemix.jbi.jaxp.SourceMarshaler sourceMarshaler)
           
protected  boolean shouldIncludeHeader(javax.jbi.messaging.NormalizedMessage normalizedMessage, java.lang.String name, java.lang.Object value)
          Decides whether or not the given header should be included in the JMS message.
 void toJBI(javax.jbi.messaging.NormalizedMessage normalizedMessage, org.jivesoftware.smack.packet.Packet packet)
          converts the xmpp message to a normalized message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FROM_PROPERTY

public static final java.lang.String FROM_PROPERTY
See Also:
Constant Field Values
Constructor Detail

DefaultXMPPMarshaler

public DefaultXMPPMarshaler()

DefaultXMPPMarshaler

public DefaultXMPPMarshaler(org.apache.servicemix.jbi.jaxp.SourceMarshaler sourceMarshaler)
Method Detail

fromJBI

public void fromJBI(org.jivesoftware.smack.packet.Message message,
                    javax.jbi.messaging.MessageExchange exchange,
                    javax.jbi.messaging.NormalizedMessage normalizedMessage)
             throws javax.xml.transform.TransformerException
converts the normalized message into a XMPP message

Specified by:
fromJBI in interface XMPPMarshalerSupport
Parameters:
message - the XMPP message to fill
exchange - the exchange to use as source
normalizedMessage - the normalized message to use as source
Throws:
javax.xml.transform.TransformerException - on conversion errors

toJBI

public void toJBI(javax.jbi.messaging.NormalizedMessage normalizedMessage,
                  org.jivesoftware.smack.packet.Packet packet)
           throws javax.jbi.messaging.MessagingException
converts the xmpp message to a normalized message

Specified by:
toJBI in interface XMPPMarshalerSupport
Parameters:
normalizedMessage - the normalized message to fill
packet - the xmpp packet to use
Throws:
javax.jbi.messaging.MessagingException - on conversion errors

getSourceMarshaler

public org.apache.servicemix.jbi.jaxp.SourceMarshaler getSourceMarshaler()
Returns:
the sourceMarshaler

setSourceMarshaler

public void setSourceMarshaler(org.apache.servicemix.jbi.jaxp.SourceMarshaler sourceMarshaler)
Parameters:
sourceMarshaler - the sourceMarshaler to set

getMessageBodyTag

public java.lang.String getMessageBodyTag()

setMessageBodyTag

public void setMessageBodyTag(java.lang.String messageBodyTag)
Sets the XML open tag used to wrap inbound Jabber text messages

Parameters:
messageBodyTag - the tag to use

messageAsString

protected java.lang.String messageAsString(javax.jbi.messaging.NormalizedMessage normalizedMessage)
                                    throws javax.xml.transform.TransformerException
Converts the inbound message to a String that can be sent

Parameters:
normalizedMessage - the normalized message to transform to string
Returns:
the string content of the normalized message
Throws:
javax.xml.transform.TransformerException - on conversion errors

addJabberProperties

protected void addJabberProperties(org.jivesoftware.smack.packet.Message message,
                                   javax.jbi.messaging.MessageExchange exchange,
                                   javax.jbi.messaging.NormalizedMessage normalizedMessage)
Appends properties on the NMS to the JMS Message

Parameters:
message - the xmpp message
exchange - the message exchange
normalizedMessage - the normalized message

setProperty

protected void setProperty(org.jivesoftware.smack.packet.Message message,
                           java.lang.String name,
                           javax.xml.namespace.QName qName)

addNmsProperties

protected void addNmsProperties(javax.jbi.messaging.NormalizedMessage normalizedMessage,
                                org.jivesoftware.smack.packet.Packet message)

shouldIncludeHeader

protected boolean shouldIncludeHeader(javax.jbi.messaging.NormalizedMessage normalizedMessage,
                                      java.lang.String name,
                                      java.lang.Object value)
Decides whether or not the given header should be included in the JMS message. By default this includes all suitable typed values

Parameters:
normalizedMessage - the normalized message
name - the header name
value - the header value
Returns:
true if it should be included


Copyright © 2005-2015 FuseSource. All Rights Reserved.