Save This Page
Home » JBoss-5.1.0 » org » jboss » mq » sm » file » [javadoc | source]
org.jboss.mq.sm.file
public class: DynamicStateManager [javadoc | source]
java.lang.Object
   org.jboss.mx.util.JBossNotificationBroadcasterSupport
      org.jboss.system.ServiceMBeanSupport
         org.jboss.mq.sm.AbstractStateManager
            org.jboss.mq.sm.file.DynamicStateManager

All Implemented Interfaces:
    DynamicStateManagerMBean, StateManager, AbstractStateManagerMBean, KernelControllerContextAware, ServiceMBean, MBeanRegistration, NotificationEmitter

A state manager that allowed durable subscriptions to be dynamically created if configured to support it. Otherwise backward compatible with the old StateManager.

Backed by an XML file.

Example file format:

<StateManager> <Users> <User> <Name>john</Name> <Password>needle</Password> <Id>DurableSubscriberExample</Id><!-- optional --> </User> </Users> <Roles> <Role name="guest"> <UserName>john</UserName> </Role> </Roles> <DurableSubscriptions> <DurableSubscription> <ClientID>needle</ClientID> <Name>myDurableSub</Name> <TopicName>TestTopic...</TopicName> </DurableSubscription> </DurableSubscriptions> </StateManager>
Nested Class Summary:
class  DynamicStateManager.DynamicDurableSubscription   
Field Summary
 boolean hasSecurityManager    Do we have a security manager. By setting this to false, we may emulate the old behaviour of the state manager and let it autenticate connections. 
 XElement stateConfig     
Fields inherited from org.jboss.system.ServiceMBeanSupport:
SERVICE_CONTROLLER_SIG,  log,  server,  serviceName
Constructor:
 public DynamicStateManager() 
Method from org.jboss.mq.sm.file.DynamicStateManager Summary:
addRole,   addUser,   addUserToRole,   checkLoggedOnClientId,   createService,   displayStateConfig,   findRole,   findUser,   findUserInRole,   getDurableSubscription,   getDurableSubscriptionIdsForTopic,   getInstance,   getPreconfClientId,   getRoles,   getStateFile,   hasSecurityManager,   loadConfig,   removeDurableSubscription,   removeRole,   removeUser,   removeUserFromRole,   saveConfig,   saveDurableSubscription,   setHasSecurityManager,   setStateFile,   startService,   validatePassword
Methods from org.jboss.mq.sm.AbstractStateManager:
addLoggedOnClientId,   checkLoggedOnClientId,   checkUser,   getDurableSubscription,   getDurableSubscriptionIdsForTopic,   getDurableTopic,   getPreconfClientId,   removeDurableSubscription,   removeLoggedOnClientId,   saveDurableSubscription,   setDurableSubscription
Methods from org.jboss.system.ServiceMBeanSupport:
create,   createService,   destroy,   destroyService,   getDeploymentInfo,   getLog,   getName,   getNextNotificationSequenceNumber,   getObjectName,   getServer,   getServiceName,   getState,   getStateString,   jbossInternalCreate,   jbossInternalDescription,   jbossInternalDestroy,   jbossInternalLifecycle,   jbossInternalStart,   jbossInternalStop,   pojoChange,   pojoCreate,   pojoDestroy,   pojoStart,   pojoStop,   postDeregister,   postRegister,   preDeregister,   preRegister,   setKernelControllerContext,   start,   startService,   stop,   stopService,   unsetKernelControllerContext
Methods from org.jboss.mx.util.JBossNotificationBroadcasterSupport:
addNotificationListener,   getNotificationInfo,   handleNotification,   nextNotificationSequenceNumber,   removeNotificationListener,   removeNotificationListener,   sendNotification
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.mq.sm.file.DynamicStateManager Detail:
 public  void addRole(String name) throws Exception 
 public  void addUser(String name,
    String password,
    String preconfID) throws Exception 
 public  void addUserToRole(String roleName,
    String user) throws Exception 
 protected  void checkLoggedOnClientId(String clientID) throws JMSException 
    Check if the clientID belonges to a preconfigured user. If this is the case, a InvalidClientIDException will be raised.
 protected  void createService() throws Exception 
 public String displayStateConfig() throws Exception 
    Show the current configuration.
 protected XElement findRole(String role) throws Exception 
 protected XElement findUser(String user) throws Exception 
 protected XElement findUserInRole(XElement role,
    String user) throws Exception 
 protected DurableSubscription getDurableSubscription(DurableSubscriptionID sub) throws JMSException 
    Search for a configurated durable subscription.
 public Collection getDurableSubscriptionIdsForTopic(SpyTopic topic) throws JMSException 
 public StateManager getInstance() 
 protected String getPreconfClientId(String login,
    String passwd) throws JMSException 
    Return preconfigured client id. Only if hasSecurityManager is false will a password be required to get the clientID and will the method throw a JMSSecurityException if the clientID was not found.
 public String[] getRoles(String user) throws Exception 
    We currently only support one Group type Roles. The role named returned should typically be put into a Roles Group principal.
 public String getStateFile() 
    Get name of file.
 public boolean hasSecurityManager() 
 public  void loadConfig() throws IOException, XElementException 
 protected  void removeDurableSubscription(DurableSubscription ds) throws JMSException 
 public  void removeRole(String name) throws Exception 
 public  void removeUser(String name) throws Exception 
 public  void removeUserFromRole(String roleName,
    String user) throws Exception 
 public  void saveConfig() throws IOException 
 protected  void saveDurableSubscription(DurableSubscription ds) throws JMSException 
 public  void setHasSecurityManager(boolean hasSecurityManager) 
 public  void setStateFile(String newStateFile) 
    Set the name of the statefile.
 public  void startService() throws Exception 
 public boolean validatePassword(String user,
    String inputPassword) throws Exception 
    Validate the user/password combination. A null inputPassword will allways reurn false.