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