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

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

public class Hib3AttributeDefNameDAO
extends Hib3DAO
implements AttributeDefNameDAO

Data Access Object for attribute def name

Version:
$Id: Hib3AttributeDefNameDAO.java,v 1.6 2009-11-17 02:52:29 mchyzer Exp $
Author:
mchyzer

Field Summary
 
Fields inherited from class edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
hibernateInitted
 
Constructor Summary
Hib3AttributeDefNameDAO()
           
 
Method Summary
 void delete(AttributeDefName attributeDefName)
          delete this attribute def name
 Set<AttributeDefName> findAllAttributeNamesSecure(String scope, boolean splitScope, GrouperSession grouperSession, String attributeDefId, edu.internet2.middleware.subject.Subject subject, Set<Privilege> privileges, QueryOptions queryOptions, AttributeAssignType attributeAssignType, AttributeDefType attributeDefType)
          get all attribute names secure, split the scope by whitespace
 Set<AttributeDefName> findAllAttributeNamesSecure(String scope, boolean splitScope, GrouperSession grouperSession, String attributeDefId, edu.internet2.middleware.subject.Subject subject, Set<Privilege> privileges, QueryOptions queryOptions, AttributeAssignType attributeAssignType, AttributeDefType attributeDefType, ServiceRole serviceRole, boolean anyServiceRole)
          get all attribute names secure, split the scope by whitespace
 Set<AttributeDefName> findAllAttributeNamesSecure(String scope, boolean splitScope, GrouperSession grouperSession, String attributeDefId, edu.internet2.middleware.subject.Subject subject, Set<Privilege> privileges, QueryOptions queryOptions, AttributeAssignType attributeAssignType, AttributeDefType attributeDefType, ServiceRole serviceRole, boolean anyServiceRole, String parentStemId, Stem.Scope stemScope, boolean findByUuidOrName)
          get all attribute names secure, split the scope by whitespace
 Set<AttributeDefName> findAllAttributeNamesSecure(String scope, boolean splitScope, GrouperSession grouperSession, String attributeDefId, edu.internet2.middleware.subject.Subject subject, Set<Privilege> privileges, QueryOptions queryOptions, AttributeAssignType attributeAssignType, AttributeDefType attributeDefType, ServiceRole serviceRole, boolean anyServiceRole, String parentStemId, Stem.Scope stemScope, boolean findByUuidOrName, Set<String> idsOfAttributeDefNames)
          get all attribute names secure, split the scope by whitespace
 Set<AttributeDefName> findAllAttributeNamesSplitScopeSecure(String scope, GrouperSession grouperSession, String attributeDefId, edu.internet2.middleware.subject.Subject subject, Set<Privilege> privileges, QueryOptions queryOptions, AttributeAssignType attributeAssignType, AttributeDefType attributeDefType)
          get all attribute names secure, split the scope by whitespace
 Set<AttributeDefName> findAllSecure(String searchField, Set<String> searchInAttributeDefIds, QueryOptions queryOptions)
          search for attributeDefName by name, display name, or description.
 Set<AttributeDefName> findByAttributeDef(String id)
          Find all that have the given attribute def id.
 Set<AttributeDefName> findByAttributeDefLike(String attributeDefId, String likeString)
          search for all by attribute def id, and like string
 AttributeDefName findById(String id, boolean exceptionIfNotFound)
           
 AttributeDefName findByIdIndex(Long idIndex, boolean exceptionIfNotFound, QueryOptions queryOptions)
          not a secure method, find by id index
 AttributeDefName findByIdIndexSecure(Long idIndex, boolean exceptionIfNotFound, QueryOptions queryOptions)
          secure method, find by id index
 AttributeDefName findByIdSecure(String id, boolean exceptionIfNotFound)
           
 Set<AttributeDefName> findByIdsSecure(Collection<String> ids, QueryOptions queryOptions)
          find by ids secure
 AttributeDefName findByNameSecure(String name, boolean exceptionIfNotFound)
          find an attribute def name by name
 AttributeDefName findByNameSecure(String name, boolean exceptionIfNotFound, QueryOptions queryOptions)
          find an attribute def name by name
 Set<AttributeDefName> findByStem(String id)
          Find all that have the given stem id.
 AttributeDefName findByUuidOrName(String id, String name, boolean exceptionIfNotFound)
          find a record by uuid or name
 AttributeDefName findByUuidOrName(String id, String name, boolean exceptionIfNotFound, QueryOptions queryOptions)
          find a record by uuid or name
 AttributeDefName findLegacyAttributeByName(String name, boolean exceptionIfNull)
          Returns legacy attribute that was either migrated or created in the new attribute framework.
 void saveOrUpdate(AttributeDefName attributeDefName)
          insert or update an attribute def name object
 void saveUpdateProperties(AttributeDefName attributeDefName)
          save the update properties which are auto saved when business method is called
 
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
 

