edu.internet2.middleware.grouper.attr.finder
Class AttributeDefNameFinder

java.lang.Object
  extended by edu.internet2.middleware.grouper.attr.finder.AttributeDefNameFinder

public class AttributeDefNameFinder
extends Object

finder methods for attribute def name. the chained API is secure based on the static grouper session


Constructor Summary
AttributeDefNameFinder()
           
 
Method Summary
 AttributeDefNameFinder addIdOfAttributeDefName(String theIdsOfAttributeDefName)
          id of attribute def name
 AttributeDefNameFinder addPrivilege(Privilege privilege)
          add a privilege to filter by that the subject has on the attribute definition
 AttributeDefNameFinder assignAnyRole(boolean theAnyRole)
          mutually exclusive with serviceRole...
 AttributeDefNameFinder assignAttributeAssignType(AttributeAssignType theAttributeAssignType)
          the type of assignment that the attributes can have
 AttributeDefNameFinder assignAttributeDefId(String theAttributeDefId)
          find attribute def names based on one attribute definition
 AttributeDefNameFinder assignFindByUuidOrName(boolean theFindByUuidOrName)
          if we are looking up an attributedefname, only look by uuid or name
 AttributeDefNameFinder assignParentStemId(String theParentStemId)
          parent or ancestor stem of the attribute def
 AttributeDefNameFinder assignPrivileges(Set<Privilege> thePrivileges)
          assign privileges to filter by that the subject has on the attribute definition
 AttributeDefNameFinder assignQueryOptions(QueryOptions theQueryOptions)
          if sorting, paging, caching, etc
 AttributeDefNameFinder assignScope(String theScope)
          scope to look for attribute def names Wildcards will be appended or percent is the wildcard
 AttributeDefNameFinder assignServiceRole(ServiceRole theServiceRole)
          if filtering by service, this is the service role, or null for all
 AttributeDefNameFinder assignSplitScope(boolean theSplitScope)
          if the scope has spaces in it, then split by whitespace, and find results that contain all of the scope strings
 AttributeDefNameFinder assignStemScope(Stem.Scope theStemScope)
          if passing in a stem, this is the stem scope...
 AttributeDefNameFinder assignSubject(edu.internet2.middleware.subject.Subject theSubject)
          this is the subject that has certain privileges or is in the service
static Set<AttributeDefName> findAll(String searchField, Set<String> searchInAttributeDefIds, QueryOptions queryOptions)
          search for attributeDefName by name, display name, or description.
 AttributeDefName findAttributeName()
          find the stem
 Set<AttributeDefName> findAttributeNames()
          find all the attribute def names
static AttributeDefName findById(String id, boolean exceptionIfNull)
          find an attributeDefName by id.
static AttributeDefName findByIdIndexSecure(Long idIndex, boolean exceptionIfNotFound, QueryOptions queryOptions)
          Find an attributeDefName within the registry by ID index.
static AttributeDefName findByName(String name, boolean exceptionIfNull)
          find an attributeDefName by name.
static AttributeDefName findByNameCache(String name, boolean exceptionIfNull)
          find an attributeDefName by name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeDefNameFinder

public AttributeDefNameFinder()
Method Detail

addIdOfAttributeDefName

public AttributeDefNameFinder addIdOfAttributeDefName(String theIdsOfAttributeDefName)
id of attribute def name

Parameters:
theIdsOfAttributeDefName -
Returns:
this for chaining

assignParentStemId

public AttributeDefNameFinder assignParentStemId(String theParentStemId)
parent or ancestor stem of the attribute def

Parameters:
theParentStemId -
Returns:
this for chaining

assignStemScope

public AttributeDefNameFinder assignStemScope(Stem.Scope theStemScope)
if passing in a stem, this is the stem scope...

Parameters:
theStemScope -
Returns:
this for chaining

assignScope

public AttributeDefNameFinder assignScope(String theScope)
scope to look for attribute def names Wildcards will be appended or percent is the wildcard

Parameters:
theScope -
Returns:
this for chaining

assignAttributeDefId

public AttributeDefNameFinder assignAttributeDefId(String theAttributeDefId)
find attribute def names based on one attribute definition

Parameters:
theAttributeDefId -
Returns:
this for chaining

assignServiceRole

