站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 messaging API Documentation 英文版文档

StateManager (JBoss Messaging API) - JBoss 4.0.1 sp1 messaging API Documentation 英文版文档


org.jboss.mq.sm
Interface StateManager

All Known Implementing Classes:
AbstractStateManager, OldStateManager

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.

Version:
$Revision: 1.4 $
Author:
Peter Antman, Norbert Lataille, Hiram Chirino

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

Method Detail

setDurableSubscription

public void setDurableSubscription(JMSDestinationManager server,
                                   DurableSubscriptionID sub,
                                   SpyTopic topic)
                            throws javax.jms.JMSException
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:
javax.jms.JMSException - Description of Exception

getDurableTopic

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

Throws:
javax.jms.JMSException

checkUser

public String checkUser(String login,
                        String passwd)
                 throws javax.jms.JMSException
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:
javax.jms.JMSException - if the user
JMSSecurityException - if the clientID is already loged in.

addLoggedOnClientId

public void addLoggedOnClientId(String ID)
                         throws javax.jms.JMSException
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:
javax.jms.JMSException - Description of Exception
InvalidClientIDException - if the clientID wass already logged in.

removeLoggedOnClientId

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

Parameters:
ID - clientID.

getDurableSubscriptionIdsForTopic

public Collection getDurableSubscriptionIdsForTopic(SpyTopic topic)
                                             throws javax.jms.JMSException
Get all configured durable subscriptions for a particular topic.

Parameters:
topic - the topic.
Returns:
a collection of DurableSubscriptionID
Throws:
javax.jms.JMSException - Description of Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.