Constructor Detail

Hib3AttributeDefNameDAO

public Hib3AttributeDefNameDAO()
Method Detail

findByIdSecure

public AttributeDefName findByIdSecure(String id,
                                       boolean exceptionIfNotFound)
Specified by:
findByIdSecure in interface AttributeDefNameDAO
Returns:
the attribute def name or null if not there
See Also:
AttributeDefNameDAO.findByIdSecure(java.lang.String, boolean)

findById

public AttributeDefName findById(String id,
                                 boolean exceptionIfNotFound)
Specified by:
findById in interface AttributeDefNameDAO
Returns:
the attribute def name or null if not there
See Also:
AttributeDefNameDAO.findById(java.lang.String, boolean)

saveOrUpdate

public void saveOrUpdate(AttributeDefName attributeDefName)
Description copied from interface: AttributeDefNameDAO
insert or update an attribute def name object

Specified by:
saveOrUpdate in interface AttributeDefNameDAO
See Also:
AttributeDefNameDAO.saveOrUpdate(edu.internet2.middleware.grouper.attr.AttributeDefName)

findByNameSecure

public AttributeDefName findByNameSecure(String name,
                                         boolean exceptionIfNotFound,
                                         QueryOptions queryOptions)
                                  throws GrouperDAOException,
                                         AttributeDefNameNotFoundException
Description copied from interface: AttributeDefNameDAO
find an attribute def name by name

Specified by:
findByNameSecure in interface AttributeDefNameDAO
Returns:
name
Throws:
GrouperDAOException
AttributeDefNameNotFoundException
See Also:
AttributeDefNameDAO.findByNameSecure(java.lang.String, boolean, edu.internet2.middleware.grouper.internal.dao.QueryOptions)

findByNameSecure

public AttributeDefName findByNameSecure(String name,
                                         boolean exceptionIfNotFound)
                                  throws GrouperDAOException,
                                         AttributeDefNameNotFoundException
Description copied from interface: AttributeDefNameDAO
find an attribute def name by name

Specified by:
findByNameSecure in interface AttributeDefNameDAO
Returns:
name
Throws:
GrouperDAOException
AttributeDefNameNotFoundException
See Also:
AttributeDefNameDAO.findByNameSecure(java.lang.String, boolean)

delete

public void delete(AttributeDefName attributeDefName)
Description copied from interface: AttributeDefNameDAO
delete this attribute def name

Specified by:
delete in interface AttributeDefNameDAO
See Also:
AttributeDefNameDAO.delete(AttributeDefName)

findByStem

public Set<AttributeDefName> findByStem(String id)
Description copied from interface: AttributeDefNameDAO
Find all that have the given stem id.

Specified by:
findByStem in interface AttributeDefNameDAO
Returns:
set of attribute def names
See Also:
AttributeDefNameDAO.findByStem(java.lang.String)

findByUuidOrName

public AttributeDefName findByUuidOrName(String id,
                                         String name,
                                         boolean exceptionIfNotFound)
Description copied from interface: AttributeDefNameDAO
find a record by uuid or name

Specified by:
findByUuidOrName in interface AttributeDefNameDAO
Returns:
the attribute def name
See Also:
AttributeDefNameDAO.findByUuidOrName(java.lang.String, java.lang.String, boolean)

findByUuidOrName

public AttributeDefName findByUuidOrName(String id,
                                         String name,
                                         boolean exceptionIfNotFound,
                                         QueryOptions queryOptions)
Description copied from interface: AttributeDefNameDAO
find a record by uuid or name

Specified by:
findByUuidOrName in interface AttributeDefNameDAO
Returns:
the attribute def name
See Also:
AttributeDefNameDAO.findByUuidOrName(java.lang.String, java.lang.String, boolean, QueryOptions)

saveUpdateProperties

public void saveUpdateProperties(AttributeDefName attributeDefName)
Description copied from interface: AttributeDefNameDAO
save the update properties which are auto saved when business method is called

Specified by:
saveUpdateProperties in interface AttributeDefNameDAO
See Also:
AttributeDefNameDAO.saveUpdateProperties(edu.internet2.middleware.grouper.attr.AttributeDefName)

findByAttributeDef

