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

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

public class Hib3StemDAO
extends Hib3DAO
implements StemDAO

Basic Hibernate Stem DAO interface.

Since:
@HEAD@
Version:
$Id: Hib3StemDAO.java,v 1.38 2009/11/17 02:52:29 mchyzer Exp $
Author:
blair christensen.

Field Summary
 
Fields inherited from class edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
hibernateInitted
 
Constructor Summary
Hib3StemDAO()
           
 
Method Summary
 void createChildAttributeDef(Stem _stem, AttributeDef attributeDef)
           
 void createChildAttributeDefName(Stem _parent, AttributeDefName attributeDefName)
           
 void createChildGroup(Stem _stem, Group _group, Member _member, Map<String,String> attributes)
           
 void createChildStem(Stem _child)
           
 void createRootStem(Stem _root)
           
 void delete(Stem _ns)
           
 boolean exists(String uuid)
           
 Set<Stem> findAllByApproximateDisplayExtension(String val)
           
 Set<Stem> findAllByApproximateDisplayExtension(String val, String scope)
           
 Set<Stem> findAllByApproximateDisplayName(String val)
           
 Set<Stem> findAllByApproximateDisplayName(String val, String scope)
           
 Set<Stem> findAllByApproximateExtension(String val)
           
 Set<Stem> findAllByApproximateExtension(String val, String scope)
           
 Set<Stem> findAllByApproximateName(String val)
           
 Set<Stem> findAllByApproximateName(String val, String scope)
           
 Set<Stem> findAllByApproximateNameAny(String name)
           
 Set<Stem> findAllByApproximateNameAny(String name, String scope)
           
 Set<Stem> findAllByCreatedAfter(Date d)
           
 Set<Stem> findAllByCreatedAfter(Date d, String scope)
           
 Set<Stem> findAllByCreatedBefore(Date d)
           
 Set<Stem> findAllByCreatedBefore(Date d, String scope)
           
 Set<Group> findAllChildGroups(Stem ns, Stem.Scope scope)
          Find all child groups within specified scope.
 Set<Group> findAllChildGroupsSecure(Stem ns, Stem.Scope scope, GrouperSession grouperSession, edu.internet2.middleware.subject.Subject subject, Set<Privilege> inPrivSet, QueryOptions queryOptions)
          Find all child groups within specified scope, and make sure the grouper session can see them
 Set<Group> findAllChildMembershipGroupsSecure(Stem ns, Stem.Scope scope, GrouperSession grouperSession, edu.internet2.middleware.subject.Subject subject, Set<Privilege> inPrivSet, QueryOptions queryOptions)
          Find all child groups within specified scope, and make sure the grouper session can see them
 Set<Stem> findAllChildStems(Stem ns, Stem.Scope scope)
          Find all child stems within specified scope.
 Set<Stem> findAllChildStems(Stem ns, Stem.Scope scope, boolean orderByName)
          Find all child stems within specified scope.
 Set<Stem> findAllChildStemsSecure(Stem ns, Stem.Scope scope, GrouperSession grouperSession, edu.internet2.middleware.subject.Subject subject, Set<Privilege> inPrivSet, QueryOptions queryOptions)
          Find all child stems within specified scope, and make sure the grouper session can see them
 Set<Stem> findByCreatorOrModifier(Member member)
          find stems by creator or modifier
 Stem findByName(String name)
          Deprecated.  
 Stem findByName(String name, boolean exceptionIfNull)
           
 Stem findByName(String name, boolean exceptionIfNull, QueryOptions queryOptions)
           
 Stem findByUuid(String uuid)
          Deprecated.  
 Stem findByUuid(String uuid, boolean exceptionIfNull)
           
 Stem findByUuid(String uuid, boolean exceptionIfNull, QueryOptions queryOptions)
           
 Set<Stem> getAllStems()
           
 Set<Stem> getAllStemsSecure(GrouperSession grouperSession, edu.internet2.middleware.subject.Subject subject, Set<Privilege> inPrivSet, QueryOptions queryOptions)
           
 Set<Stem> getAllStemsSecure(String scope, GrouperSession grouperSession, edu.internet2.middleware.subject.Subject subject, Set<Privilege> inPrivSet, QueryOptions queryOptions)
           
 Set<Stem> getImmediateChildrenSecure(GrouperSession grouperSession, Stem stem, edu.internet2.middleware.subject.Subject subject, Set<Privilege> inPrivSet, QueryOptions queryOptions)
          get immediate children (stems) secure
 void renameStemAndChildren(Stem _ns, Set children)
           
 void update(Stem _ns)
           
 void updateLastMembershipChange(String stemId)
           
 void updateLastMembershipChangeIncludeAncestorGroups(String groupId)
          This will update last_membership_change for stem owners where group member in groupSet is the given groupId.
 
