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

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

public class AttributeDefFinder
extends Object

finder methods for attribute def


Constructor Summary
AttributeDefFinder()
           
 
Method Summary
 AttributeDefFinder addAttributeDefId(String attributeDefId)
          add a attribute def id to search for
 AttributeDefFinder addPrivilege(Privilege privilege)
          add a privilege to filter by that the subject has on the attribute definition
 AttributeDefFinder assignAttributeDefIds(Collection<String> theAttributeDefIds)
          assign attributeDef ids to search for
 AttributeDefFinder assignFindByUuidOrName(boolean theFindByUuidOrName)
          if we are looking up a attribute def, only look by uuid or name
 AttributeDefFinder assignParentStemId(String theParentStemId)
          parent or ancestor stem of the attribute def
 AttributeDefFinder assignPrivileges(Set<Privilege> thePrivileges)
          assign privileges to filter by that the subject has on the attribute definition
 AttributeDefFinder assignQueryOptions(QueryOptions theQueryOptions)
          if sorting, paging, caching, etc
 AttributeDefFinder assignScope(String theScope)
          scope to look for attribute defs Wildcards will be appended or percent is the wildcard
 AttributeDefFinder assignSplitScope(boolean theSplitScope)
          if the scope has spaces in it, then split by whitespace, and find results that contain all of the scope strings
 AttributeDefFinder assignStemScope(Stem.Scope theStemScope)
          if passing in a stem, this is the stem scope...
 AttributeDefFinder assignSubject(edu.internet2.middleware.subject.Subject theSubject)
          this is the subject that has certain privileges or is in the service
 AttributeDef findAttribute()
          find the attributeDef
 Set<AttributeDef> findAttributes()
          find all the attribute defs
static AttributeDef findByAttributeDefNameId(String id, boolean exceptionIfNull)
          find an attributeDef by attribute def name id.
static AttributeDef findById(String id, boolean exceptionIfNull)
          find an attributeDef by id.
static AttributeDef findById(String id, boolean exceptionIfNull, QueryOptions queryOptions)
          find an attributeDef by id.
static AttributeDef findByIdIndexSecure(Long idIndex, boolean exceptionIfNotFound, QueryOptions queryOptions)
          Find an attributeDef within the registry by ID index.
static AttributeDef findByName(String name, boolean exceptionIfNull)
          find an attributeDef by name.
static AttributeDef findByName(String name, boolean exceptionIfNull, QueryOptions queryOptions)
          find an attributeDef by name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeDefFinder

public AttributeDefFinder()
Method Detail

findById

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

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

findById

public static AttributeDef findById(String id,
                                    boolean exceptionIfNull,
                                    QueryOptions queryOptions)
find an attributeDef by id. This is a secure method, a GrouperSession must be open

Parameters:
id - of attributeDef
exceptionIfNull - true if exception should be thrown if null
queryOptions -
Returns:
the attribute def or null
Throws:
AttributeDefNotFoundException

findByAttributeDefNameId

public static AttributeDef findByAttributeDefNameId(String id,
                                                    boolean exceptionIfNull)
find an attributeDef by attribute def name id. This is a secure method, a GrouperSession must be open

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

findByName

public static AttributeDef findByName(String name,
                                      boolean exceptionIfNull,
                                      QueryOptions queryOptions)
find an attributeDef by name. This is a secure method, a GrouperSession must be open

Parameters:
name - of attributeDef
exceptionIfNull - true if exception should be thrown if null
queryOptions -
Returns:
the attribute def or null
Throws:
AttributeDefNotFoundException

findByName

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

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

findByIdIndexSecure

public static AttributeDef findByIdIndexSecure(Long idIndex,
                                               boolean exceptionIfNotFound,
                                               QueryOptions queryOptions)
                                        throws AttributeDefNotFoundException
Find an attributeDef within the registry by ID index.

Parameters:
idIndex - id index of attributeDef to find.
exceptionIfNotFound - true if exception if not found
queryOptions -
Returns:
A AttributeDef
Throws:
AttributeDefNotFoundException - if not found an exceptionIfNotFound is true

addPrivilege

public AttributeDefFinder 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

assignParentStemId

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

Parameters:
theParentStemId -
Returns:
this for chaining

assignPrivileges

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

Parameters:
thePrivileges -
Returns:
this for chaining

assignQueryOptions

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

Parameters:
theQueryOptions -
Returns:
this for chaining

assignScope

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

Parameters:
theScope -
Returns:
this for chaining

assignSplitScope

public AttributeDefFinder 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

assignStemScope

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

Parameters:
theStemScope -
Returns:
this for chaining

assignSubject

public AttributeDefFinder 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

findAttributes

public Set<AttributeDef> findAttributes()
find all the attribute defs

Returns:
the set of attribute defs or the empty set if none found

assignFindByUuidOrName

public AttributeDefFinder assignFindByUuidOrName(boolean theFindByUuidOrName)
if we are looking up a attribute def, only look by uuid or name

Parameters:
theFindByUuidOrName -
Returns:
the attribute def finder

findAttribute

public AttributeDef findAttribute()
find the attributeDef

Returns:
the attributeDef or null

addAttributeDefId

public AttributeDefFinder addAttributeDefId(String attributeDefId)
add a attribute def id to search for

Parameters:
attributeDefId -
Returns:
this for chaining

assignAttributeDefIds

public AttributeDefFinder assignAttributeDefIds(Collection<String> theAttributeDefIds)
assign attributeDef ids to search for

Parameters:
theAttributeDefIds -
Returns:
this for chaining