Joram 5.2.4

org.objectweb.joram.mom.amqp
Interface MOMHandler

All Known Implementing Classes:
JoramMOMHandler

public interface MOMHandler


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 exchange, 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)
           
 

Method Detail

accessRequest

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

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

queueDeclare

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
Declare a queue

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

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

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

void queuePurge(java.lang.String queue,
                boolean nowait,
                int ticket,
                int channelNumber)
                throws java.lang.Exception
Throws:
java.lang.Exception

queueBind

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
Bind a queue to an exchange.

Parameters:
queue - the name of the queue
exchange - the name of the exchange
nowait -
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

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
Throws:
java.lang.Exception

basicGet

void basicGet(java.lang.String queue,
              boolean noAck,
              int ticket,
              int channelNumber)
              throws java.lang.Exception
Retrieve a message from a queue.

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

void basicPublish(PublishRequest publishRequest,
                  int channelNumber)
                  throws java.lang.Exception
Publish a message

Parameters:
messageAMQP - the message to publish with publishing properties
ticket - an access ticket for the appropriate realm
channelNumber - the channel the request came from
Throws:
java.lang.Exception - if an error is encountered

basicAck

void basicAck(long deliveryTag,
              boolean multiple,
              int channelNumber)
              throws java.lang.Exception
Acknowledge one or several received messages.

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

basicConsume

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
Start a consumer.

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
noWait -
channelNumber - the channel the request came from
queueOut -
Throws:
java.lang.Exception

basicCancel

void basicCancel(java.lang.String consumerTag,
                 int channelNumber)
                 throws java.lang.Exception
Cancel a consumer.

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

exchangeDeclare

void exchangeDeclare(java.lang.String exchange,
                     java.lang.String type,
                     boolean passive,
                     boolean durable,
                     boolean autoDelete,
                     java.util.Map arguments,
                     int ticket,
                     int channelNumber)
                     throws java.lang.Exception
Declare an exchange.

Parameters:
exchange - 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

void exchangeDelete(java.lang.String exchangeName,
                    boolean ifUnused,
                    boolean nowait,
                    int ticket,
                    int channelNumber)
                    throws java.lang.Exception
Delete an exchange

Parameters:
ticket - an access ticket for the appropriate realm
exchange - the name of the exchange
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

java.util.Map getMOMProperties()
Gets MOM properties returned to the client on connection start.

Returns:
a HashMap with some properties describing the MOM (product, copyright, version...)

close

void close()
Closes the MOMHandler


setConsumer

void setConsumer(Consumer consumer)

channelClose

void channelClose(int channelNumber)
                  throws java.lang.Exception
Throws:
java.lang.Exception

connectionClose

void connectionClose()
                     throws java.lang.Exception
Throws:
java.lang.Exception

Joram 5.2.4

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