Methods inherited from class edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
getConfiguration, initHibernateIfNotInitted, resourceNameFromClassName, session
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hib3StemDAO

public Hib3StemDAO()
Method Detail

createChildGroup

public void createChildGroup(Stem _stem,
                             Group _group,
                             Member _member,
                             Map<String,String> attributes)
                      throws GrouperDAOException
Specified by:
createChildGroup in interface StemDAO
Parameters:
_stem -
_group -
_member -
attributes -
Throws:
GrouperDAOException
Since:

createChildAttributeDef

public void createChildAttributeDef(Stem _stem,
                                    AttributeDef attributeDef)
                             throws GrouperDAOException
Specified by:
createChildAttributeDef in interface StemDAO
Parameters:
_stem -
attributeDef -
Throws:
GrouperDAOException
Since:

createChildStem

public void createChildStem(Stem _child)
                     throws GrouperDAOException
Specified by:
createChildStem in interface StemDAO
Parameters:
_child -
Throws:
GrouperDAOException
Since:
@HEAD@

createRootStem

public void createRootStem(Stem _root)
                    throws GrouperDAOException
Specified by:
createRootStem in interface StemDAO
Parameters:
_root -
Throws:
GrouperDAOException
Since:
@HEAD@

delete

public void delete(Stem _ns)
            throws GrouperDAOException
Specified by:
delete in interface StemDAO
Parameters:
_ns -
Throws:
GrouperDAOException
Since:
@HEAD@

exists

public boolean exists(String uuid)
               throws GrouperDAOException
Specified by:
exists in interface StemDAO
Parameters:
uuid -
Returns:
if exists
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByApproximateDisplayExtension

public Set<Stem> findAllByApproximateDisplayExtension(String val)
                                               throws GrouperDAOException
Specified by:
findAllByApproximateDisplayExtension in interface StemDAO
Parameters:
val -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByApproximateDisplayExtension

public Set<Stem> findAllByApproximateDisplayExtension(String val,
                                                      String scope)
                                               throws GrouperDAOException
Specified by:
findAllByApproximateDisplayExtension in interface StemDAO
Parameters:
val -
scope -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByApproximateDisplayName

public Set<Stem> findAllByApproximateDisplayName(String val)
                                          throws GrouperDAOException
Specified by:
findAllByApproximateDisplayName in interface StemDAO
Parameters:
val -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByApproximateDisplayName

public Set<Stem> findAllByApproximateDisplayName(String val,
                                                 String scope)
                                          throws GrouperDAOException
Specified by:
findAllByApproximateDisplayName in interface StemDAO
Parameters:
val -
scope -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByApproximateExtension

public Set<Stem> findAllByApproximateExtension(String val)
                                        throws GrouperDAOException
Specified by:
findAllByApproximateExtension in interface StemDAO
Parameters:
val -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByApproximateExtension

public Set<Stem> findAllByApproximateExtension(String val,
                                               String scope)
                                        throws GrouperDAOException
Specified by:
findAllByApproximateExtension in interface StemDAO
Parameters:
val -
scope -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByApproximateName

public Set<Stem> findAllByApproximateName(String val)
                                   throws GrouperDAOException
Specified by:
findAllByApproximateName in interface StemDAO
Parameters:
val -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByApproximateName

public Set<Stem> findAllByApproximateName(String val,
                                          String scope)
                                   throws GrouperDAOException
Specified by:
findAllByApproximateName in interface StemDAO
Parameters:
val -
scope -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByApproximateNameAny

