org.jboss.mq.sm
Interface StateManager

All Known Implementing Classes:
AbstractStateManager (src) , OldStateManager (src)

public interface StateManager

Interface for StateManager. A StateManager is a manager that manages states that has to do with clients/ users and durable subscription. A state manager most know how to persist information regarding durable subscriptions. It should also hold all current clientID's that are connected to the server. It may also support basic autentication, which is what the old default StateManager did.


Method Summary
 void addLoggedOnClientId(java.lang.String ID)
          Ad a logged in clientID to the statemanager.
 java.lang.String checkUser(java.lang.String login, java.lang.String passwd)
          Check if a user has a preconfigured clientID and return it.
 java.util.Collection getDurableSubscriptionIdsForTopic(SpyTopic (src)  topic)
          Get all configured durable subscriptions for a particular topic.
 SpyTopic (src) getDurableTopic(DurableSubscriptionID (src)  sub)
          Get the destination a subscription is for.
 void removeLoggedOnClientId(java.lang.String ID)
          Remove the logged in clientID.
 void setDurableSubscription(JMSDestinationManager (src)  server, DurableSubscriptionID (src)  sub, SpyTopic (src)  topic)
          Ad, change or delete a durable subsciption.
 

Method Detail

setDurableSubscription

public void setDurableSubscription(JMSDestinationManager (src)  server,
                                   DurableSubscriptionID (src)  sub,
                                   SpyTopic (src)  topic)
                            throws JMSException (src) 
Ad, change or delete a durable subsciption. The contract is that the StateManager, must physically create the durable subscription. And when the method returns the information must be persisted.

Parameters:
server - The JMSServer
sub - The id of the durable subscription
topic - The topic to subscribe durable on, if null the subscription will be removed.
Throws:
JMSException (src) - Description of Exception

getDurableTopic

public SpyTopic (src)  getDurableTopic(DurableSubscriptionID (src)  sub)
                         throws JMSException (src) 
Get the destination a subscription is for.

Throws:
JMSException (src)

checkUser

public java.lang.String checkUser(java.lang.String login,
                                  java.lang.String passwd)
                           throws JMSException (src) 
Check if a user has a preconfigured clientID and return it. If the user has a preconfigured clienID it will be added to the current logged in clientID's and returned. The state manager may also use this method to authenticate a user. If a SecurityManager is installed this is not necesarry.

Parameters:
login - user name
passwd - password
Returns:
a preconfigured clientID.
Throws:
JMSException (src) - if the user
JMSSecurityException - if the clientID is already loged in.

addLoggedOnClientId

public void addLoggedOnClientId(java.lang.String ID)
                         throws JMSException (src) 
Ad a logged in clientID to the statemanager. The clientID must not be active. The StateManager should somehow assure that a clientID that is preconfigured for a user is not allowed to be added this way.

Parameters:
ID - a clientID
Throws:
JMSException (src) - Description of Exception
InvalidClientIDException - if the clientID wass already logged in.

removeLoggedOnClientId

public void removeLoggedOnClientId(java.lang.String ID)
Remove the logged in clientID.

Parameters:
ID - clientID.

getDurableSubscriptionIdsForTopic

public java.util.Collection getDurableSubscriptionIdsForTopic(SpyTopic (src)  topic)
                                                       throws JMSException (src) 
Get all configured durable subscriptions for a particular topic.

Parameters:
topic - the topic.
Returns:
a collection of DurableSubscriptionID
Throws:
JMSException (src) - Description of Exception