|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport org.jboss.mq.sm.AbstractStateManager org.jboss.mq.sm.file.DynamicStateManager
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:
Nested Class Summary |
Nested classes inherited from class org.jboss.mq.sm.AbstractStateManager |
AbstractStateManager.DurableSubscription |
Field Summary |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
DynamicStateManager()
|
Method Summary | |
void |
addRole(String name)
|
void |
addUser(String name,
String password,
String preconfID)
|
void |
addUserToRole(String roleName,
String user)
|
protected void |
checkLoggedOnClientId(String clientID)
Check if the clientID belonges to a preconfigured user. |
protected void |
createService()
|
String |
displayStateConfig()
Show the current configuration. |
protected XElement |
findRole(String role)
|
protected XElement |
findUser(String user)
|
protected XElement |
findUserInRole(XElement role,
String user)
|
protected AbstractStateManager.DurableSubscription |
getDurableSubscription(DurableSubscriptionID sub)
Search for a configurated durable subscription. |
Collection |
getDurableSubscriptionIdsForTopic(SpyTopic topic)
Get all configured durable subscriptions for a particular topic. |
StateManager |
getInstance()
Get an instance if the StateManager (Singleton). |
protected String |
getPreconfClientId(String login,
String passwd)
Return preconfigured client id. |
String[] |
getRoles(String user)
We currently only support one Group type Roles. |
String |
getStateFile()
Get name of file. |
boolean |
hasSecurityManager()
|
void |
loadConfig()
|
protected void |
removeDurableSubscription(AbstractStateManager.DurableSubscription ds)
Remove the subscription and save to persistent storage. |
void |
removeRole(String name)
|
void |
removeUser(String name)
|
void |
removeUserFromRole(String roleName,
String user)
|
void |
saveConfig()
|
protected void |
saveDurableSubscription(AbstractStateManager.DurableSubscription ds)
Add to durable subs and save the subsrcription to persistent storage. |
void |
setHasSecurityManager(boolean hasSecurityManager)
|
void |
setStateFile(String newStateFile)
Set the name of the statefile. |
void |
startService()
|
boolean |
validatePassword(String user,
String inputPassword)
Validate the user/password combination. |
Methods inherited from class org.jboss.mq.sm.AbstractStateManager |
addLoggedOnClientId, checkUser, getDurableTopic, removeLoggedOnClientId, setDurableSubscription |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
create, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop, stopService |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.system.ServiceMBean |
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
create, destroy, start, stop |
Constructor Detail |
public DynamicStateManager()
Method Detail |
public StateManager getInstance()
AbstractStateManagerMBean
getInstance
in interface AbstractStateManagerMBean
protected void createService() throws Exception
Exception
public void startService() throws Exception
Exception
public String displayStateConfig() throws Exception
Exception
public void setStateFile(String newStateFile)
setStateFile
in interface DynamicStateManagerMBean
newStateFile
- java.lang.Stringpublic String getStateFile()
getStateFile
in interface DynamicStateManagerMBean
public boolean hasSecurityManager()
hasSecurityManager
in interface DynamicStateManagerMBean
public void setHasSecurityManager(boolean hasSecurityManager)
setHasSecurityManager
in interface DynamicStateManagerMBean
public void loadConfig() throws IOException, XElementException
loadConfig
in interface DynamicStateManagerMBean
IOException
XElementException
public void saveConfig() throws IOException
saveConfig
in interface DynamicStateManagerMBean
IOException
protected String getPreconfClientId(String login, String passwd) throws javax.jms.JMSException
getPreconfClientId
in class AbstractStateManager
login
- the user namepasswd
- the password
javax.jms.JMSException
- for any errorprotected AbstractStateManager.DurableSubscription getDurableSubscription(DurableSubscriptionID sub) throws javax.jms.JMSException
getDurableSubscription
in class AbstractStateManager
sub
- the durable subscription id
javax.jms.JMSException
- for any errorprotected void checkLoggedOnClientId(String clientID) throws javax.jms.JMSException
checkLoggedOnClientId
in class AbstractStateManager
clientID
- the client id to check
javax.jms.JMSException
- for any errorprotected void saveDurableSubscription(AbstractStateManager.DurableSubscription ds) throws javax.jms.JMSException
AbstractStateManager
Called by this class so the sublclass can save. This may be both a new subscription or a changed one. It is up to the sublcass to know how to find a changed on. (Only the topic will have changed, and it is the same DurableSubscription that is saved again that this class got through getDurableSubscription.
saveDurableSubscription
in class AbstractStateManager
ds
- the durable subscription to save
javax.jms.JMSException
- for any errorprotected void removeDurableSubscription(AbstractStateManager.DurableSubscription ds) throws javax.jms.JMSException
AbstractStateManager
Called by this class so the sublclass can remove.
removeDurableSubscription
in class AbstractStateManager
ds
- the durable subscription to save
javax.jms.JMSException
- for any errorpublic Collection getDurableSubscriptionIdsForTopic(SpyTopic topic) throws javax.jms.JMSException
StateManager
getDurableSubscriptionIdsForTopic
in interface StateManager
getDurableSubscriptionIdsForTopic
in class AbstractStateManager
javax.jms.JMSException
public void addUser(String name, String password, String preconfID) throws Exception
addUser
in interface DynamicStateManagerMBean
Exception
public void removeUser(String name) throws Exception
removeUser
in interface DynamicStateManagerMBean
Exception
public void addRole(String name) throws Exception
addRole
in interface DynamicStateManagerMBean
Exception
public void removeRole(String name) throws Exception
removeRole
in interface DynamicStateManagerMBean
Exception
public void addUserToRole(String roleName, String user) throws Exception
addUserToRole
in interface DynamicStateManagerMBean
Exception
public void removeUserFromRole(String roleName, String user) throws Exception
removeUserFromRole
in interface DynamicStateManagerMBean
Exception
protected XElement findUser(String user) throws Exception
Exception
protected XElement findRole(String role) throws Exception
Exception
protected XElement findUserInRole(XElement role, String user) throws Exception
Exception
public String[] getRoles(String user) throws Exception
Exception
public boolean validatePassword(String user, String inputPassword) throws Exception
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |