gov.bnl.gums.db
Class HibernateUserGroupDB

java.lang.Object
  extended by gov.bnl.gums.db.HibernateUserGroupDB
All Implemented Interfaces:
ManualUserGroupDB, UserGroupDB

public class HibernateUserGroupDB
extends Object
implements UserGroupDB, ManualUserGroupDB

Author:
Gabriele Carcassi, Jay Packard

Constructor Summary
HibernateUserGroupDB(HibernatePersistenceFactory persistenceFactory, String group)
          Creates a new instance of HibernateUserGroupDB
 
Method Summary
 void addMember(GridUser user)
          Add member to group
 String getGroup()
           
 boolean isMemberInGroup(GridUser user)
          Determines whether a member is in the group.
 void loadUpdatedList(List members)
          Sets the list of members as the one given.
 boolean removeMember(GridUser user)
          Remove member from group
 List retrieveMembers()
          Retrieves all the members of the griven group.
 List retrieveNewMembers()
          Returns the members added after a loadUpdatedList
 List retrieveRemovedMembers()
          Returns the members removed after a loadUpdatedList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateUserGroupDB

public HibernateUserGroupDB(HibernatePersistenceFactory persistenceFactory,
                            String group)
Creates a new instance of HibernateUserGroupDB

Method Detail

getGroup

public String getGroup()

addMember

public void addMember(GridUser user)
Description copied from interface: ManualUserGroupDB
Add member to group

Specified by:
addMember in interface ManualUserGroupDB

isMemberInGroup

public boolean isMemberInGroup(GridUser user)
Description copied from interface: UserGroupDB
Determines whether a member is in the group. It must be a direct query to the store, not on a cached value.

Specified by:
isMemberInGroup in interface ManualUserGroupDB
Specified by:
isMemberInGroup in interface UserGroupDB
Parameters:
user - A grid credential
Returns:
True if the credential was in the list of members

loadUpdatedList

public void loadUpdatedList(List members)
Description copied from interface: UserGroupDB
Sets the list of members as the one given. The method should change what was stored to the content of the list. It should also perform a diff, so that calls to retrieveNewMembers and retrieveRemovedMembers will return the changes.

Specified by:
loadUpdatedList in interface UserGroupDB
Parameters:
members - A list of GridUser objects.

removeMember

public boolean removeMember(GridUser user)
Description copied from interface: ManualUserGroupDB
Remove member from group

Specified by:
removeMember in interface ManualUserGroupDB
Returns:
true if userDN removed

retrieveMembers

public List retrieveMembers()
Description copied from interface: UserGroupDB
Retrieves all the members of the griven group.

Specified by:
retrieveMembers in interface ManualUserGroupDB
Specified by:
retrieveMembers in interface UserGroupDB
Returns:
A List of GridUser objects representing all the members in the group.

retrieveNewMembers

public List retrieveNewMembers()
Description copied from interface: UserGroupDB
Returns the members added after a loadUpdatedList

Specified by:
retrieveNewMembers in interface UserGroupDB
Returns:
A list of GridUser objects.

retrieveRemovedMembers

public List retrieveRemovedMembers()
Description copied from interface: UserGroupDB
Returns the members removed after a loadUpdatedList

Specified by:
retrieveRemovedMembers in interface UserGroupDB
Returns:
A list of GridUser objects.


Copyright © 2004-2009. All Rights Reserved.