Interface OrgTreeEvaluator

All Known Subinterfaces:
RepositoryService
All Known Implementing Classes:
RepositoryCache, SqaleRepositoryService

public interface OrgTreeEvaluator
Evaluates organization tree questions. Usually implemented by the repository.
  • Method Summary

    Modifier and Type
    Method
    Description
    <O extends ObjectType>
    boolean
    isAncestor(PrismObject<O> object, String descendantOrgOid)
    Returns `true` if the `object` is above organization identified with `descendantOrgOid`.
    <O extends ObjectType>
    boolean
    isDescendant(PrismObject<O> object, String ancestorOrgOid)
    Returns `true` if the `object` is under the organization identified with `ancestorOrgOid`.
  • Method Details

    • isAncestor

      <O extends ObjectType> boolean isAncestor(PrismObject<O> object, String descendantOrgOid) throws SchemaException
      Returns `true` if the `object` is above organization identified with `descendantOrgOid`. Despite type parameter, only `PrismObject` can return `true`. Examples (from the perspective of the first parameter): * Any other type than `Org` used for `object` returns `false`. * Organization being a parent of another organization with `descendantOrgOid` returns `true`. This means that Organization with `descendantOrgOid` has `parentOrgRef` to `object`. * Organization higher in the organization hierarchy than Org with `descendantOrgOid` returns `true`, for any number of levels between them as long as it's possible to traverse from Org identified by `descendantOrgOid` to `object` using any number of `parentOrgRefs`. * Organization with `descendantOrgOid` returns `false`, as it is not considered to be its own ancestor.
      Parameters:
      object - potential ancestor organization
      descendantOrgOid - identifier of potential descendant organization
      Throws:
      SchemaException
    • isDescendant

      <O extends ObjectType> boolean isDescendant(PrismObject<O> object, String ancestorOrgOid) throws SchemaException
      Returns `true` if the `object` is under the organization identified with `ancestorOrgOid`. The `object` can either be an Org or any other object in which case all the targets of its `parentOrgRefs` are tested. Examples (from the perspective of the first parameter): * User belonging to Org with `ancestorOrgOid` returns true. * Organization under Org with `ancestorOrgOid` returns true (in any depth). * User belonging to Org under another Org with `ancestorOrgOid` returns true (any depth). * Organization with `ancestorOrgOid` returns `false`, as it is not considered to be its own descendant.
      Parameters:
      object - object of any type tested to belong under Org with `ancestorOrgOid`
      ancestorOrgOid - identifier of ancestor organization
      Throws:
      SchemaException