public Set<Stem> findAllByApproximateNameAny(String name)
                                      throws GrouperDAOException
Specified by:
findAllByApproximateNameAny in interface StemDAO
Parameters:
name -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByApproximateNameAny

public Set<Stem> findAllByApproximateNameAny(String name,
                                             String scope)
                                      throws GrouperDAOException
Specified by:
findAllByApproximateNameAny in interface StemDAO
Parameters:
name -
scope -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByCreatedAfter

public Set<Stem> findAllByCreatedAfter(Date d)
                                throws GrouperDAOException
Specified by:
findAllByCreatedAfter in interface StemDAO
Parameters:
d -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByCreatedAfter

public Set<Stem> findAllByCreatedAfter(Date d,
                                       String scope)
                                throws GrouperDAOException
Specified by:
findAllByCreatedAfter in interface StemDAO
Parameters:
d -
scope -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByCreatedBefore

public Set<Stem> findAllByCreatedBefore(Date d)
                                 throws GrouperDAOException
Specified by:
findAllByCreatedBefore in interface StemDAO
Parameters:
d -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllByCreatedBefore

public Set<Stem> findAllByCreatedBefore(Date d,
                                        String scope)
                                 throws GrouperDAOException
Specified by:
findAllByCreatedBefore in interface StemDAO
Parameters:
d -
scope -
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

findAllChildGroups

public Set<Group> findAllChildGroups(Stem ns,
                                     Stem.Scope scope)
                              throws GrouperDAOException
Description copied from interface: StemDAO
Find all child groups within specified scope.

Specified by:
findAllChildGroups in interface StemDAO
Throws:
GrouperDAOException
Since:
@HEAD@
See Also:
StemDAO.findAllChildGroups(Stem, Stem.Scope)

findAllChildStems

public Set<Stem> findAllChildStems(Stem ns,
                                   Stem.Scope scope)
                            throws GrouperDAOException,
                                   IllegalStateException
Description copied from interface: StemDAO
Find all child stems within specified scope.

Specified by:
findAllChildStems in interface StemDAO
Throws:
IllegalStateException - if unknown scope.
GrouperDAOException
Since:
@HEAD@
See Also:
StemDAO.findAllChildStems(Stem, Stem.Scope)

findAllChildStems

public Set<Stem> findAllChildStems(Stem ns,
                                   Stem.Scope scope,
                                   boolean orderByName)
                            throws GrouperDAOException,
                                   IllegalStateException
Description copied from interface: StemDAO
Find all child stems within specified scope.

Specified by:
findAllChildStems in interface StemDAO
Parameters:
ns -
scope -
orderByName -
Returns:
set stem
Throws:
GrouperDAOException
IllegalStateException - if unknown scope.
Since:
@HEAD@
See Also:
StemDAO.findAllChildStems(Stem, Stem.Scope)

findByName

@Deprecated
public Stem findByName(String name)
                throws GrouperDAOException,
                       StemNotFoundException
Deprecated. 

Specified by:
findByName in interface StemDAO
Parameters:
name -
Returns:
stem
Throws:
GrouperDAOException
StemNotFoundException

findByName

public Stem findByName(String name,
                       boolean exceptionIfNull)
                throws GrouperDAOException,
                       StemNotFoundException
Specified by:
findByName in interface StemDAO
Parameters:
name -
exceptionIfNull -
Returns:
stem
Throws:
GrouperDAOException
StemNotFoundException

findByUuid

@Deprecated
public Stem findByUuid(String uuid)
                throws GrouperDAOException,
                       StemNotFoundException
Deprecated. 

Specified by:
findByUuid in interface StemDAO
Parameters:
uuid -
Returns:
stem
Throws:
GrouperDAOException
StemNotFoundException

findByUuid

public Stem findByUuid(String uuid,
                       boolean exceptionIfNull)
                throws GrouperDAOException,
                       StemNotFoundException
Specified by:
findByUuid in interface StemDAO
Parameters:
uuid -
exceptionIfNull -
Returns:
stem
Throws:
GrouperDAOException
StemNotFoundException

getAllStems

public Set<Stem> getAllStems()
                      throws GrouperDAOException
