org.apache.lenya.ac.file
Class FileRoleManager

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

public final class FileRoleManager
extends FileItemManager
implements RoleManager

File-based role manager implementation.

Version:
$Id: FileRoleManager.java 473841 2006-11-12 00:46:38Z gregor $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lenya.ac.file.FileItemManager
FileItemManager.DirectoryChangeNotifier
 
Field Summary
 
Fields inherited from class org.apache.lenya.ac.file.FileItemManager
PATH
 
Constructor Summary
protected FileRoleManager(java.io.File configurationDirectory)
          Return the RoleManager for this configuration directory.
 
Method Summary
 void add(Role role)
          Add a role
 Role getRole(java.lang.String roleId)
          Get the role for the given ID.
 Role[] getRoles()
          Get all roles
protected  java.lang.String getSuffix()
          Returns the file extension to be used.
static FileRoleManager instance(java.io.File configurationDirectory)
          Returns the role manager for this configuration directory.
 void remove(Role role)
          Remove a role
 
Methods inherited from class org.apache.lenya.ac.file.FileItemManager
add, addItemManagerListener, contains, getConfigurationDirectory, getFileFilter, getItem, getItemClass, getItemConfiguration, getItems, loadItem, loadItems, notifyAdded, notifyRemoved, remove, removeItem, removeItemManagerListener, update
 
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, removeItemManagerListener
 

Constructor Detail

FileRoleManager

protected FileRoleManager(java.io.File configurationDirectory)
                   throws AccessControlException
Return the RoleManager for this configuration directory. The RoleManager is a singleton.

Parameters:
configurationDirectory - the directory for which the RoleManager is requested.
Throws:
AccessControlException - if the RoleManager could not be instantiated
Method Detail

instance

public static FileRoleManager instance(java.io.File configurationDirectory)
                                throws AccessControlException
Returns the role manager for this configuration directory.

Parameters:
configurationDirectory - The configuration directory.
Returns:
A role manager.
Throws:
AccessControlException - when something went wrong.

getRole

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

Specified by:
getRole in interface 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 Role[] getRoles()
Get all roles

Specified by:
getRoles in interface RoleManager
Returns:
an array of roles.

add

public void add(Role role)
         throws AccessControlException
Add a role

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

remove

public void remove(Role role)
            throws AccessControlException
Remove a role

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


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.