org.apache.activemq.transport.xmpp
Class ProtocolConverter

java.lang.Object
  extended by org.apache.activemq.transport.xmpp.ProtocolConverter

public class ProtocolConverter
extends Object

TODO lots of this code could be shared with Stomp


Constructor Summary
ProtocolConverter(XmppTransport transport)
           
 
Method Summary
protected  void addActiveMQMessageHeaders(ActiveMQMessage answer, Message message)
           
protected  ActiveMQDestination createActiveMQDestination(String jabberDestination)
          Converts the Jabber destination name into a destination in ActiveMQ
protected  ActiveMQMessage createActiveMQMessage(Message message)
           
protected  String createChallengeValue(Auth auth)
           
 void createDestination(String to)
           
protected  Handler<Response> createErrorHandler(String text)
           
protected  Feature createFeature(String var)
           
protected  Identity createIdentity(String category, String type, String name)
           
protected  Item createItem(String jid, String name, String node)
           
protected  Iq createResult(Iq iq)
          Creates a result command from the input
protected  Message createXmppMessage(String to, MessageDispatch messageDispatch)
           
protected  String debugString(Iq iq)
           
protected  int generateCommandId()
           
protected  void initialiseRegistry()
           
 void onActiveMQCommand(Command command)
           
protected  void onAuth(Auth auth)
           
protected  void onAuthQuery(Object any, Iq iq)
           
protected  void onDiscoInfo(Iq iq, Query query)
           
protected  void onDiscoItems(Iq iq, Query query)
           
protected  void onIq(Iq iq)
           
protected  void onMessage(Message message)
           
protected  void onPresence(Presence presence)
           
protected  void onStarttls(Starttls starttls)
           
 void onXmppCommand(Object command)
           
protected  void sendPresence(Presence presence, Item item)
           
protected  void sendToActiveMQ(Command command, Handler<Response> handler)
           
protected  void subscribe(String to, ActiveMQDestination destination, Map<String,ConsumerInfo> consumerMap)
           
protected  void unknownCommand(Object command)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolConverter

public ProtocolConverter(XmppTransport transport)
Method Detail

generateCommandId

protected int generateCommandId()

initialiseRegistry

protected void initialiseRegistry()

onXmppCommand

public void onXmppCommand(Object command)
                   throws Exception
Throws:
Exception

onActiveMQCommand

public void onActiveMQCommand(Command command)
                       throws Exception
Throws:
Exception

unknownCommand

protected void unknownCommand(Object command)
                       throws Exception
Throws:
Exception

onIq

protected void onIq(Iq iq)
             throws Exception
Throws:
Exception

onAuthQuery

protected void onAuthQuery(Object any,
                           Iq iq)
                    throws IOException,
                           JMSException
Throws:
IOException
JMSException

createDestination

public void createDestination(String to)
                       throws IOException,
                              JMSException
Throws:
IOException
JMSException

debugString

protected String debugString(Iq iq)

onDiscoItems

protected void onDiscoItems(Iq iq,
                            Query query)
                     throws IOException
Throws:
IOException

onDiscoInfo

protected void onDiscoInfo(Iq iq,
                           Query query)
                    throws IOException
Throws:
IOException

onPresence

protected void onPresence(Presence presence)
                   throws IOException,
                          JMSException
Throws:
IOException
JMSException

subscribe

protected void subscribe(String to,
                         ActiveMQDestination destination,
                         Map<String,ConsumerInfo> consumerMap)

createXmppMessage

protected Message createXmppMessage(String to,
                                    MessageDispatch messageDispatch)
                             throws IOException,
                                    JMSException
Throws:
IOException
JMSException

sendPresence

protected void sendPresence(Presence presence,
                            Item item)
                     throws IOException
Throws:
IOException

createItem

protected Item createItem(String jid,
                          String name,
                          String node)

createIdentity

protected Identity createIdentity(String category,
                                  String type,
                                  String name)

createFeature

protected Feature createFeature(String var)

createResult

protected Iq createResult(Iq iq)
Creates a result command from the input


sendToActiveMQ

protected void sendToActiveMQ(Command command,
                              Handler<Response> handler)

onStarttls

protected void onStarttls(Starttls starttls)
                   throws Exception
Throws:
Exception

onMessage

protected void onMessage(Message message)
                  throws Exception
Throws:
Exception

createErrorHandler

protected Handler<Response> createErrorHandler(String text)

createActiveMQDestination

protected ActiveMQDestination createActiveMQDestination(String jabberDestination)
                                                 throws JMSException
Converts the Jabber destination name into a destination in ActiveMQ

Throws:
JMSException

createActiveMQMessage

protected ActiveMQMessage createActiveMQMessage(Message message)
                                         throws JMSException
Throws:
JMSException

addActiveMQMessageHeaders

protected void addActiveMQMessageHeaders(ActiveMQMessage answer,
                                         Message message)
                                  throws JMSException
Throws:
JMSException

onAuth

protected void onAuth(Auth auth)
               throws Exception
Throws:
Exception

createChallengeValue

protected String createChallengeValue(Auth auth)


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.