Specified by:
getAllStems in interface StemDAO
Returns:
set stems
Throws:
GrouperDAOException
Since:
@HEAD@

renameStemAndChildren

public void renameStemAndChildren(Stem _ns,
                                  Set children)
                           throws GrouperDAOException
Specified by:
renameStemAndChildren in interface StemDAO
Parameters:
_ns -
children -
Throws:
GrouperDAOException
Since:
@HEAD@

update

public void update(Stem _ns)
            throws GrouperDAOException
Specified by:
update in interface StemDAO
Parameters:
_ns -
Throws:
GrouperDAOException
Since:
@HEAD@

findByCreatorOrModifier

public Set<Stem> findByCreatorOrModifier(Member member)
find stems by creator or modifier

Specified by:
findByCreatorOrModifier in interface StemDAO
Parameters:
member -
Returns:
the stems

findAllChildGroupsSecure

public Set<Group> findAllChildGroupsSecure(Stem ns,
                                           Stem.Scope scope,
                                           GrouperSession grouperSession,
                                           edu.internet2.middleware.subject.Subject subject,
                                           Set<Privilege> inPrivSet,
                                           QueryOptions queryOptions)
                                    throws GrouperDAOException
Description copied from interface: StemDAO
Find all child groups within specified scope, and make sure the grouper session can see them

Specified by:
findAllChildGroupsSecure in interface StemDAO
inPrivSet - is a set of privs that the subject must have one of to display a row. AccessPrivilege has some pre-baked set constants available
Returns:
the groups
Throws:
GrouperDAOException
See Also:
StemDAO.findAllChildGroupsSecure(edu.internet2.middleware.grouper.Stem, edu.internet2.middleware.grouper.Stem.Scope, edu.internet2.middleware.grouper.GrouperSession, edu.internet2.middleware.subject.Subject, java.util.Set, edu.internet2.middleware.grouper.internal.dao.QueryOptions)

findAllChildMembershipGroupsSecure

public Set<Group> findAllChildMembershipGroupsSecure(Stem ns,
                                                     Stem.Scope scope,
                                                     GrouperSession grouperSession,
                                                     edu.internet2.middleware.subject.Subject subject,
                                                     Set<Privilege> inPrivSet,
                                                     QueryOptions queryOptions)
                                              throws GrouperDAOException
Description copied from interface: StemDAO
Find all child groups within specified scope, and make sure the grouper session can see them

Specified by:
findAllChildMembershipGroupsSecure in interface StemDAO
inPrivSet - is a set of privs that the subject must have one of to display a row. AccessPrivilege has some pre-baked set constants available
Returns:
the groups
Throws:
GrouperDAOException
See Also:
StemDAO.findAllChildMembershipGroupsSecure(edu.internet2.middleware.grouper.Stem, edu.internet2.middleware.grouper.Stem.Scope, edu.internet2.middleware.grouper.GrouperSession, edu.internet2.middleware.subject.Subject, java.util.Set, edu.internet2.middleware.grouper.internal.dao.QueryOptions)

findAllChildStemsSecure

public Set<Stem> findAllChildStemsSecure(Stem ns,
                                         Stem.Scope scope,
                                         GrouperSession grouperSession,
                                         edu.internet2.middleware.subject.Subject subject,
                                         Set<Privilege> inPrivSet,
                                         QueryOptions queryOptions)
                                  throws GrouperDAOException
Description copied from interface: StemDAO
Find all child stems within specified scope, and make sure the grouper session can see them

Specified by:
findAllChildStemsSecure in interface StemDAO
inPrivSet - is a set of privs that the subject must have one of to display a row. NamingPrivilege has some pre-baked set constants available
Returns:
the groups
Throws:
GrouperDAOException
See Also:
StemDAO.findAllChildStemsSecure(edu.internet2.middleware.grouper.Stem, edu.internet2.middleware.grouper.Stem.Scope, edu.internet2.middleware.grouper.GrouperSession, edu.internet2.middleware.subject.Subject, java.util.Set, edu.internet2.middleware.grouper.internal.dao.QueryOptions)

getImmediateChildrenSecure

