public class StemFinder extends Object
Use this class to find stems within the registry
Sample call
Stem stem = StemFinder.findByName(grouperSession, "test", true);
Sample call to find stems where an attribute def name and a value is assigned
Setstems = new StemFinder().assignNameOfAttributeDefName(attributeDefName.getName()) .assignPrivileges(NamingPrivilege.ATTRIBUTE_READ_PRIVILEGES).assignAttributeValue("abc").findStems();
Constructor and Description |
---|
StemFinder() |
Modifier and Type | Method and Description |
---|---|
StemFinder |
addAttributeValuesOnAssignment(Object value)
if looking for an attribute value on an assignment, could be multiple values
|
StemFinder |
addAttributeValuesOnAssignment2(Object value)
if looking for an attribute value on an assignment2, could be multiple values
|
StemFinder |
addPrivilege(Privilege privilege)
add a privilege to filter by that the subject has on the stem
|
StemFinder |
addStemId(String stemId)
add a stem id to search for
|
StemFinder |
addUserHasInAttributeField(Field theUserHasInAttributeField)
find stems where the user has these fields in an attribute
|
StemFinder |
addUserHasInGroupField(Field theUserHasInGroupField)
find stems where the user has these fields in a group
|
StemFinder |
assignAttributeCheckReadOnAttributeDef(boolean theAttributeCheckReadOnAttributeDef)
check read on attribute def when checking attribute def name
|
StemFinder |
assignAttributeNotAssigned(boolean attributeNotAssigned)
find stems that don't have a certain type assigned
|
StemFinder |
assignAttributeValue(Object theValue)
find objects with this value
|
StemFinder |
assignAttributeValuesOnAssignment(Set<Object> theValues)
if looking for an attribute value on an assignment, could be multiple values
|
StemFinder |
assignAttributeValuesOnAssignment2(Set<Object> theValues)
if looking for an attribute value on an assignment2, could be multiple values
|
StemFinder |
assignFindByUuidOrName(boolean theFindByUuidOrName)
if we are looking up a stem, only look by uuid or name
|
StemFinder |
assignIdOfAttributeDefName(String theAttributeDefNameId)
find stems that have this attribute def name id, note could be an assignment on an assignment
|
StemFinder |
assignIdOfAttributeDefName2(String theAttributeDefNameId)
find stems that have this attribute def name id, note could be an assignment on an assignment
|
StemFinder |
assignNameOfAttributeDefName(String theNameOfAttributeDefName)
find stems that have this attribute assigned
|
StemFinder |
assignNameOfAttributeDefName2(String theNameOfAttributeDefName)
find stems that have this attribute assigned
|
StemFinder |
assignParentStemId(String theParentStemId)
parent or ancestor stem of the stem
|
StemFinder |
assignPrivileges(Set<Privilege> theStems)
assign privileges to filter by that the subject has on the stem
|
StemFinder |
assignQueryOptions(QueryOptions theQueryOptions)
if sorting, paging, caching, etc
|
StemFinder |
assignScope(String theScope)
scope to look for stems Wildcards will be appended or percent is the wildcard
|
StemFinder |
assignSplitScope(boolean theSplitScope)
if the scope has spaces in it, then split by whitespace, and find results that contain all of the scope strings
|
StemFinder |
assignStemIds(Collection<String> theStemIds)
assign stem ids to search for
|
StemFinder |
assignStemScope(Stem.Scope theStemScope)
if passing in a stem, this is the stem scope...
|
StemFinder |
assignSubject(Subject theSubject)
this is the subject that has certain privileges or is in the query
|
StemFinder |
assignUserHasInAttributeField(Collection<Field> theUserHasInAttributeFields)
find stems where the user has these fields in an attribute
|
StemFinder |
assignUserHasInGroupField(Collection<Field> theUserHasInGroupFields)
find stems where the user has these fields in an attribute
|
static Stem |
findByAlternateName(GrouperSession s,
String name,
boolean exceptionIfNotFound,
QueryOptions queryOptions)
Find stem by its alternate name.
|
static Stem |
findByCurrentName(GrouperSession s,
String name,
boolean exceptionIfNotFound,
QueryOptions queryOptions)
Find stem by its current name.
|
static Stem |
findByIdIndex(Long idIndex,
boolean exceptionIfNotFound,
QueryOptions queryOptions)
Find a stem within the registry by ID index.
|
static Stem |
findByName(GrouperSession s,
String name)
Deprecated.
see overload
|
static Stem |
findByName(GrouperSession s,
String name,
boolean exceptionIfNotFound)
Find stem by name.
|
static Stem |
findByName(GrouperSession s,
String name,
boolean exceptionIfNotFound,
QueryOptions queryOptions)
Find stem by name.
|
static Set<Stem> |
findByNames(Collection<String> names,
boolean exceptionOnNotFound)
find by names
|
static Stem |
findByUuid(GrouperSession s,
String uuid)
Deprecated.
see overload
|
static Stem |
findByUuid(GrouperSession s,
String uuid,
boolean exceptionIfNotFound)
Get stem by uuid.
|
static Stem |
findByUuid(GrouperSession s,
String uuid,
boolean exceptionIfNotFound,
QueryOptions queryOptions)
Get stem by uuid.
|
static Set<Stem> |
findByUuids(GrouperSession s,
Collection<String> uuids,
QueryOptions queryOptions)
Get stems by uuids.
|
static Stem |
findRootStem(GrouperSession s)
Find root stem of the Groups Registry.
|
Stem |
findStem()
find the stem
|
Set<Stem> |
findStems()
find all the stems
|
static Set |
internal_findAllByApproximateDisplayExtension(GrouperSession s,
String val)
Grouper internal method only
|
static Set |
internal_findAllByApproximateDisplayName(GrouperSession s,
String val)
Grouper internal method only
|
static Set |
internal_findAllByApproximateExtension(GrouperSession s,
String val)
Grouper internal method only
|
static Set |
internal_findAllByApproximateName(GrouperSession s,
String val)
Grouper internal method only
|
static Set |
internal_findAllByApproximateNameAny(GrouperSession s,
String val)
Grouper internal method only
|
static Set |
internal_findAllByCreatedAfter(GrouperSession s,
Date d)
Grouper internal method only
|
static Set |
internal_findAllByCreatedBefore(GrouperSession s,
Date d)
Grouper internal method only
|
static Stem |
internal_findByName(String name,
boolean exceptionIfNotFound)
Grouper internal method only
|
static void |
stemCacheClear()
Grouper internal method only
|
static void |
stemCacheRemove(Stem stem)
Grouper internal method only
|
static void |
stemCacheRemoveById(String id)
Grouper internal method only
|
public static Set<Stem> findByNames(Collection<String> names, boolean exceptionOnNotFound)
names
- exceptionOnNotFound
- public static void stemCacheClear()
Grouper internal method only
remove all cachespublic static void stemCacheRemoveById(String id)
Grouper internal method only
remove this from all cachesid
- public static void stemCacheRemove(Stem stem)
Grouper internal method only
remove this from all cachesstem
- public StemFinder addUserHasInGroupField(Field theUserHasInGroupField)
theUserHasInGroupField
- public StemFinder addUserHasInAttributeField(Field theUserHasInAttributeField)
theUserHasInAttributeField
- public StemFinder assignUserHasInGroupField(Collection<Field> theUserHasInGroupFields)
theUserHasInGroupFields
- public StemFinder assignUserHasInAttributeField(Collection<Field> theUserHasInAttributeFields)
theUserHasInAttributeFields
- @Deprecated public static Stem findByName(GrouperSession s, String name) throws StemNotFoundException
try { Stem stem = StemFinder.findByName(s, name); } catch (StemNotFoundException e) { // Stem not found }
s
- Search within this GrouperSession
contextname
- Find stem with this name.Stem
objectStemNotFoundException
public static Stem findByName(GrouperSession s, String name, boolean exceptionIfNotFound) throws StemNotFoundException
Stem stem = StemFinder.findByName(s, name, false);
s
- Search within this GrouperSession
contextname
- Find stem with this name.exceptionIfNotFound
- Stem
objectStemNotFoundException
public static Stem findByName(GrouperSession s, String name, boolean exceptionIfNotFound, QueryOptions queryOptions) throws StemNotFoundException
Stem stem = StemFinder.findByName(s, name, false);
s
- Search within this GrouperSession
contextname
- Find stem with this name.exceptionIfNotFound
- queryOptions
- Stem
objectStemNotFoundException
public static Stem findByAlternateName(GrouperSession s, String name, boolean exceptionIfNotFound, QueryOptions queryOptions) throws StemNotFoundException
Stem stem = StemFinder.findByAlternateName(s, name, false);
s
- Search within this GrouperSession
contextname
- Find stem with this alternate name.exceptionIfNotFound
- queryOptions
- Stem
objectStemNotFoundException
public static Stem findByCurrentName(GrouperSession s, String name, boolean exceptionIfNotFound, QueryOptions queryOptions) throws StemNotFoundException
Stem stem = StemFinder.findByCurrentName(s, name, false);
s
- Search within this GrouperSession
contextname
- Find stem with this name.exceptionIfNotFound
- queryOptions
- Stem
objectStemNotFoundException
public static Stem findRootStem(GrouperSession s) throws StemNotFoundException
// Find the root stem. Stem rootStem = StemFinder.findRootStem(s);
s
- Search within this GrouperSession
contextStem
objectGrouperException
StemNotFoundException
@Deprecated public static Stem findByUuid(GrouperSession s, String uuid) throws StemNotFoundException
// Get the specified stem by uuid. try { Stem stem = StemFinder.findByUuid(s, uuid); } catch (StemNotFoundException e) { // Stem not found }
s
- Search within this GrouperSession
contextuuid
- Get stem with this UUID.Stem
objectStemNotFoundException
public static Stem findByUuid(GrouperSession s, String uuid, boolean exceptionIfNotFound) throws StemNotFoundException
// Get the specified stem by uuid. try { Stem stem = StemFinder.findByUuid(s, uuid); } catch (StemNotFoundException e) { // Stem not found }
s
- Search within this GrouperSession
contextuuid
- Get stem with this UUID.exceptionIfNotFound
- Stem
objectStemNotFoundException
public static Stem findByUuid(GrouperSession s, String uuid, boolean exceptionIfNotFound, QueryOptions queryOptions) throws StemNotFoundException
// Get the specified stem by uuid. try { Stem stem = StemFinder.findByUuid(s, uuid); } catch (StemNotFoundException e) { // Stem not found }
s
- Search within this GrouperSession
contextuuid
- Get stem with this UUID.exceptionIfNotFound
- queryOptions
- Stem
objectStemNotFoundException
public static Set<Stem> findByUuids(GrouperSession s, Collection<String> uuids, QueryOptions queryOptions) throws StemNotFoundException
// Get the specified stems by uuids. try { Setstems = StemFinder.findByUuids(s, uuids, null); } catch (StemNotFoundException e) { // Stem not found }
s
- Search within this GrouperSession
contextuuids
- Get stem with this UUID.queryOptions
- Stem
objectStemNotFoundException
public static Set internal_findAllByApproximateDisplayExtension(GrouperSession s, String val) throws QueryException
Grouper internal method only
s
- val
- QueryException
public static Set internal_findAllByApproximateDisplayName(GrouperSession s, String val) throws QueryException
Grouper internal method only
s
- val
- QueryException
public static Set internal_findAllByApproximateExtension(GrouperSession s, String val) throws QueryException
Grouper internal method only
s
- val
- QueryException
public static Set internal_findAllByApproximateName(GrouperSession s, String val) throws QueryException
Grouper internal method only
s
- val
- QueryException
public static Set internal_findAllByApproximateNameAny(GrouperSession s, String val) throws QueryException
Grouper internal method only
s
- val
- QueryException
public static Set internal_findAllByCreatedAfter(GrouperSession s, Date d) throws QueryException
Grouper internal method only
s
- d
- QueryException
public static Set internal_findAllByCreatedBefore(GrouperSession s, Date d) throws QueryException
Grouper internal method only
s
- d
- QueryException
public static Stem internal_findByName(String name, boolean exceptionIfNotFound) throws StemNotFoundException
Grouper internal method only
name
- exceptionIfNotFound
- StemNotFoundException
public static Stem findByIdIndex(Long idIndex, boolean exceptionIfNotFound, QueryOptions queryOptions) throws StemNotFoundException
idIndex
- id index of stem to find.exceptionIfNotFound
- true if exception if not foundqueryOptions
- Stem
StemNotFoundException
- if not found an exceptionIfNotFound is truepublic StemFinder assignFindByUuidOrName(boolean theFindByUuidOrName)
theFindByUuidOrName
- public StemFinder assignAttributeNotAssigned(boolean attributeNotAssigned)
attributeNotAssigned
- public StemFinder assignAttributeCheckReadOnAttributeDef(boolean theAttributeCheckReadOnAttributeDef)
theAttributeCheckReadOnAttributeDef
- public StemFinder assignAttributeValue(Object theValue)
theValue
- public StemFinder addPrivilege(Privilege privilege)
privilege
- should be AccessPrivilegepublic StemFinder assignPrivileges(Set<Privilege> theStems)
theStems
- public StemFinder assignQueryOptions(QueryOptions theQueryOptions)
theQueryOptions
- public StemFinder assignScope(String theScope)
theScope
- public StemFinder assignSplitScope(boolean theSplitScope)
theSplitScope
- public StemFinder assignSubject(Subject theSubject)
theSubject
- public Stem findStem()
public Set<Stem> findStems()
public StemFinder assignParentStemId(String theParentStemId)
theParentStemId
- public StemFinder assignStemScope(Stem.Scope theStemScope)
theStemScope
- public StemFinder addStemId(String stemId)
stemId
- public StemFinder assignStemIds(Collection<String> theStemIds)
theStemIds
- public StemFinder addAttributeValuesOnAssignment(Object value)
value
- public StemFinder addAttributeValuesOnAssignment2(Object value)
value
- public StemFinder assignAttributeValuesOnAssignment(Set<Object> theValues)
theValues
- public StemFinder assignAttributeValuesOnAssignment2(Set<Object> theValues)
theValues
- public StemFinder assignIdOfAttributeDefName(String theAttributeDefNameId)
theAttributeDefNameId
- public StemFinder assignIdOfAttributeDefName2(String theAttributeDefNameId)
theAttributeDefNameId
- public StemFinder assignNameOfAttributeDefName(String theNameOfAttributeDefName)
theNameOfAttributeDefName
- public StemFinder assignNameOfAttributeDefName2(String theNameOfAttributeDefName)
theNameOfAttributeDefName
- Copyright © 2016 Internet2. All rights reserved.