|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.NotificationBroadcasterSupport org.objectweb.jonas.management.ReconfigDispatcher org.objectweb.jonas.security.realm.factory.JResource org.objectweb.jonas.security.realm.factory.JResourceMemory
public class JResourceMemory
This class extends the JResource class for the Memory implementation.
Field Summary |
---|
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher |
---|
RECONFIG_TYPE, SAVE_RECONFIG_TYPE |
Constructor Summary | |
---|---|
JResourceMemory()
Constructor . |
Method Summary | |
---|---|
void |
addGroup(Group group)
Add a group to this resource. |
void |
addGroup(java.lang.String groupname)
Add a group with a given name |
void |
addRole(Role role)
Add a role to this resource. |
void |
addRole(java.lang.String rolename)
Add a role with a given name |
void |
addUser(java.lang.String username,
java.lang.String password)
Add a user with a given principal and credential |
void |
addUser(User user)
Add a user to this resource. |
User |
findUser(java.lang.String name)
Check if a user is found and return it |
java.util.ArrayList |
getArrayListCombinedRoles(User user)
Get all the roles (from the roles and from the groups) of the given user |
java.util.Hashtable |
getGroups()
Return all the groups |
javax.naming.Reference |
getReference()
Retrieves the Reference of the object. |
java.util.Hashtable |
getRoles()
Return all the roles |
boolean |
isValidUser(User user,
java.lang.String credentials)
Check if the given credential is the right credential for the given user |
java.lang.String[] |
listGroups()
Get the groups |
java.lang.String[] |
listRoles()
Get the roles |
void |
removeGroup(java.lang.String groupname)
Remove a group with a given name |
void |
removeMBeans()
Remove all the Mbeans used by this resource |
void |
removeRole(java.lang.String rolename)
Remove a role with a given name |
void |
removeUser(java.lang.String username)
Remove a user with a given principal |
void |
setGroups(java.util.Hashtable groups)
Set the groups |
void |
setRoles(java.util.Hashtable roles)
Set the roles |
java.lang.String |
toString()
The string representation of this realm is the XML |
java.lang.String |
toXML()
String representation of the MemoryRealm |
Methods inherited from class org.objectweb.jonas.security.realm.factory.JResource |
---|
clearCache, getLogger, getMBeanServer, getName, getSequenceNumber, getUsers, saveConfig, setLogger, setName, setUsers |
Methods inherited from class org.objectweb.jonas.management.ReconfigDispatcher |
---|
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
---|
handleNotification, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.objectweb.jonas.security.realm.factory.JResourceMBean |
---|
getName, saveConfig |
Constructor Detail |
---|
public JResourceMemory() throws java.lang.Exception
java.lang.Exception
- if super constructor failMethod Detail |
---|
public void addUser(User user) throws java.lang.Exception
user
- the user which need to be added.
java.lang.Exception
- if the user already existspublic void addGroup(Group group) throws java.lang.Exception
group
- the group which need to be added.
java.lang.Exception
- if the group already existspublic void addRole(Role role) throws java.lang.Exception
role
- the role which need to be added.
java.lang.Exception
- if the role already existspublic User findUser(java.lang.String name) throws JResourceException
findUser
in class JResource
name
- the wanted user name
JResourceException
- if there is an error during the searchpublic boolean isValidUser(User user, java.lang.String credentials)
isValidUser
in class JResource
user
- user to check its credentialscredentials
- the given credentials
public java.util.Hashtable getGroups()
public java.util.Hashtable getRoles()
public java.util.ArrayList getArrayListCombinedRoles(User user) throws JResourceException
getArrayListCombinedRoles
in class JResource
user
- the given user
JResourceException
- if it failspublic void setGroups(java.util.Hashtable groups)
groups
- the groups of this resourcepublic void setRoles(java.util.Hashtable roles)
roles
- the roles of this resourcepublic void addUser(java.lang.String username, java.lang.String password) throws java.lang.Exception
addUser
in interface JResourceMemoryMBean
username
- the name of the userpassword
- password of the user
java.lang.Exception
- if the user already existspublic void addGroup(java.lang.String groupname) throws java.lang.Exception
addGroup
in interface JResourceMemoryMBean
groupname
- the name of the group
java.lang.Exception
- if the group already existspublic void addRole(java.lang.String rolename) throws java.lang.Exception
addRole
in interface JResourceMemoryMBean
rolename
- the name of the role
java.lang.Exception
- if the role already existspublic void removeUser(java.lang.String username) throws java.lang.Exception
removeUser
in interface JResourceMemoryMBean
username
- the name of the user
java.lang.Exception
- if the user was not foundpublic void removeGroup(java.lang.String groupname) throws java.lang.Exception
removeGroup
in interface JResourceMemoryMBean
groupname
- the name of the group
java.lang.Exception
- if the group was not foundpublic void removeRole(java.lang.String rolename) throws java.lang.Exception
removeRole
in interface JResourceMemoryMBean
rolename
- the name of the role
java.lang.Exception
- if the role was not foundpublic java.lang.String toXML()
public java.lang.String toString()
toString
in class java.lang.Object
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
getReference
in class JResource
javax.naming.NamingException
- if a naming exception was encountered while
retrieving the reference.public java.lang.String[] listRoles()
listRoles
in interface JResourceMemoryMBean
public java.lang.String[] listGroups()
listGroups
in interface JResourceMemoryMBean
public void removeMBeans() throws JResourceException
removeMBeans
in class JResource
JResourceException
- if the MBeans can not be removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |