com.ecyrd.jspwiki.auth.authorize
Interface GroupManager

All Superinterfaces:
Authorizer
All Known Implementing Classes:
DefaultGroupManager, UserManager.DummyGroupManager

public interface GroupManager
extends Authorizer

Specifies how to add, remove, and persist groups to an external group management entity.

Since:
2.3
Version:
$Revision: 1.6 $
Author:
Andrew Jaquith

Field Summary
static String PROP_GROUPMANAGER
          Property name for the manager class in jspwiki.properties.
 
Method Summary
 void add(Group group)
          Adds a Group to the group cache.
 void addWikiEventListener(WikiEventListener listener)
          Registers a WikiEventListener with this GroupManager.
 void commit()
          Commits the groups to persistent storage.
 boolean exists(Group group)
          Returns true if a Group is known to the GroupManager (contained in the group cache), false otherwise.
 void initialize(WikiEngine engine, Properties props)
          Initializes the authorizer.
 void reload()
          Reloads the group cache from persistent storage.
 void remove(Group group)
          Removes a Group from the group cache.
 void removeWikiEventListener(WikiEventListener listener)
          Un-registers a WikiEventListener with this GroupManager.
 
Methods inherited from interface com.ecyrd.jspwiki.auth.Authorizer
findRole, getRoles, isUserInRole
 

Field Detail

PROP_GROUPMANAGER

static final String PROP_GROUPMANAGER
Property name for the manager class in jspwiki.properties.

See Also:
Constant Field Values
Method Detail

initialize

void initialize(WikiEngine engine,
                Properties props)
Description copied from interface: Authorizer
Initializes the authorizer.

Specified by:
initialize in interface Authorizer
Parameters:
engine - the current wiki engine
props - the wiki engine initialization properties

add

void add(Group group)
Adds a Group to the group cache. Note that this method fail, and will throw an IllegalArgumentException, if the proposed group is the same name as one of the built-in Roles: e.g., Admin, Authenticated, etc. When a Group is added successfully, the GroupManager implementation should send a WikiSecurityEvent of type WikiSecurityEvent.GROUP_ADD to all of its registered WikiEventListeners. It should also register itself as a WikiEventListener for the Group itself, so that additions to the group can be detected and forwarded on to the GroupManager's own listeners.

Parameters:
group - the Group to add

addWikiEventListener

void addWikiEventListener(WikiEventListener listener)
Registers a WikiEventListener with this GroupManager.

Parameters:
listener - the event listener

remove

void remove(Group group)
Removes a Group from the group cache. When a Group is removed successfully, the GroupManager implementation should send a WikiSecurityEvent of type WikiSecurityEvent.GROUP_REMOVE to all of its registered WikiEventListeners.

Parameters:
group - the group to remove

exists

boolean exists(Group group)
Returns true if a Group is known to the GroupManager (contained in the group cache), false otherwise.


commit

void commit()
            throws WikiException
Commits the groups to persistent storage.

Throws:
WikiException

reload

void reload()
Reloads the group cache from persistent storage. If this requires all groups in the cache to be flushed, the implementing class should send a WikiSecurityEvent of type WikiSecurityEvent.GROUP_CLEAR_GROUPS to all of its registered WikiEventListeners.


removeWikiEventListener

void removeWikiEventListener(WikiEventListener listener)
Un-registers a WikiEventListener with this GroupManager.

Parameters:
listener - the event listener