org.ow2.jonas.security.realm.factory
Interface JResource

All Known Implementing Classes:
AbstractJResource, JResourceDS, JResourceLDAP, JResourceMemory

public interface JResource

This interface represents JOnAS realm factory objects.

Author:
Guillaume Sauthier

Method Summary
 void clearCache()
          Clear the cache.
 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.
 String getName()
          Get the name of this resource.
 Reference getReference()
          Retrieves the Reference of the object.
 Hashtable<String,JUser> getUsers()
          Return users.
 boolean isValidUser(JUser user, String credentials)
          Check if the given credential is the right credential for the given user.
 void removeMBeans()
          Remove all the Mbeans used by this resource.
 void setDomainName(String domain)
          Set the domain name
 void setJmxService(JmxService jmxService)
          Set the jmx service reference
 void setName(String name)
          Set the name of this resource.
 void setSecurityService(SecurityService sec)
          Set the security service reference
 void setUsers(Hashtable<String,JUser> users)
           
 

Method Detail

setName

void setName(String name)
Set the name of this resource.

Parameters:
name - Name of the resource

getName

String getName()
Get the name of this resource.

Returns:
the name of this resource

setJmxService

void setJmxService(JmxService jmxService)
Set the jmx service reference

Parameters:
jmxService - the jmx service reference

setDomainName

void setDomainName(String domain)
Set the domain name

Parameters:
domain - the domain name

setSecurityService

void setSecurityService(SecurityService sec)
Set the security service reference

Parameters:
sec - security service reference

getReference

Reference getReference()
                       throws NamingException
Retrieves the Reference of the object. The Reference contains the factory used to create this object and the optional parameters used to configure the factory.

Returns:
the non-null Reference of the object.
Throws:
NamingException - if a naming exception was encountered while retrieving the reference.

removeMBeans

void removeMBeans()
                  throws JResourceException
Remove all the Mbeans used by this resource.

Throws:
JResourceException - if the MBeans can not be removed

findUser

JUser findUser(String name)
               throws JResourceException
Check if a user is found and return it.

Parameters:
name - the wanted user name
Returns:
the user found or null
Throws:
JResourceException - if there is an error during the search

isValidUser

boolean isValidUser(JUser user,
                    String credentials)
Check if the given credential is the right credential for the given user.

Parameters:
user - user to check its credentials
credentials - the given credentials
Returns:
true if the credential is valid for this user

getArrayListCombinedRoles

ArrayList<String> getArrayListCombinedRoles(JUser user)
                                            throws JResourceException
Get all the roles (from the roles and from the groups) of the given user.

Parameters:
user - the given user
Returns:
the array list of all the roles for a given user
Throws:
JResourceException - if it fails

getUsers

Hashtable<String,JUser> getUsers()
Return users.

Returns:
Return users

setUsers

void setUsers(Hashtable<String,JUser> users)
Parameters:
users - The users to set.

clearCache

void clearCache()
Clear the cache.



Copyright © 2010 OW2 Consortium. All Rights Reserved.