Class RelationTargetInfo

java.lang.Object
ch.tocco.nice2.businessunit.api.RelationTargetInfo

public final class RelationTargetInfo extends Object
Holds information about a resolved relation to business-unit dependent targets. It contains the possible states: 1. an access error that occurred when resolving the relation 2. the result of resolving the relation against the source entity 3. both of the above, if resolving was at least once successful and once failed due to an access error The relation is resolved under the current threads principal but in the business units of the target entities.
  • Method Details

    • create

      public static Optional<RelationTargetInfo> create(CommandExecutor executor, Entity source, String relationname)
    • resolveTask

      public static ch.tocco.nice2.businessunit.api.RelationTargetInfo.ResolveTask resolveTask(String relationName)
      See Also:
      • RelationTargetInfo.ResolveTask
    • getRelationModel

      public RelationModel getRelationModel()
    • getSource

      public Entity getSource()
    • getAccessErrors

      public List<UnauthorizedException> getAccessErrors()
    • hasError

      public boolean hasError()
      Returns `true` if the error list is non empty
      Returns:
      whether this holds an error
    • getResult

      public Optional<EntityList> getResult()
      Returns the resulting entity list.
    • getBusinessUnits

      public com.google.common.collect.ImmutableSet<BusinessUnit> getBusinessUnits()
      Returns the set of business units used by the target entities.