public Set<AttributeDefName> findByAttributeDef(String id)
Description copied from interface: AttributeDefNameDAO
Find all that have the given attribute def id.

Specified by:
findByAttributeDef in interface AttributeDefNameDAO
Returns:
set of attribute def names
See Also:
AttributeDefNameDAO.findByAttributeDef(java.lang.String)

findAllSecure

public Set<AttributeDefName> findAllSecure(String searchField,
                                           Set<String> searchInAttributeDefIds,
                                           QueryOptions queryOptions)
Description copied from interface: AttributeDefNameDAO
search for attributeDefName by name, display name, or description. This is a secure method, a GrouperSession must be open. Note, you should add the % signs before calling this method

Specified by:
findAllSecure in interface AttributeDefNameDAO
Parameters:
searchField - substring to search for
searchInAttributeDefIds - ids to search in or null for all
Returns:
the attribute def names or empty set
See Also:
AttributeDefNameDAO.findAllSecure(java.lang.String, java.util.Set, QueryOptions)

findByAttributeDefLike

public Set<AttributeDefName> findByAttributeDefLike(String attributeDefId,
                                                    String likeString)
Description copied from interface: AttributeDefNameDAO
search for all by attribute def id, and like string

Specified by:
findByAttributeDefLike in interface AttributeDefNameDAO
Returns:
the attribute def names or empty set
See Also:
AttributeDefNameDAO.findByAttributeDefLike(String, String)

findAllAttributeNamesSecure

public Set<AttributeDefName> findAllAttributeNamesSecure(String scope,
                                                         boolean splitScope,
                                                         GrouperSession grouperSession,
                                                         String attributeDefId,
                                                         edu.internet2.middleware.subject.Subject subject,
                                                         Set<Privilege> privileges,
                                                         QueryOptions queryOptions,
                                                         AttributeAssignType attributeAssignType,
                                                         AttributeDefType attributeDefType)
Description copied from interface: AttributeDefNameDAO
get all attribute names secure, split the scope by whitespace

Specified by:
findAllAttributeNamesSecure in interface AttributeDefNameDAO
attributeDefId - optional if filtering by names in a certain attribute definition
Returns:
set of attribute defs
See Also:
AttributeDefNameDAO.findAllAttributeNamesSecure(String, boolean, GrouperSession, String, Subject, Set, QueryOptions, AttributeAssignType, AttributeDefType)

findByIdIndex

public AttributeDefName findByIdIndex(Long idIndex,
                                      boolean exceptionIfNotFound,
                                      QueryOptions queryOptions)
                               throws AttributeDefNameNotFoundException
not a secure method, find by id index

Specified by:
findByIdIndex in interface AttributeDefNameDAO
Throws:
AttributeDefNameNotFoundException

findByIdIndexSecure

public AttributeDefName findByIdIndexSecure(Long idIndex,
                                            boolean exceptionIfNotFound,
                                            QueryOptions queryOptions)
                                     throws AttributeDefNameNotFoundException
secure method, find by id index

Specified by:
findByIdIndexSecure in interface AttributeDefNameDAO
Throws:
AttributeDefNameNotFoundException

findAllAttributeNamesSecure

public Set<AttributeDefName> findAllAttributeNamesSecure(String scope,
                                                         boolean splitScope,
                                                         GrouperSession grouperSession,
                                                         String attributeDefId,
                                                         edu.internet2.middleware.subject.Subject subject,
                                                         Set<Privilege> privileges,
                                                         QueryOptions queryOptions,
                                                         AttributeAssignType attributeAssignType,
                                                         AttributeDefType attributeDefType,
                                                         ServiceRole serviceRole,
                                                         boolean anyServiceRole)
Description copied from interface: AttributeDefNameDAO
get all attribute names secure, split the scope by whitespace

Specified by:
findAllAttributeNamesSecure in interface AttributeDefNameDAO
attributeDefId - optional if filtering by names in a certain attribute definition
anyServiceRole - will see if the user has any role in a service, and return those services
Returns:
set of attribute defs
See Also:
AttributeDefNameDAO.findAllAttributeNamesSecure(String, boolean, GrouperSession, String, Subject, Set, QueryOptions, AttributeAssignType, AttributeDefType, ServiceRole, boolean)

findAllAttributeNamesSplitScopeSecure

public Set<AttributeDefName> findAllAttributeNamesSplitScopeSecure(String scope,
                                                                   GrouperSession grouperSession,
                                                                   String attributeDefId,
                                                                   edu.internet2.middleware.subject.Subject subject,
                                                                   Set<Privilege> privileges,
                                                                   QueryOptions queryOptions,
                                                                   AttributeAssignType attributeAssignType,
                                                                   AttributeDefType attributeDefType)
