org.apache.lenya.ac.file
Class FileRoleManager

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.ac.file.FileItemManager
          extended by org.apache.lenya.ac.file.FileRoleManager
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, org.apache.lenya.ac.ItemManager, org.apache.lenya.ac.RoleManager

public final class FileRoleManager
extends FileItemManager
implements org.apache.lenya.ac.RoleManager

File-based role manager implementation.

Version:
$Id: FileRoleManager.java 485769 2006-12-11 17:41:23Z andreas $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lenya.ac.file.FileItemManager
FileItemManager.DirectoryChangeNotifier
 
Field Summary
protected static java.lang.String SUFFIX
           
 
Constructor Summary
protected FileRoleManager(org.apache.lenya.ac.AccreditableManager mgr)
          Return the RoleManager for this configuration directory.
 
Method Summary
 void add(org.apache.lenya.ac.Role role)
          Add a role
protected  org.apache.lenya.ac.Item createItem()
           
 org.apache.lenya.ac.Role getRole(java.lang.String roleId)
          Get the role for the given ID.
 org.apache.lenya.ac.Role[] getRoles()
          Get all roles
protected  java.lang.String getSuffix()
          Returns the file extension to be used.
static FileRoleManager instance(org.apache.lenya.ac.AccreditableManager mgr, java.io.File configurationDirectory, org.apache.avalon.framework.logger.Logger logger)
          Returns the role manager for this configuration directory.
 void remove(org.apache.lenya.ac.Role role)
          Remove a role
 
Methods inherited from class org.apache.lenya.ac.file.FileItemManager
add, addItemManagerListener, configure, contains, getAccreditableManager, getConfigurationDirectory, getFileFilter, getItem, getItemConfiguration, getItems, loadItem, loadItems, notifyAdded, notifyRemoved, remove, removeItem, removeItemManagerListener, update
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.lenya.ac.ItemManager
addItemManagerListener, getAccreditableManager, removeItemManagerListener
 

Field Detail

SUFFIX

protected static final java.lang.String SUFFIX
See Also:
Constant Field Values
Constructor Detail

FileRoleManager

protected FileRoleManager(org.apache.lenya.ac.AccreditableManager mgr)
Return the RoleManager for this configuration directory. The RoleManager is a singleton.

Parameters:
mgr - The accreditable manager.
Method Detail

instance

public static FileRoleManager instance(org.apache.lenya.ac.AccreditableManager mgr,
                                       java.io.File configurationDirectory,
                                       org.apache.avalon.framework.logger.Logger logger)
                                throws org.apache.lenya.ac.AccessControlException
Returns the role manager for this configuration directory.

Parameters:
mgr - The accreditable manager.
configurationDirectory - The configuration directory.
logger - The logger.
Returns:
A role manager.
Throws:
org.apache.lenya.ac.AccessControlException - when something went wrong.

getRole

public org.apache.lenya.ac.Role getRole(java.lang.String roleId)
Get the role for the given ID.

Specified by:
getRole in interface org.apache.lenya.ac.RoleManager
Parameters:
roleId - The name of the role requested.
Returns:
a Role or null if no role with the given name found

getSuffix

protected java.lang.String getSuffix()
Description copied from class: FileItemManager
Returns the file extension to be used.

Specified by:
getSuffix in class FileItemManager
Returns:
A string.
See Also:
FileItemManager.getSuffix()

getRoles

public org.apache.lenya.ac.Role[] getRoles()
Get all roles

Specified by:
getRoles in interface org.apache.lenya.ac.RoleManager
Returns:
an array of roles.

add

public void add(org.apache.lenya.ac.Role role)
         throws org.apache.lenya.ac.AccessControlException
Add a role

Specified by:
add in interface org.apache.lenya.ac.RoleManager
Parameters:
role - The role to add.
Throws:
org.apache.lenya.ac.AccessControlException - if an error occurs.

remove

public void remove(org.apache.lenya.ac.Role role)
            throws org.apache.lenya.ac.AccessControlException
Remove a role

Specified by:
remove in interface org.apache.lenya.ac.RoleManager
Parameters:
role - The role to remove.
Throws:
org.apache.lenya.ac.AccessControlException - if an error occurs.

createItem

protected org.apache.lenya.ac.Item createItem()


Copyright © $ Apache Software Foundation. All Rights Reserved.