org.apache.jetspeed.services.security
Class JetspeedGroupManagement

java.lang.Object
  extended byorg.apache.jetspeed.services.security.JetspeedGroupManagement

public abstract class JetspeedGroupManagement
extends java.lang.Object

The GroupManagement interface describes contract between the portal and security provider required for Jetspeed Group Management. This interface enables an application to be independent of the underlying group management technology.

Version:
$Id: JetspeedGroupManagement.java,v 1.5 2004/02/23 03:58:11 jford Exp $
Author:
David Sean Taylor

Field Summary
 java.lang.String SERVICE_NAME
           
 
Constructor Summary
JetspeedGroupManagement()
           
 
Method Summary
static void addGroup(Group group)
          Adds a Group into permanent storage.
static Group getGroup(java.lang.String groupname)
          Retrieves a single Group for a given groupname principal.
static java.util.Iterator getGroups()
          Retrieves all Groups.
static java.util.Iterator getGroups(java.lang.String username)
          Retrieves all Groups for a given username principal.
protected static GroupManagement getService()
           
static boolean inGroup(java.lang.String username, java.lang.String groupname)
          Checks for the relationship of user has a group.
static void joinGroup(java.lang.String username, java.lang.String groupname)
          Join a user to a group.
static void joinGroup(java.lang.String username, java.lang.String groupname, java.lang.String rolename)
          Join a user to a group - specific role.
static void removeGroup(java.lang.String groupname)
          Removes a Group from the permanent store.
static void saveGroup(Group group)
          Saves a Group into permanent storage.
static void unjoinGroup(java.lang.String username, java.lang.String groupname)
          Unjoin a user from a group.
static void unjoinGroup(java.lang.String username, java.lang.String groupname, java.lang.String rolename)
          Unjoin a user from a group - specific role.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_NAME

public java.lang.String SERVICE_NAME
Constructor Detail

JetspeedGroupManagement

public JetspeedGroupManagement()
Method Detail

getService

protected static GroupManagement getService()

getGroups

public static java.util.Iterator getGroups(java.lang.String username)
                                    throws JetspeedSecurityException
Retrieves all Groups for a given username principal. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Parameters:
username - a user principal identity to be retrieved.
Returns:
Iterator over all groups associated to the user principal.
Throws:
GroupException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

getGroups

public static java.util.Iterator getGroups()
                                    throws JetspeedSecurityException
Retrieves all Groups. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Returns:
Iterator over all groups.
Throws:
GroupException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

addGroup

public static void addGroup(Group group)
                     throws JetspeedSecurityException
Adds a Group into permanent storage.

Throws:
GroupException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

saveGroup

public static void saveGroup(Group group)
                      throws JetspeedSecurityException
Saves a Group into permanent storage.

Throws:
GroupException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

removeGroup

public static void removeGroup(java.lang.String groupname)
                        throws JetspeedSecurityException
Removes a Group from the permanent store. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Parameters:
groupname - the principal identity of the group to be retrieved.
Throws:
GroupException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

joinGroup

public static void joinGroup(java.lang.String username,
                             java.lang.String groupname)
                      throws JetspeedSecurityException
Join a user to a group. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Throws:
GroupException - when the security provider has a general failure retrieving users.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

joinGroup

public static void joinGroup(java.lang.String username,
                             java.lang.String groupname,
                             java.lang.String rolename)
                      throws JetspeedSecurityException
Join a user to a group - specific role. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Throws:
GroupException - when the security provider has a general failure retrieving groups.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

unjoinGroup

public static void unjoinGroup(java.lang.String username,
                               java.lang.String groupname)
                        throws JetspeedSecurityException
Unjoin a user from a group. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Throws:
GroupException - when the security provider has a general failure retrieving users.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

unjoinGroup

public static void unjoinGroup(java.lang.String username,
                               java.lang.String groupname,
                               java.lang.String rolename)
                        throws JetspeedSecurityException
Unjoin a user from a group - specific role. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Throws:
GroupException - when the security provider has a general failure retrieving users.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

inGroup

public static boolean inGroup(java.lang.String username,
                              java.lang.String groupname)
                       throws JetspeedSecurityException
Checks for the relationship of user has a group. Returns true when the user has the given group. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Throws:
GroupException - when the security provider has a general failure retrieving users.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

getGroup

public static Group getGroup(java.lang.String groupname)
                      throws JetspeedSecurityException
Retrieves a single Group for a given groupname principal. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Parameters:
groupname - a group principal identity to be retrieved.
Returns:
Group the group record retrieved.
Throws:
GroupException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException


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