gov.bnl.gums.userGroup
Class LDAPUserGroup

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

public class LDAPUserGroup
extends UserGroup

A group of users defined by an LDAP VO.

The query should be :

Author:
Gabriele Carcassi, Jay Packard

Field Summary
protected  ConfigurationStore confStore
           
 
Fields inherited from class gov.bnl.gums.userGroup.UserGroup
accessIndex, accessTypes
 
Constructor Summary
LDAPUserGroup()
          Create a new ldap user group.
LDAPUserGroup(Configuration configuration)
          Create a new ldap user group with a configuration.
LDAPUserGroup(Configuration configuration, java.lang.String name)
          Create a new ldap user group with a configuration and a name.
 
Method Summary
 UserGroup clone(Configuration configuration)
          Create a clone of itself
 boolean equals(java.lang.Object obj)
           
 java.lang.String getCertDNField()
          Getter for property certDN
 java.util.List getMemberList()
          Returns the list of user identities that are part of the group.
 java.lang.String getPersistenceFactory()
          Getter for property persistenceFactory
 java.lang.String getQuery()
          The LDAP query used to retrieveGetter for property query.
 java.lang.String getServer()
          Returns the name of the LDAP server used to retrieve the list of users.
 java.lang.String getType()
          Getter for property type.
static java.lang.String getTypeStatic()
           
 int hashCode()
           
 boolean isInGroup(GridUser user)
          Determines whether the given user identity is part of the group.
 java.util.Map retrievePeopleMap(javax.naming.directory.DirContext ldap)
           
 void setCertDNField(java.lang.String certDNField)
          Setter for property certDN
 void setPersistenceFactory(java.lang.String persistenceFactory)
          Setter for property persistenceFactory
 void setQuery(java.lang.String query)
          Changes the LDAP query used to retrieveGetter for property query.
 void setServer(java.lang.String server)
          Changes the LDAP server used to retrieve the list of users.
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String bgColor)
          Get string representation of this object for displaying in the diagnostic summary web page
 java.lang.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, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

confStore

protected ConfigurationStore confStore
Constructor Detail

LDAPUserGroup

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


LDAPUserGroup

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


LDAPUserGroup

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

Method Detail

getTypeStatic

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

clone

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

Specified by:
clone in class UserGroup
Returns:

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getCertDNField

public java.lang.String getCertDNField()
Getter for property certDN

Returns:
cert DN as string

getMemberList

public java.util.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.

getPersistenceFactory

public java.lang.String getPersistenceFactory()
Getter for property persistenceFactory

Returns:
persistenceFactory as string

getQuery

public java.lang.String getQuery()
The LDAP query used to retrieveGetter for property query.

Returns:
The LDAP query used. i.e. "ou=usatlas,o=atlas,dc=eu-datagrid,dc=org"

getServer

public java.lang.String getServer()
Returns the name of the LDAP server used to retrieve the list of users.

Returns:
The name of the server server. i.e. "grid-vo.nikhef.nl"

getType

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

Overrides:
getType in class UserGroup
Returns:
type as string

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

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

retrievePeopleMap

public java.util.Map retrievePeopleMap(javax.naming.directory.DirContext ldap)
                                throws javax.naming.NamingException
Throws:
javax.naming.NamingException

setCertDNField

public void setCertDNField(java.lang.String certDNField)
Setter for property certDN

Parameters:
certDN - as string

setPersistenceFactory

public void setPersistenceFactory(java.lang.String persistenceFactory)
Setter for property persistenceFactory

Parameters:
persistenceFactory - as string

setQuery

public void setQuery(java.lang.String query)
Changes the LDAP query used to retrieveGetter for property query.

Parameters:
query - The LDAP query used. i.e. "ou=usatlas,o=atlas,dc=eu-datagrid,dc=org"

setServer

public void setServer(java.lang.String server)
Changes the LDAP server used to retrieve the list of users.

Parameters:
server - The name of the server server. i.e. "grid-vo.nikhef.nl"

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.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 java.lang.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-2008. All Rights Reserved.