gov.bnl.gums.userGroup
Class UserGroup

java.lang.Object
  extended by gov.bnl.gums.userGroup.UserGroup
Direct Known Subclasses:
LDAPUserGroup, ManualUserGroup, VOMSUserGroup

public abstract class UserGroup
extends java.lang.Object

An interface that defines a group of people, which GUMS will associate to a mapping policy. An implementation could take/manage a list of users in any way it wanted, or it could combine different groups.

Author:
Gabriele Carcassi, Jay Packard

Field Summary
protected  int accessIndex
           
protected  java.lang.String[] accessTypes
           
 
Constructor Summary
UserGroup()
          Create a new user group.
UserGroup(Configuration configuration)
          Create a new user group with a configuration.
UserGroup(Configuration configuration, java.lang.String name)
          Create a new user group with a configuration and a name.
 
Method Summary
abstract  UserGroup clone(Configuration configuration)
          Create a clone of itself
 java.lang.String getAccess()
          Getter for property access, that determines what a member of this user group has access to in GUMS.
 Configuration getConfiguration()
          Getter for property configuration.
 java.lang.String getDescription()
          Getter for property description.
abstract  java.util.List getMemberList()
          Returns the list of user identities that are part of the group.
 java.lang.String getName()
          Getter for property name.
 java.lang.String getType()
          Getter for property type.
static java.lang.String getTypeStatic()
           
 boolean hasReadAllAccess()
           
 boolean hasReadSelfAccess()
           
 boolean hasWriteAccess()
           
abstract  boolean isInGroup(GridUser user)
          Determines whether the given user identity is part of the group.
 void setAccess(java.lang.String access)
          Setter for property access
 void setConfiguration(Configuration configuration)
          Setter for property configuration.
 void setDescription(java.lang.String description)
          Setter for property description.
 void setName(java.lang.String name)
          Setter for property name.
abstract  java.lang.String toString(java.lang.String bgColor)
          Get string representation of this object for displaying in the diagnostic summary web page
abstract  java.lang.String toXML()
          Create a clone of itself
abstract  void updateMembers()
          Updates the local list of the users from the source of the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

accessTypes

protected java.lang.String[] accessTypes

accessIndex

protected int accessIndex
Constructor Detail

UserGroup

public UserGroup()
Create a new user group. This empty constructor is needed by the XML Digestor.


UserGroup

public UserGroup(Configuration configuration)
Create a new user group with a configuration.

Parameters:
configuration -
name -

UserGroup

public UserGroup(Configuration configuration,
                 java.lang.String name)
Create a new user group with a configuration and a name.

Parameters:
configuration -
name -
Method Detail

getTypeStatic

public static java.lang.String getTypeStatic()
Returns:
user friendly string representation of the property type called statically

clone

public abstract UserGroup clone(Configuration configuration)
Create a clone of itself

Parameters:
configuration -
Returns:

getAccess

public java.lang.String getAccess()
Getter for property access, that determines what a member of this user group has access to in GUMS.

Returns:
access as string

getConfiguration

public Configuration getConfiguration()
Getter for property configuration.

Returns:
Configuration object

getDescription

public java.lang.String getDescription()
Getter for property description.

Returns:
Description as string

getMemberList

public abstract java.util.List getMemberList()
Returns the list of user identities that are part of the group.

Some UserGroups, however, could be defined by a rule that doesn't allow listing. For example, a group could be 'all the users with a DOEGrids certificate'. Though one could argue whether or not is a good idea to have such a group, one can implement one and throw an UnsupportedOperationException. This will make it impossible for GUMS to create a grid-mapfile, but would still allow direct user to account mapping through a call-out.

Returns:
a List of GridUser objects representing the user certificate DN.

getName

public java.lang.String getName()
Getter for property name.

Returns:
name as string

getType

public java.lang.String getType()
Getter for property type.

Returns:
type as string

hasReadAllAccess

public boolean hasReadAllAccess()
Returns:
true if this group allows at least read all access

hasReadSelfAccess

public boolean hasReadSelfAccess()
Returns:
true if this group allows at least read self access

hasWriteAccess

public boolean hasWriteAccess()
Returns:
true if this group allows write access (admin privileges)

isInGroup

public abstract boolean isInGroup(GridUser user)
Determines whether the given user identity is part of the group.

Parameters:
userDN - the certificate DN.
Returns:
true if it's in the group

setAccess

public void setAccess(java.lang.String access)
Setter for property access

Parameters:
access -

setConfiguration

public void setConfiguration(Configuration configuration)
Setter for property configuration.

Parameters:
configuration -

setDescription

public void setDescription(java.lang.String description)
Setter for property description.

Parameters:
description -

setName

public void setName(java.lang.String name)
Setter for property name.

Parameters:
name -

toString

public abstract java.lang.String toString(java.lang.String bgColor)
Get string representation of this object for displaying in the diagnostic summary web page

Parameters:
bgColor - back ground color
Returns:

toXML

public abstract java.lang.String toXML()
Create a clone of itself

Parameters:
configuration -
Returns:

updateMembers

public abstract void updateMembers()
Updates the local list of the users from the source of the group.

Most user groups will get the information from a separate database accessible via WAN. For that reason, the user group will maintain a local cache with the list of members, which can be updated through this method.



Copyright © 2004-2008. All Rights Reserved.