org.objectweb.jonas.security.realm.factory
Class AbstractJResource

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.objectweb.jonas.management.reconfig.emitter.ReconfigEmitter
          extended by org.objectweb.jonas.security.realm.factory.AbstractJResource
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Referenceable, JResource, JResourceMBean
Direct Known Subclasses:
JResourceDS, JResourceLDAP, JResourceMemory

public abstract class AbstractJResource
extends ReconfigEmitter
implements Serializable, Referenceable, JResourceMBean, JResource

This class implements JOnAS realm factory objects. It is build from an xml file by the security service of JOnAS.

Author:
Florent Benoit
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jonas.management.reconfig.emitter.ReconfigEmitter
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
AbstractJResource()
          Constructor.
 
Method Summary
 void addNotificationListener(NotificationListener arg0, NotificationFilter arg1, Object arg2)
          Allows for listener objects to receive notifications emitted by this resource.
 void clearCache()
          Clear the cache
static org.objectweb.util.monolog.api.Logger getLogger()
           
 String getName()
          Get the name of this resource
protected  long getSequenceNumber()
          Return a sequence number and increase this number.
 Hashtable getUsers()
          Return users
protected  void registerGroupMBean(Group group)
          Create and register an MBean for the group
protected  void registerMBean(Object mbean, ObjectName on)
          Allows the resource to register associated MBeans.
protected  void registerRoleMBean(Role role)
          Create and register an MBean for this role
protected  void registerUserMBean(User user)
          Create and register an MBean for the user.
 void saveConfig()
          Save the resource configuration.
static void setLogger(org.objectweb.util.monolog.api.Logger logger)
           
 void setName(String name)
          Set the name of this resource
 void setUsers(Hashtable users)
           
protected  void unregisterGroupMBean(String resourceName, String groupName)
          Unregister MBean associated to a group
protected  void unregisterMBean(ObjectName on)
          Allows the resource to unregister associated MBeans.
protected  void unregisterRoleMBean(String resourceName, String roleName)
           
protected  void unregisterUserMBean(String resourceName, String userName)
          Unregister MBean associated to a user.
 
Methods inherited from class org.objectweb.jonas.management.reconfig.emitter.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, toString, wait, wait, wait
 
Methods inherited from interface javax.naming.Referenceable
getReference
 
Methods inherited from interface org.objectweb.jonas.security.realm.factory.JResource
findUser, getArrayListCombinedRoles, getReference, isValidUser, removeMBeans
 

Constructor Detail

AbstractJResource

public AbstractJResource()
                  throws Exception
Constructor.

Throws:
Exception - if a service can't be retrieved
Method Detail

setName

public void setName(String name)
Description copied from interface: JResource
Set the name of this resource

Specified by:
setName in interface JResource
Parameters:
name - the resource (realm) name

getName

public String getName()
Description copied from interface: JResource
Get the name of this resource

Specified by:
getName in interface JResource
Specified by:
getName in interface JResourceMBean
Returns:
the resource (realm) name

getUsers

public Hashtable getUsers()
Description copied from interface: JResource
Return users

Specified by:
getUsers in interface JResource
Returns:
the users table

getSequenceNumber

protected long getSequenceNumber()
Return a sequence number and increase this number.

Returns:
a sequence number

saveConfig

public void saveConfig()
Save the resource configuration.

Specified by:
saveConfig in interface JResourceMBean

getLogger

public static org.objectweb.util.monolog.api.Logger getLogger()
Returns:
Returns the logger.

setLogger

public static void setLogger(org.objectweb.util.monolog.api.Logger logger)
Parameters:
logger - The logger to set.

setUsers

public void setUsers(Hashtable users)
Specified by:
setUsers in interface JResource
Parameters:
users - the users table

clearCache

public void clearCache()
Description copied from interface: JResource
Clear the cache

Specified by:
clearCache in interface JResource

addNotificationListener

public void addNotificationListener(NotificationListener arg0,
                                    NotificationFilter arg1,
                                    Object arg2)
Allows for listener objects to receive notifications emitted by this resource.

Specified by:
addNotificationListener in interface NotificationBroadcaster
Overrides:
addNotificationListener in class NotificationBroadcasterSupport
Parameters:
arg0 - listener object
arg1 - notification filter
arg2 - handback object

registerUserMBean

protected void registerUserMBean(User user)
                          throws MalformedObjectNameException
Create and register an MBean for the user.

Parameters:
user - the user to be managed
Throws:
MalformedObjectNameException - if we could not construct ObjectName for the user

unregisterUserMBean

protected void unregisterUserMBean(String resourceName,
                                   String userName)
                            throws MalformedObjectNameException
Unregister MBean associated to a user.

Parameters:
resourceName -
userName -
Throws:
MalformedObjectNameException - if MBean is not unregistered

registerGroupMBean

protected void registerGroupMBean(Group group)
                           throws MalformedObjectNameException
Create and register an MBean for the group

Parameters:
group - the group to be managed
Throws:
MalformedObjectNameException - if MBean is not created

unregisterGroupMBean

protected void unregisterGroupMBean(String resourceName,
                                    String groupName)
                             throws MalformedObjectNameException
Unregister MBean associated to a group

Parameters:
resourceName -
groupName -
Throws:
MalformedObjectNameException - could not construct ObjectName for the user

registerRoleMBean

protected void registerRoleMBean(Role role)
                          throws MalformedObjectNameException
Create and register an MBean for this role

Parameters:
role - the role to be managed
Throws:
MalformedObjectNameException - not construct ObjectName for this role

unregisterRoleMBean

protected void unregisterRoleMBean(String resourceName,
                                   String roleName)
                            throws MalformedObjectNameException
Parameters:
resourceName -
roleName -
Throws:
MalformedObjectNameException - could not construct ObjectName for this role

registerMBean

protected void registerMBean(Object mbean,
                             ObjectName on)
Allows the resource to register associated MBeans.

Parameters:
mbean - MBean to register
on - MBean's ObjectName

unregisterMBean

protected void unregisterMBean(ObjectName on)
Allows the resource to unregister associated MBeans.

Parameters:
on - MBean's ObjectName


Copyright © 2007 OW2 Consortium. All Rights Reserved.