Interface EntitlementCondition


@SupportedAll public interface EntitlementCondition
Encapsulates a Strategy to decide if a Privilege applies to a given request.
  • Method Summary

    Modifier and Type
    Method
    Description
    evaluate(String realm, Subject subject, String resourceName, Map<String,Set<String>> environment)
    Returns condition decision.
    default String
    Deprecated.
    this isn't called, so can be safely removed.
    Returns state of the object encoded as a JSON string.
    default void
    init(Map<String,Set<String>> parameters)
    Deprecated.
    this isn't called, so can be safely removed.
    default void
    setDisplayType(String displayType)
    Deprecated.
    this isn't called, so can be safely removed.
    void
    Sets state of this object from a JSON string.
    void
    Checks that this condition is configured correctly.
  • Method Details

    • setDisplayType

      @Deprecated default void setDisplayType(String displayType)
      Deprecated.
      this isn't called, so can be safely removed.
      Sets display type.
      Parameters:
      displayType - Display Type.
    • getDisplayType

      @Deprecated default String getDisplayType()
      Deprecated.
      this isn't called, so can be safely removed.
      Returns display type.
      Returns:
      Display Type.
    • init

      @Deprecated default void init(Map<String,Set<String>> parameters)
      Deprecated.
      this isn't called, so can be safely removed.
      Initializes the condition object.
      Parameters:
      parameters - Parameters for initializing the condition.
    • setState

      void setState(String state)
      Sets state of this object from a JSON string.
      Parameters:
      state - State of the object encoded as a JSON string
    • getState

      String getState()
      Returns state of the object encoded as a JSON string.
      Returns:
      state of the object encoded as a JSON string.
    • validate

      void validate() throws EntitlementException
      Checks that this condition is configured correctly. Throws EntitlementException if not with an informative message to display to the user creating/updating the policy.
      Throws:
      EntitlementException - if the configuration state is not valid.
    • evaluate

      ConditionDecision evaluate(String realm, Subject subject, String resourceName, Map<String,Set<String>> environment) throws EntitlementException
      Returns condition decision.
      Parameters:
      realm - Realm Name.
      subject - Subject who is under evaluation.
      resourceName - Resource name.
      environment - Environment parameters.
      Returns:
      resulting condition decision.
      Throws:
      EntitlementException - if cannot get condition decision.