|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.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. |
org.ow2.jonas.security.realm.principal.JUser |
findUser(String name)
Check if a user is found and return it. |
ArrayList<String> |
getArrayListCombinedRoles(org.ow2.jonas.security.realm.principal.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(org.ow2.jonas.security.realm.principal.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 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 org.ow2.jonas.security.realm.principal.JUser findUser(String name)
throws org.ow2.jonas.security.realm.factory.JResourceException
findUser in interface org.ow2.jonas.security.realm.factory.JResourcename - the wanted user name
org.ow2.jonas.security.realm.factory.JResourceException - if there is an error during the search
public boolean isValidUser(org.ow2.jonas.security.realm.principal.JUser user,
String credentials)
isValidUser in interface org.ow2.jonas.security.realm.factory.JResourceuser - user to check its credentialscredentials - the given credentials
public Hashtable<String,Group> getGroups()
public Hashtable<String,Role> getRoles()
public ArrayList<String> getArrayListCombinedRoles(org.ow2.jonas.security.realm.principal.JUser user)
throws org.ow2.jonas.security.realm.factory.JResourceException
getArrayListCombinedRoles in interface org.ow2.jonas.security.realm.factory.JResourceuser - the given user
org.ow2.jonas.security.realm.factory.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
addUser in interface JResourceMemoryMBeanusername - the name of the userpassword - password of the user
Exception - if the user already exists
public void addGroup(String groupname)
throws Exception
addGroup in interface JResourceMemoryMBeangroupname - the name of the group
Exception - if the group already exists
public void addRole(String rolename)
throws Exception
addRole in interface JResourceMemoryMBeanrolename - the name of the role
Exception - if the role already exists
public void removeUser(String username)
throws Exception
removeUser in interface JResourceMemoryMBeanusername - the name of the user
Exception - if the user was not found
public void removeGroup(String groupname)
throws Exception
removeGroup in interface JResourceMemoryMBeangroupname - the name of the group
Exception - if the group was not found
public void removeRole(String rolename)
throws Exception
removeRole in interface JResourceMemoryMBeanrolename - 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 ReferenceablegetReference in interface org.ow2.jonas.security.realm.factory.JResourceNamingException - if a naming exception was encountered while
retrieving the reference.public String[] listRoles()
listRoles in interface JResourceMemoryMBeanpublic String[] listGroups()
listGroups in interface JResourceMemoryMBean
public void removeMBeans()
throws org.ow2.jonas.security.realm.factory.JResourceException
removeMBeans in interface org.ow2.jonas.security.realm.factory.JResourceorg.ow2.jonas.security.realm.factory.JResourceException - if the MBeans can not be removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||