public AttributeDefNameFinder assignServiceRole(ServiceRole theServiceRole)
if filtering by service, this is the service role, or null for all

Parameters:
theServiceRole -
Returns:
this for chaining

assignSubject

public AttributeDefNameFinder assignSubject(edu.internet2.middleware.subject.Subject theSubject)
this is the subject that has certain privileges or is in the service

Parameters:
theSubject -
Returns:
this for chaining

assignPrivileges

public AttributeDefNameFinder assignPrivileges(Set<Privilege> thePrivileges)
assign privileges to filter by that the subject has on the attribute definition

Parameters:
thePrivileges -
Returns:
this for chaining

addPrivilege

public AttributeDefNameFinder addPrivilege(Privilege privilege)
add a privilege to filter by that the subject has on the attribute definition

Parameters:
privilege - should be AttributeDefPrivilege
Returns:
this for chaining

assignQueryOptions

public AttributeDefNameFinder assignQueryOptions(QueryOptions theQueryOptions)
if sorting, paging, caching, etc

Parameters:
theQueryOptions -
Returns:
this for chaining

assignSplitScope

public AttributeDefNameFinder assignSplitScope(boolean theSplitScope)
if the scope has spaces in it, then split by whitespace, and find results that contain all of the scope strings

Parameters:
theSplitScope -
Returns:
this for chaining

assignAttributeAssignType

public AttributeDefNameFinder assignAttributeAssignType(AttributeAssignType theAttributeAssignType)
the type of assignment that the attributes can have

Parameters:
theAttributeAssignType -
Returns:
this for chaining

findById

public static AttributeDefName findById(String id,
                                        boolean exceptionIfNull)
find an attributeDefName by id. This is a secure method, a GrouperSession must be open

Parameters:
id - of attributeDefName
exceptionIfNull - true if exception should be thrown if null
Returns:
the attribute def or null
Throws:
AttributeDefNameNotFoundException

findAttributeNames

public Set<AttributeDefName> findAttributeNames()
find all the attribute def names

Returns:
the set of attribute def names or the empty set if none found

assignAnyRole

public AttributeDefNameFinder assignAnyRole(boolean theAnyRole)
mutually exclusive with serviceRole... this is true if looking for services where the user has any role

Parameters:
theAnyRole -
Returns:
this for chaining

assignFindByUuidOrName

public AttributeDefNameFinder assignFindByUuidOrName(boolean theFindByUuidOrName)
if we are looking up an attributedefname, only look by uuid or name

Parameters:
theFindByUuidOrName -
Returns:
the attribute def name finder

findAttributeName

public AttributeDefName findAttributeName()
find the stem

Returns:
the stem or null

findByIdIndexSecure

public static AttributeDefName findByIdIndexSecure(Long idIndex,
                                                   boolean exceptionIfNotFound,
                                                   QueryOptions queryOptions)
                                            throws AttributeDefNameNotFoundException
Find an attributeDefName within the registry by ID index.

Parameters:
idIndex - id index of attributeDefName to find.
exceptionIfNotFound - true if exception if not found
queryOptions -
Returns:
A AttributeDefName
Throws:
AttributeDefNameNotFoundException - if not found an exceptionIfNotFound is true

findByName

public static AttributeDefName findByName(String name,
                                          boolean exceptionIfNull)
find an attributeDefName by name. This is a secure method, a GrouperSession must be open

Parameters:
name - of attributeDefName
exceptionIfNull - true if exception should be thrown if null
Returns:
the attribute def name or null
Throws:
AttributeDefNameNotFoundException

findByNameCache

public static AttributeDefName findByNameCache(String name,
                                               boolean exceptionIfNull)
find an attributeDefName by name. This is a secure method, a GrouperSession must be open. This will cache the result

Parameters:
name - of attributeDefName
exceptionIfNull - true if exception should be thrown if null
Returns:
the attribute def name or null
Throws:
AttributeDefNameNotFoundException

findAll

public static Set<AttributeDefName> findAll(String searchField,
                                            Set<String> searchInAttributeDefIds,
                                            QueryOptions queryOptions)
search for attributeDefName by name, display name, or description. This is a secure method, a GrouperSession must be open. You need to add %'s to it for wildcards

Parameters:
searchField - substring to search for
searchInAttributeDefIds - ids to search in or null for all
queryOptions -
Returns:
the attribute def names or empty set