gov.bnl.gums.userGroup
Class ManualUserGroup

java.lang.Object
  extended by gov.bnl.gums.userGroup.UserGroup
      extended by gov.bnl.gums.userGroup.ManualUserGroup

public class ManualUserGroup
extends UserGroup

A user group that is defined by a list of users stored in some way, allowing to add and remove users. The persistance layer is implemented through an interface, allowing different storage frameworks (i.e. database, LDAP, file)

This class will provide also configurable data caching.

Author:
Gabriele Carcassi, Jay Packard

Field Summary
protected  int adminSecondsBetweenPatternRefresh
           
protected  Date patternListLastUpdated
           
protected  int secondsBetweenPatternRefresh
           
 
Fields inherited from class gov.bnl.gums.userGroup.UserGroup
accessIndex, accessTypes
 
Constructor Summary
ManualUserGroup()
          Create a new manual user group.
ManualUserGroup(Configuration configuration)
          Create a new manual user group with a configuration.
ManualUserGroup(Configuration configuration, String name)
          Create a new manual user group with a configuration and a name.
 
Method Summary
 void addMember(GridUser user)
           
 UserGroup clone(Configuration configuration)
          Create a clone of itself
 List getMemberList()
          Returns the list of user identities that are part of the group.
 String getMembersUri()
           
 String getNonMembersUri()
           
 String getPersistenceFactory()
          Setter for property persistenceFactory.
 String getType()
          Getter for property type.
static String getTypeStatic()
           
 boolean isInGroup(GridUser user)
          Determines whether the given user identity is part of the group.
 boolean removeMember(GridUser user)
           
 void setMembersUri(String membersUri)
           
 void setNonMembersUri(String nonMembersUri)
           
 void setPersistenceFactory(String persistenceFactory)
          Setter for property persistenceFactory
 String toString()
           
 String toString(String bgColor)
          Get string representation of this object for displaying in the diagnostic summary web page
 String toXML()
          Create a clone of itself
 void updateMembers()
          Updates the local list of the users from the source of the group.
 
Methods inherited from class gov.bnl.gums.userGroup.UserGroup
getAccess, getConfiguration, getDescription, getName, hasReadAllAccess, hasReadSelfAccess, hasWriteAccess, setAccess, setConfiguration, setDescription, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

patternListLastUpdated

protected Date patternListLastUpdated

secondsBetweenPatternRefresh

protected int secondsBetweenPatternRefresh

adminSecondsBetweenPatternRefresh

protected int adminSecondsBetweenPatternRefresh
Constructor Detail

ManualUserGroup

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


ManualUserGroup

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


ManualUserGroup

public ManualUserGroup(Configuration configuration,
                       String name)
Create a new manual user group with a configuration and a name.

Method Detail

getTypeStatic

public static String getTypeStatic()

addMember

public void addMember(GridUser user)

clone

public UserGroup clone(Configuration configuration)
Description copied from class: UserGroup
Create a clone of itself

Specified by:
clone in class UserGroup
Returns:

getMemberList

public List getMemberList()
Description copied from class: UserGroup
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.

Specified by:
getMemberList in class UserGroup
Returns:
a List of GridUser objects representing the user certificate DN.

getMembersUri

public String getMembersUri()

getNonMembersUri

public String getNonMembersUri()

getPersistenceFactory

public String getPersistenceFactory()
Setter for property persistenceFactory.

Returns:
persistence factory as string.

getType

public String getType()
Description copied from class: UserGroup
Getter for property type.

Overrides:
getType in class UserGroup
Returns:
type as string

isInGroup

public boolean isInGroup(GridUser user)
Description copied from class: UserGroup
Determines whether the given user identity is part of the group.

Specified by:
isInGroup in class UserGroup
Returns:
true if it's in the group

removeMember

public boolean removeMember(GridUser user)

setPersistenceFactory

public void setPersistenceFactory(String persistenceFactory)
Setter for property persistenceFactory

Parameters:
persistenceFactory -

setMembersUri

public void setMembersUri(String membersUri)

setNonMembersUri

public void setNonMembersUri(String nonMembersUri)

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(String bgColor)
Description copied from class: UserGroup
Get string representation of this object for displaying in the diagnostic summary web page

Specified by:
toString in class UserGroup
Parameters:
bgColor - back ground color
Returns:

toXML

public String toXML()
Description copied from class: UserGroup
Create a clone of itself

Specified by:
toXML in class UserGroup
Returns:

updateMembers

public void updateMembers()
Description copied from class: UserGroup
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.

Specified by:
updateMembers in class UserGroup


Copyright © 2004-2009. All Rights Reserved.