edu.internet2.middleware.grouper.internal.dao.hib3
Class Hib3MemberDAO

java.lang.Object
  extended by edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
      extended by edu.internet2.middleware.grouper.internal.dao.hib3.Hib3MemberDAO
All Implemented Interfaces:
GrouperDAO, MemberDAO

public class Hib3MemberDAO
extends Hib3DAO
implements MemberDAO

Basic Hibernate Member DAO interface.

Since:
@HEAD@
Version:
$Id: Hib3MemberDAO.java,v 1.20 2009-12-28 06:08:37 mchyzer Exp $
Author:
blair christensen.

Field Summary
static int MEMBER_SUBJECT_BATCH_SIZE
          number of subjects to put in member query
 
Fields inherited from class edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
hibernateInitted
 
Constructor Summary
Hib3MemberDAO()
           
 
Method Summary
 Set<String> _internal_membersComplement(String groupUuid1, String groupUuid2)
          find the set of member uuids of the complement of two groups
 Set<String> _internal_membersIntersection(String groupUuid1, String groupUuid2)
          find the set of member uuids of the intersection of two groups
 Set<String> _internal_membersUnion(String groupUuid1, String groupUuid2)
          find the set of member uuids of the union of two groups
 void create(Member _m)
           
 boolean exists(String uuid)
           
 void existsCachePut(String uuid, boolean exists)
          update the exists cache
 Set findAll()
           
 Set<Member> findAll(edu.internet2.middleware.subject.Source source)
           
 Set<Member> findAllUsed(edu.internet2.middleware.subject.Source source)
          find all members that are used somewhere (e.g.
 Set<Member> findByIds(Collection<String> ids, QueryOptions queryOptions)
          find by ids secure
 Member findBySubject(String subjectId)
          Deprecated. use overload
 Member findBySubject(String subjectId, boolean exceptionIfNull)
          find by subject id only (cant be duplicates)
 Member findBySubject(String subjectId, String src)
          Deprecated. use overload
 Member findBySubject(String subjectId, String src, boolean exceptionIfNull)
          find by subject id and source id
 Member findBySubject(String id, String src, String type)
          Deprecated. use overload
 Member findBySubject(String id, String src, String type, boolean exceptionIfNull)
           
 Member findBySubject(String id, String src, String type, boolean exceptionIfNull, QueryOptions queryOptions)
          find member by subject
 Member findBySubject(edu.internet2.middleware.subject.Subject subj)
          Deprecated. use overload
 Member findBySubject(edu.internet2.middleware.subject.Subject subj, boolean exceptionIfNull)
           
 Set<Member> findBySubjects(Collection<edu.internet2.middleware.subject.Subject> subjects, boolean createIfNotExists)
          find members by subjects and create if not exist possibly
 Set<Member> findBySubjectsInGroup(GrouperSession grouperSession, Set<edu.internet2.middleware.subject.Subject> subjects, Group group, Field field, MembershipType membershipType)
          convert a set of subjects to a set of members
 Member findByUuid(String uuid)
          Deprecated. use overload
 Member findByUuid(String uuid, boolean exceptionIfNull)
           
 Member findByUuidOrSubject(String uuid, String subjectId, String source, boolean exceptionIfNull)
          find a member by uuid or subject id
static void massageMemberSortFields(QuerySort querySort)
          if there are sort fields, go through them, and replace name with m.subjectIdDb, etc, sort_string0 for m.sortString0, etc
 void saveUpdateProperties(Member member)
          save the udpate properties which are auto saved when business method is called
 void update(Member _m)
           
 void uuid2dtoCacheRemove(String uuid)
          remove from cache
 
Methods inherited from class edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
evict, evictEntity, evictQueries, getConfiguration, getSessionFactory, initHibernateIfNotInitted, resourceNameFromClassName, session
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEMBER_SUBJECT_BATCH_SIZE

public static int MEMBER_SUBJECT_BATCH_SIZE
number of subjects to put in member query

Constructor Detail

Hib3MemberDAO

public Hib3MemberDAO()
Method Detail

create

public void create(Member _m)
            throws GrouperDAOException
Specified by:
create in interface MemberDAO
Throws:
GrouperDAOException
Since:
@HEAD@

exists

public boolean exists(String uuid)
               throws GrouperDAOException
Specified by:
exists in interface MemberDAO
Throws:
GrouperDAOException
Since:
@HEAD@

findAll

public Set findAll()
            throws GrouperDAOException
Specified by:
findAll in interface MemberDAO
Throws:
GrouperDAOException
Since:
@HEAD@

findAll

public Set<Member> findAll(edu.internet2.middleware.subject.Source source)
                    throws GrouperDAOException
Specified by:
findAll in interface MemberDAO
Throws:
GrouperDAOException
Since:
@HEAD@

findBySubject

@Deprecated
public Member findBySubject(edu.internet2.middleware.subject.Subject subj)
                     throws GrouperDAOException,
                            MemberNotFoundException
Deprecated. use overload

Specified by:
findBySubject in interface MemberDAO
Throws:
GrouperDAOException
MemberNotFoundException

findBySubject

public Member findBySubject(edu.internet2.middleware.subject.Subject subj,
                            boolean exceptionIfNull)
                     throws GrouperDAOException,
                            MemberNotFoundException
Specified by:
findBySubject in interface MemberDAO
Throws:
GrouperDAOException
MemberNotFoundException

findBySubject

@Deprecated
public Member findBySubject(String id,
                                       String src,
                                       String type)
                     throws GrouperDAOException,
                            MemberNotFoundException
Deprecated. use overload

Specified by:
findBySubject in interface MemberDAO
Throws:
GrouperDAOException
MemberNotFoundException

findBySubject

public Member findBySubject(String id,
                            String src,
                            String type,
                            boolean exceptionIfNull)
                     throws GrouperDAOException,
                            MemberNotFoundException
Specified by:
findBySubject in interface MemberDAO
Throws:
GrouperDAOException
MemberNotFoundException
See Also:
MemberDAO.findBySubject(java.lang.String, java.lang.String, java.lang.String, boolean)

massageMemberSortFields

public static void massageMemberSortFields(QuerySort querySort)
if there are sort fields, go through them, and replace name with m.subjectIdDb, etc, sort_string0 for m.sortString0, etc

Parameters:
querySort -

findBySubject

public Member findBySubject(String id,
                            String src,
                            String type,
                            boolean exceptionIfNull,
                            QueryOptions queryOptions)
                     throws GrouperDAOException,
                            MemberNotFoundException
Description copied from interface: MemberDAO
find member by subject

Specified by:
findBySubject in interface MemberDAO
Parameters:
id -
src -
type -
exceptionIfNull -
queryOptions -
Returns:
member
Throws:
GrouperDAOException
MemberNotFoundException

findByUuid

@Deprecated
public Member findByUuid(String uuid)
                  throws GrouperDAOException,
                         MemberNotFoundException
Deprecated. use overload

Specified by:
findByUuid in interface MemberDAO
Throws:
GrouperDAOException
MemberNotFoundException

findByUuid

public Member findByUuid(String uuid,
                         boolean exceptionIfNull)
                  throws GrouperDAOException,
                         MemberNotFoundException
Specified by:
findByUuid in interface MemberDAO
Throws:
GrouperDAOException
MemberNotFoundException

existsCachePut

public void existsCachePut(String uuid,
                           boolean exists)
update the exists cache

Specified by:
existsCachePut in interface MemberDAO
Parameters:
uuid -
exists -

uuid2dtoCacheRemove

public void uuid2dtoCacheRemove(String uuid)
remove from cache

Specified by:
uuid2dtoCacheRemove in interface MemberDAO
Parameters:
uuid -

update

public void update(Member _m)
            throws GrouperDAOException
Specified by:
update in interface MemberDAO
Throws:
GrouperDAOException
Since:
@HEAD@

findBySubject

@Deprecated
public Member findBySubject(String subjectId)
                     throws GrouperDAOException,
                            MemberNotFoundException,
                            MemberNotUniqueException
Deprecated. use overload

Description copied from interface: MemberDAO
find by subject id only (cant be duplicates)

Specified by:
findBySubject in interface MemberDAO
Returns:
the member
Throws:
GrouperDAOException
MemberNotFoundException
MemberNotUniqueException
See Also:
MemberDAO.findBySubject(java.lang.String)

findBySubject

public Member findBySubject(String subjectId,
                            boolean exceptionIfNull)
                     throws GrouperDAOException,
                            MemberNotFoundException,
                            MemberNotUniqueException
Description copied from interface: MemberDAO
find by subject id only (cant be duplicates)

Specified by:
findBySubject in interface MemberDAO
Returns:
the member
Throws:
GrouperDAOException
MemberNotFoundException
MemberNotUniqueException

findBySubject

@Deprecated
public Member findBySubject(String subjectId,
                                       String src)
                     throws GrouperDAOException,
                            MemberNotFoundException
Deprecated. use overload

Description copied from interface: MemberDAO
find by subject id and source id

Specified by:
findBySubject in interface MemberDAO
Returns:
the member
Throws:
GrouperDAOException
MemberNotFoundException
See Also:
MemberDAO.findBySubject(java.lang.String, java.lang.String)

findBySubject

public Member findBySubject(String subjectId,
                            String src,
                            boolean exceptionIfNull)
                     throws GrouperDAOException,
                            MemberNotFoundException
Description copied from interface: MemberDAO
find by subject id and source id

Specified by:
findBySubject in interface MemberDAO
Returns:
the member
Throws:
GrouperDAOException
MemberNotFoundException

_internal_membersIntersection

public Set<String> _internal_membersIntersection(String groupUuid1,
                                                 String groupUuid2)
Description copied from interface: MemberDAO
find the set of member uuids of the intersection of two groups

Specified by:
_internal_membersIntersection in interface MemberDAO
Returns:
the set of member uuids (non null)
See Also:
MemberDAO._internal_membersIntersection(java.lang.String, java.lang.String)

_internal_membersUnion

public Set<String> _internal_membersUnion(String groupUuid1,
                                          String groupUuid2)
Description copied from interface: MemberDAO
find the set of member uuids of the union of two groups

Specified by:
_internal_membersUnion in interface MemberDAO
Returns:
the set of member uuids (non null)
See Also:
MemberDAO._internal_membersUnion(java.lang.String, java.lang.String)

_internal_membersComplement

public Set<String> _internal_membersComplement(String groupUuid1,
                                               String groupUuid2)
Description copied from interface: MemberDAO
find the set of member uuids of the complement of two groups

Specified by:
_internal_membersComplement in interface MemberDAO
Returns:
the set of member uuids (non null)
See Also:
MemberDAO._internal_membersComplement(java.lang.String, java.lang.String)

findBySubjects

public Set<Member> findBySubjects(Collection<edu.internet2.middleware.subject.Subject> subjects,
                                  boolean createIfNotExists)
find members by subjects and create if not exist possibly

Specified by:
findBySubjects in interface MemberDAO
Parameters:
subjects -
createIfNotExists -
Returns:
the members

findBySubjectsInGroup

public Set<Member> findBySubjectsInGroup(GrouperSession grouperSession,
                                         Set<edu.internet2.middleware.subject.Subject> subjects,
                                         Group group,
                                         Field field,
                                         MembershipType membershipType)
convert a set of subjects to a set of members

Specified by:
findBySubjectsInGroup in interface MemberDAO
Parameters:
grouperSession -
subjects - to convert to members
group - that subjects must be in
field - that they must be in in the group (null will default to eh members list
membershipType - that they must be in in the group or null for any
Returns:
the members in the group
See Also:
MemberDAO.findBySubjectsInGroup(GrouperSession, Set, Group, Field, MembershipType)

findByUuidOrSubject

public Member findByUuidOrSubject(String uuid,
                                  String subjectId,
                                  String source,
                                  boolean exceptionIfNull)
Description copied from interface: MemberDAO
find a member by uuid or subject id

Specified by:
findByUuidOrSubject in interface MemberDAO
Returns:
the member
See Also:
MemberDAO.findByUuidOrSubject(java.lang.String, java.lang.String, java.lang.String, boolean)

saveUpdateProperties

public void saveUpdateProperties(Member member)
Description copied from interface: MemberDAO
save the udpate properties which are auto saved when business method is called

Specified by:
saveUpdateProperties in interface MemberDAO
See Also:
MemberDAO.saveUpdateProperties(edu.internet2.middleware.grouper.Member)

findAllUsed

public Set<Member> findAllUsed(edu.internet2.middleware.subject.Source source)
                        throws GrouperDAOException
Description copied from interface: MemberDAO
find all members that are used somewhere (e.g. memberships or attributes)

Specified by:
findAllUsed in interface MemberDAO
Returns:
the members
Throws:
GrouperDAOException
See Also:
MemberDAO.findAllUsed(edu.internet2.middleware.subject.Source)

findByIds

public Set<Member> findByIds(Collection<String> ids,
                             QueryOptions queryOptions)
Description copied from interface: MemberDAO
find by ids secure

Specified by:
findByIds in interface MemberDAO
Returns:
the members empty set or exception
See Also:
MemberDAO.findByIds(Collection, QueryOptions)