|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jonas.lib.management.javaee.ManagedObject
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.
| 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 |
|---|
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.management.javaee.ManagedObject |
|---|
getModelMBean, sendNotification, sendReconfigNotification, sendSaveNotification, setModelMBean |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JResourceMemory()
throws Exception
Exception - if super constructor fail| Method Detail |
|---|
public void addUser(User user)
throws Exception
user - the user which need to be added.
Exception - if the user already exists
public void addGroup(Group group)
throws Exception
group - the group which need to be added.
Exception - if the group already exists
public void addRole(Role role)
throws Exception
role - the role which need to be added.
Exception - if the role already exists
public JUser findUser(String name)
throws JResourceException
name - the wanted user name
JResourceException - if there is an error during the search
public boolean isValidUser(JUser user,
String credentials)
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
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 resource
public void addUser(String username,
String password)
throws Exception
username - the name of the userpassword - password of the user
Exception - if the user already exists
public void addGroup(String groupname)
throws Exception
groupname - the name of the group
Exception - if the group already exists
public void addRole(String rolename)
throws Exception
rolename - the name of the role
Exception - if the role already exists
public void removeUser(String username)
throws Exception
username - the name of the user
Exception - if the user was not found
public void removeGroup(String groupname)
throws Exception
groupname - the name of the group
Exception - if the group was not found
public void removeRole(String rolename)
throws Exception
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
NamingException - if a naming exception was encountered while
retrieving the reference.public String[] listRoles()
public String[] listGroups()
public void removeMBeans()
throws JResourceException
JResourceException - if the MBeans can not be removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||