Joram 5.2.4

org.objectweb.joram.mom.amqp
Class JoramMOMHandler

java.lang.Object
  extended by org.objectweb.joram.mom.amqp.JoramMOMHandler
All Implemented Interfaces:
MOMHandler

public class JoramMOMHandler
extends java.lang.Object
implements MOMHandler


Constructor Summary
JoramMOMHandler()
           
 
Method Summary
 AMQP.Access.RequestOk accessRequest(java.lang.String realm, boolean exclusive, boolean passive, boolean active, boolean write, boolean read, int channelNumber)
          Request an access ticket for the named realm and the given role and exclusivity flags
 void basicAck(long deliveryTag, boolean multiple, int channelNumber)
          Acknowledge one or several received messages.
 void basicCancel(java.lang.String consumerTag, int channelNumber)
          Cancel a consumer.
 void basicConsume(java.lang.String queue, boolean noAck, java.lang.String consumerTag, boolean noLocal, boolean exclusive, int ticket, boolean noWait, int channelNumber, fr.dyade.aaa.util.Queue queueOut)
          Start a consumer.
 void basicGet(java.lang.String queue, boolean noAck, int ticket, int channelNumber)
          Retrieve a message from a queue.
 void basicPublish(PublishRequest publishRequest, int channelNumber)
          Publish a message
 void channelClose(int channelNumber)
           
 void close()
          Closes the MOMHandler
 void connectionClose()
           
 void exchangeDeclare(java.lang.String exchangeName, java.lang.String type, boolean passive, boolean durable, boolean autoDelete, java.util.Map arguments, int ticket, int channelNumber)
          Declare an exchange.
 void exchangeDelete(java.lang.String exchangeName, boolean ifUnused, boolean nowait, int ticket, int channelNumber)
          Delete an exchange
 java.util.Map getMOMProperties()
          Gets MOM properties returned to the client on connection start.
 void queueBind(java.lang.String queue, java.lang.String exchange, boolean nowait, java.lang.String routingKey, java.util.Map arguments, int ticket, int channelNumber)
          Bind a queue to an exchange.
 AMQP.Queue.DeclareOk queueDeclare(java.lang.String queueName, boolean passive, boolean durable, boolean exclusive, boolean autoDelete, java.util.Map arguments, int ticket, int channelNumber)
          Declare a queue
 AMQP.Queue.DeleteOk queueDelete(java.lang.String queue, boolean ifUnused, boolean ifEmpty, boolean nowait, int ticket, int channelNumber)
          Delete a queue, without regard for whether it is in use or has messages on it
 void queuePurge(java.lang.String queue, boolean nowait, int ticket, int channelNumber)
           
 void queueUnbind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey, java.util.Map arguments, int ticket, int channelNumber)
           
 void setConsumer(Consumer consumer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JoramMOMHandler

public JoramMOMHandler()
Method Detail

setConsumer

public void setConsumer(Consumer consumer)
Specified by:
setConsumer in interface MOMHandler

accessRequest

public AMQP.Access.RequestOk accessRequest(java.lang.String realm,
                                           boolean exclusive,
                                           boolean passive,
                                           boolean active,
                                           boolean write,
                                           boolean read,
                                           int channelNumber)
                                    throws java.lang.Exception
Description copied from interface: MOMHandler
Request an access ticket for the named realm and the given role and exclusivity flags

Specified by:
accessRequest in interface MOMHandler
Parameters:
realm - the name of the realm
exclusive - true if we are requesting exclusive access
passive - true if we are requesting passive access
active - true if we are requesting active access
write - true if we are requesting write access
read - true if we are requesting read access
channelNumber - the channel the request came from
Returns:
a valid access ticket
Throws:
java.io.IOException - if an error is encountered e.g. we don't have permission
java.lang.Exception

basicAck

public void basicAck(long deliveryTag,
                     boolean multiple,
                     int channelNumber)
              throws java.lang.Exception
Description copied from interface: MOMHandler
Acknowledge one or several received messages.

Specified by:
basicAck in interface MOMHandler
Parameters:
deliveryTag - the delivery tag
multiple - true if we are acknowledging multiple messages with the same delivery tag
channelNumber - the channel the request came from
Throws:
java.lang.Exception - if an error is encountered

basicCancel

public void basicCancel(java.lang.String consumerTag,
                        int channelNumber)
                 throws java.lang.Exception
Description copied from interface: MOMHandler
Cancel a consumer.

Specified by:
basicCancel in interface MOMHandler
Parameters:
consumerTag - a client -or server- generated consumer tag to establish context
channelNumber - the channel the request came from
Throws:
java.lang.Exception

basicConsume

public void basicConsume(java.lang.String queue,
                         boolean noAck,
                         java.lang.String consumerTag,
                         boolean noLocal,
                         boolean exclusive,
                         int ticket,
                         boolean noWait,
                         int channelNumber,
                         fr.dyade.aaa.util.Queue queueOut)
                  throws java.lang.Exception
Description copied from interface: MOMHandler
Start a consumer.

Specified by:
basicConsume in interface MOMHandler
Parameters:
queue - the name of the queue
noAck - true if no handshake is required
consumerTag - a client-generated consumer tag to establish context
noLocal - flag set to true unless server local buffering is required
exclusive - true if this is an exclusive consumer
ticket - an access ticket for the appropriate realm
channelNumber - the channel the request came from
Throws:
java.lang.Exception

basicGet

public void basicGet(java.lang.String queue,
                     boolean noAck,
                     int ticket,
                     int channelNumber)
              throws java.lang.Exception
Description copied from interface: MOMHandler
Retrieve a message from a queue.

Specified by:
basicGet in interface MOMHandler
Parameters:
queue - the name of the queue
noAck - true if no handshake is required
ticket - an access ticket for the appropriate realm
channelNumber - the channel the request came from
Throws:
java.lang.Exception - if an error is encountered

basicPublish

public void basicPublish(PublishRequest publishRequest,
                         int channelNumber)
                  throws java.lang.Exception
Description copied from interface: MOMHandler
Publish a message

Specified by:
basicPublish in interface MOMHandler
channelNumber - the channel the request came from
Throws:
java.lang.Exception - if an error is encountered

close

public void close()
Description copied from interface: MOMHandler
Closes the MOMHandler

Specified by:
close in interface MOMHandler

exchangeDeclare

public void exchangeDeclare(java.lang.String exchangeName,
                            java.lang.String type,
                            boolean passive,
                            boolean durable,
                            boolean autoDelete,
                            java.util.Map arguments,
                            int ticket,
                            int channelNumber)
                     throws java.lang.Exception
Description copied from interface: MOMHandler
Declare an exchange.

Specified by:
exchangeDeclare in interface MOMHandler
Parameters:
exchangeName - the name of the exchange
type - the exchange type
passive - true if we are passively declaring a exchange (asserting the exchange already exists)
durable - true if we are declaring a durable exchange (the exchange will survive a server restart)
autoDelete - true if the server should delete the exchange when it is no longer in use
arguments - other properties (construction arguments) for the exchange
ticket - an access ticket for the appropriate realm
channelNumber - the channel the request came from
Throws:
java.lang.Exception

exchangeDelete

public void exchangeDelete(java.lang.String exchangeName,
                           boolean ifUnused,
                           boolean nowait,
                           int ticket,
                           int channelNumber)
                    throws java.lang.Exception
Description copied from interface: MOMHandler
Delete an exchange

Specified by:
exchangeDelete in interface MOMHandler
ifUnused - true to indicate that the exchange is only to be deleted if it is unused
ticket - an access ticket for the appropriate realm
channelNumber - the channel the request came from
Throws:
java.lang.Exception

getMOMProperties

public java.util.Map getMOMProperties()
Description copied from interface: MOMHandler
Gets MOM properties returned to the client on connection start.

Specified by:
getMOMProperties in interface MOMHandler
Returns:
a HashMap with some properties describing the MOM (product, copyright, version...)

queueBind

public void queueBind(java.lang.String queue,
                      java.lang.String exchange,
                      boolean nowait,
                      java.lang.String routingKey,
                      java.util.Map arguments,
                      int ticket,
                      int channelNumber)
               throws java.lang.Exception
Description copied from interface: MOMHandler
Bind a queue to an exchange.

Specified by:
queueBind in interface MOMHandler
Parameters:
queue - the name of the queue
exchange - the name of the exchange
routingKey - the routine key to use for the binding
arguments - other properties (binding parameters)
ticket - an access ticket for the appropriate realm
channelNumber - the channel the request came from
Throws:
java.lang.Exception - if an error is encountered

queueUnbind

public void queueUnbind(java.lang.String queue,
                        java.lang.String exchange,
                        java.lang.String routingKey,
                        java.util.Map arguments,
                        int ticket,
                        int channelNumber)
                 throws java.lang.Exception
Specified by:
queueUnbind in interface MOMHandler
Throws:
java.lang.Exception

queueDeclare

public AMQP.Queue.DeclareOk queueDeclare(java.lang.String queueName,
                                         boolean passive,
                                         boolean durable,
                                         boolean exclusive,
                                         boolean autoDelete,
                                         java.util.Map arguments,
                                         int ticket,
                                         int channelNumber)
                                  throws java.lang.Exception
Description copied from interface: MOMHandler
Declare a queue

Specified by:
queueDeclare in interface MOMHandler
Parameters:
queueName - the name of the queue
passive - true if we are passively declaring a queue (asserting the queue already exists)
durable - true if we are declaring a durable queue (the queue will survive a server restart)
exclusive - true if we are declaring an exclusive queue
autoDelete - true if we are declaring an autodelete queue (server will delete it when no longer in use)
arguments - other properties (construction arguments) for the queue
ticket - an access ticket for the appropriate realm
channelNumber - the channel the request came from
Returns:
the name of the queue returned to the client
Throws:
java.lang.Exception - if an error is encountered

queueDelete

public AMQP.Queue.DeleteOk queueDelete(java.lang.String queue,
                                       boolean ifUnused,
                                       boolean ifEmpty,
                                       boolean nowait,
                                       int ticket,
                                       int channelNumber)
                                throws java.lang.Exception
Description copied from interface: MOMHandler
Delete a queue, without regard for whether it is in use or has messages on it

Specified by:
queueDelete in interface MOMHandler
Parameters:
queue - the name of the queue
ifUnused - true if the queue should be deleted only if not in use
ifEmpty - true if the queue should be deleted only if empty
ticket - an access ticket for the appropriate realm
channelNumber - the channel the request came from
Returns:
the number of messages purged
Throws:
java.lang.Exception - if an error is encountered

queuePurge

public void queuePurge(java.lang.String queue,
                       boolean nowait,
                       int ticket,
                       int channelNumber)
                throws java.lang.Exception
Specified by:
queuePurge in interface MOMHandler
Throws:
java.lang.Exception

channelClose

public void channelClose(int channelNumber)
                  throws java.lang.Exception
Specified by:
channelClose in interface MOMHandler
Throws:
java.lang.Exception

connectionClose

public void connectionClose()
                     throws java.lang.Exception
Specified by:
connectionClose in interface MOMHandler
Throws:
java.lang.Exception

Joram 5.2.4

Copyright © 2000 - 2009 Scalagent D.T. - All rights reserved