org.jboss.messaging.core.contract
Interface PostOffice

All Superinterfaces:
MessagingComponent
All Known Implementing Classes:
MessagingPostOffice

public interface PostOffice
extends MessagingComponent

A post office holds bindings of queues to conditions. When routing a reference, the post office routes the reference to any binding whose condition matches the condition specified in the call to route(...) A queue can only be bound with one condition in the post office Each queue must have a unique name and channel ID

Version:
$Revision: 3206 $ $Id: PostOffice.java 3206 2007-10-19 13:33:19Z timfox $
Author:
Tim Fox, Clebert Suconic, Ovidiu Feodorov

Method Summary
 boolean addBinding(Binding binding, boolean allNodes)
          Add a binding to the post office
 java.util.Collection getAllBindings()
          Get all the bindings
 java.util.Collection getAllBindingsForQueueName(java.lang.String queueName)
          Get all bindings with the specified queue name (They will be on different nodes)
 Binding getBindingForChannelID(long channelID)
          Get the binding with the specified channel ID
 Binding getBindingForQueueName(java.lang.String queueName)
          Get the binding with the specified queue name
 java.util.Map getFailoverMap()
          Get the failover map
 java.lang.String getOfficeName()
          Get the name of the post office
 java.util.Collection getQueuesForCondition(Condition condition, boolean localOnly)
          Get all queues that match the condition
 java.util.Map getRecoveryArea(java.lang.String queueName)
           
 int getRecoveryMapSize(java.lang.String queueName)
           
 boolean isClustered()
          Is this post office clustered?
 boolean isFirstNode()
           
 java.util.Set nodeIDView()
          Get a set of nodes in the cluster
 Binding removeBinding(java.lang.String queueName, boolean allNodes)
          Remove a binding from the post office
 boolean route(MessageReference ref, Condition condition, Transaction tx)
          Route a reference.
 void sendReplicateAckMessage(java.lang.String queueName, long messageID)
           
 void sendReplicateDeliveryMessage(java.lang.String queueName, java.lang.String sessionID, long messageID, long deliveryID, boolean reply, boolean sync)
           
 
Methods inherited from interface org.jboss.messaging.core.contract.MessagingComponent
start, stop
 

Method Detail

getOfficeName

java.lang.String getOfficeName()
Get the name of the post office

Returns:
The name of this post office

addBinding

boolean addBinding(Binding binding,
                   boolean allNodes)
                   throws java.lang.Exception
Add a binding to the post office

Parameters:
binding - The binding to add
allNodes - Add this binding on ALL nodes?
Throws:
java.lang.Exception

removeBinding

Binding removeBinding(java.lang.String queueName,
                      boolean allNodes)
                      throws java.lang.Throwable
Remove a binding from the post office

Parameters:
queueName - The queue name that identifies the binding
allNodes - Remove this binding from ALL node?
Throws:
java.lang.Throwable

route

boolean route(MessageReference ref,
              Condition condition,
              Transaction tx)
              throws java.lang.Exception
Route a reference.

Parameters:
condition - - the message will be routed to queue(s) if the specified condition matches the condition of the bindings.
tx - - the transaction or null if not in the context of a transaction.
Returns:
true if reference was accepted by at least one queue.
Throws:
java.lang.Exception

getQueuesForCondition

java.util.Collection getQueuesForCondition(Condition condition,
                                           boolean localOnly)
                                           throws java.lang.Exception
Get all queues that match the condition

Parameters:
condition - The condition
localOnly - Only retrieve local queues ?
Returns:
Throws:
java.lang.Exception

getBindingForQueueName

Binding getBindingForQueueName(java.lang.String queueName)
                               throws java.lang.Exception
Get the binding with the specified queue name

Parameters:
queueName -
Returns:
Throws:
java.lang.Exception

getBindingForChannelID

Binding getBindingForChannelID(long channelID)
                               throws java.lang.Exception
Get the binding with the specified channel ID

Parameters:
channelID -
Returns:
Throws:
java.lang.Exception

getAllBindingsForQueueName

java.util.Collection getAllBindingsForQueueName(java.lang.String queueName)
                                                throws java.lang.Exception
Get all bindings with the specified queue name (They will be on different nodes)

Parameters:
queueName -
Returns:
Throws:
java.lang.Exception

getAllBindings

java.util.Collection getAllBindings()
                                    throws java.lang.Exception
Get all the bindings

Returns:
Throws:
java.lang.Exception

isClustered

boolean isClustered()
Is this post office clustered?

Returns:
true If the post office is clustered

getFailoverMap

java.util.Map getFailoverMap()
Get the failover map

Returns:

nodeIDView

java.util.Set nodeIDView()
Get a set of nodes in the cluster

Returns:

sendReplicateDeliveryMessage

void sendReplicateDeliveryMessage(java.lang.String queueName,
                                  java.lang.String sessionID,
                                  long messageID,
                                  long deliveryID,
                                  boolean reply,
                                  boolean sync)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

sendReplicateAckMessage

void sendReplicateAckMessage(java.lang.String queueName,
                             long messageID)
                             throws java.lang.Exception
Throws:
java.lang.Exception

isFirstNode

boolean isFirstNode()

getRecoveryArea

java.util.Map getRecoveryArea(java.lang.String queueName)

getRecoveryMapSize

int getRecoveryMapSize(java.lang.String queueName)


Copyright © 2006 JBoss Inc. All Rights Reserved.