Description copied from interface: AttributeDefNameDAO
get all attribute names secure, split the scope by whitespace

Specified by:
findAllAttributeNamesSplitScopeSecure in interface AttributeDefNameDAO
attributeDefId - optional if filtering by names in a certain attribute definition
Returns:
set of attribute defs
See Also:
AttributeDefNameDAO.findAllAttributeNamesSplitScopeSecure(String, GrouperSession, String, Subject, Set, QueryOptions, AttributeAssignType, AttributeDefType)

findLegacyAttributeByName

public AttributeDefName findLegacyAttributeByName(String name,
                                                  boolean exceptionIfNull)
Description copied from interface: AttributeDefNameDAO
Returns legacy attribute that was either migrated or created in the new attribute framework.

Specified by:
findLegacyAttributeByName in interface AttributeDefNameDAO
Parameters:
name - the name of the legacy attribute (without prefix or path)
Returns:
attribute def name
See Also:
AttributeDefNameDAO.findLegacyAttributeByName(java.lang.String, boolean)

findByIdsSecure

public Set<AttributeDefName> findByIdsSecure(Collection<String> ids,
                                             QueryOptions queryOptions)
Description copied from interface: AttributeDefNameDAO
find by ids secure

Specified by:
findByIdsSecure in interface AttributeDefNameDAO
Returns:
the attributeDefNames or null or exception
See Also:
AttributeDefNameDAO.findByIdsSecure(Collection, QueryOptions)

findAllAttributeNamesSecure

public Set<AttributeDefName> findAllAttributeNamesSecure(String scope,
                                                         boolean splitScope,
                                                         GrouperSession grouperSession,
                                                         String attributeDefId,
                                                         edu.internet2.middleware.subject.Subject subject,
                                                         Set<Privilege> privileges,
                                                         QueryOptions queryOptions,
                                                         AttributeAssignType attributeAssignType,
                                                         AttributeDefType attributeDefType,
                                                         ServiceRole serviceRole,
                                                         boolean anyServiceRole,
                                                         String parentStemId,
                                                         Stem.Scope stemScope,
                                                         boolean findByUuidOrName)
Description copied from interface: AttributeDefNameDAO
get all attribute names secure, split the scope by whitespace

Specified by:
findAllAttributeNamesSecure in interface AttributeDefNameDAO
attributeDefId - optional if filtering by names in a certain attribute definition
anyServiceRole - will see if the user has any role in a service, and return those services
parentStemId - is the id of the parent or ancestor of the object returned
stemScope - is if the stem scope is ONE or SUB
findByUuidOrName - if looking for attribute def names by uuid or name
Returns:
set of attribute defs
See Also:
AttributeDefNameDAO#findAllAttributeNamesSecure(String, boolean, GrouperSession, String, Subject, Set, QueryOptions, AttributeAssignType, AttributeDefType, ServiceRole, boolean, String, Scope, boolean)

findAllAttributeNamesSecure

public Set<AttributeDefName> findAllAttributeNamesSecure(String scope,
                                                         boolean splitScope,
                                                         GrouperSession grouperSession,
                                                         String attributeDefId,
                                                         edu.internet2.middleware.subject.Subject subject,
                                                         Set<Privilege> privileges,
                                                         QueryOptions queryOptions,
                                                         AttributeAssignType attributeAssignType,
                                                         AttributeDefType attributeDefType,
                                                         ServiceRole serviceRole,
                                                         boolean anyServiceRole,
                                                         String parentStemId,
                                                         Stem.Scope stemScope,
                                                         boolean findByUuidOrName,
                                                         Set<String> idsOfAttributeDefNames)
Description copied from interface: AttributeDefNameDAO
get all attribute names secure, split the scope by whitespace

Specified by:
findAllAttributeNamesSecure in interface AttributeDefNameDAO
attributeDefId - optional if filtering by names in a certain attribute definition
anyServiceRole - will see if the user has any role in a service, and return those services
parentStemId - is the id of the parent or ancestor of the object returned
stemScope - is if the stem scope is ONE or SUB
findByUuidOrName - if looking for attribute def names by uuid or name
idsOfAttributeDefNames - ids of attribute def names to lookup
Returns:
set of attribute defs
See Also:
AttributeDefNameDAO#findAllAttributeNamesSecure(String, boolean, GrouperSession, String, Subject, Set, QueryOptions, AttributeAssignType, AttributeDefType, ServiceRole, boolean, String, Scope, boolean, Set)