Interface EntitlementCondition


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

    • setDisplayType

      void setDisplayType(String displayType)
      Sets display type.
      Parameters:
      displayType - Display Type.
    • getDisplayType

      String getDisplayType()
      Returns display type.
      Returns:
      Display Type.
    • init

      void init(Map<String,Set<String>> parameters)
      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.