public Set<Stem> getImmediateChildrenSecure(GrouperSession grouperSession,
                                            Stem stem,
                                            edu.internet2.middleware.subject.Subject subject,
                                            Set<Privilege> inPrivSet,
                                            QueryOptions queryOptions)
                                     throws GrouperDAOException
Description copied from interface: StemDAO
get immediate children (stems) secure

Specified by:
getImmediateChildrenSecure in interface StemDAO
inPrivSet - means that each row must have a matching priv in this set to user or GrouperAll. There are some constants in AccessPrivilege of pre-canned sets
Returns:
the set of groups
Throws:
GrouperDAOException
See Also:
StemDAO.getImmediateChildrenSecure(edu.internet2.middleware.grouper.GrouperSession, edu.internet2.middleware.grouper.Stem, edu.internet2.middleware.subject.Subject, java.util.Set, edu.internet2.middleware.grouper.internal.dao.QueryOptions)

getAllStemsSecure

public Set<Stem> getAllStemsSecure(GrouperSession grouperSession,
                                   edu.internet2.middleware.subject.Subject subject,
                                   Set<Privilege> inPrivSet,
                                   QueryOptions queryOptions)
                            throws GrouperDAOException
Specified by:
getAllStemsSecure in interface StemDAO
inPrivSet - means that each row must have a matching priv in this set to user or GrouperAll. There are some constants in NamingPrivilege of pre-canned sets
Returns:
stems
Throws:
GrouperDAOException
See Also:
StemDAO.getAllStemsSecure(edu.internet2.middleware.grouper.GrouperSession, edu.internet2.middleware.subject.Subject, java.util.Set, edu.internet2.middleware.grouper.internal.dao.QueryOptions)

getAllStemsSecure

public Set<Stem> getAllStemsSecure(String scope,
                                   GrouperSession grouperSession,
                                   edu.internet2.middleware.subject.Subject subject,
                                   Set<Privilege> inPrivSet,
                                   QueryOptions queryOptions)
                            throws GrouperDAOException
Specified by:
getAllStemsSecure in interface StemDAO
Parameters:
scope - is blank for no scope
inPrivSet - means that each row must have a matching priv in this set to user or GrouperAll. There are some constants in NamingPrivilege of pre-canned sets
Returns:
the stems
Throws:
GrouperDAOException
See Also:
StemDAO.getAllStemsSecure(java.lang.String, edu.internet2.middleware.grouper.GrouperSession, edu.internet2.middleware.subject.Subject, java.util.Set, edu.internet2.middleware.grouper.internal.dao.QueryOptions)

createChildAttributeDefName

public void createChildAttributeDefName(Stem _parent,
                                        AttributeDefName attributeDefName)
                                 throws GrouperDAOException
Specified by:
createChildAttributeDefName in interface StemDAO
Parameters:
_parent -
attributeDefName -
Throws:
GrouperDAOException

updateLastMembershipChange

public void updateLastMembershipChange(String stemId)
Specified by:
updateLastMembershipChange in interface StemDAO
See Also:
StemDAO.updateLastMembershipChange(java.lang.String)

updateLastMembershipChangeIncludeAncestorGroups

public void updateLastMembershipChangeIncludeAncestorGroups(String groupId)
Description copied from interface: StemDAO
This will update last_membership_change for stem owners where group member in groupSet is the given groupId.

Specified by:
updateLastMembershipChangeIncludeAncestorGroups in interface StemDAO
See Also:
StemDAO.updateLastMembershipChangeIncludeAncestorGroups(java.lang.String)

findByName

public Stem findByName(String name,
                       boolean exceptionIfNull,
                       QueryOptions queryOptions)
                throws GrouperDAOException,
                       StemNotFoundException
Specified by:
findByName in interface StemDAO
Parameters:
name -
exceptionIfNull -
Returns:
stem
Throws:
GrouperDAOException
StemNotFoundException

findByUuid

public Stem findByUuid(String uuid,
                       boolean exceptionIfNull,
                       QueryOptions queryOptions)
                throws GrouperDAOException,
                       StemNotFoundException
Specified by:
findByUuid in interface StemDAO
Parameters:
uuid -
exceptionIfNull -
queryOptions -
Returns:
stem
Throws:
GrouperDAOException
StemNotFoundException