org.keycloak.authorization.model

## Interface Policy

- All Known Implementing Classes:
    CachedPolicy, PolicyAdapter, PolicyEntity

      public interface Policy

  Represents an authorization policy and all the configuration associated with it.
  Author:
    Pedro Igor

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAssociatedPolicy(Policy associatedPolicy)`
    `void` | `addResource(Resource resource)`
    `void` | `addScope(Scope scope)`
    `<P extends Policy> Set<P>` | `getAssociatedPolicies()` Returns the `Policy` instances associated with this policy and used to evaluate authorization decisions when this policy applies.
    `Map<String,String>` | `getConfig()` Returns a `Map` holding string-based key/value pairs representing any additional configuration for this policy.
    `DecisionStrategy` | `getDecisionStrategy()` Returns the `DecisionStrategy` for this policy.
    `String` | `getDescription()` Returns the description of this policy.
    `String` | `getId()` Returns the unique identifier for this instance.
    `Logic` | `getLogic()` Returns the `Logic` for this policy.
    `String` | `getName()` Returns the name of this policy.
    `<R extends Resource> Set<R>` | `getResources()` Returns the `Resource` instances where this policy applies.
    `<R extends ResourceServer> R` | `getResourceServer()` Returns the `ResourceServer` where this policy belongs to.
    `<S extends Scope> Set<S>` | `getScopes()` Returns the `Scope` instances where this policy applies.
    `String` | `getType()` Returns the type of this policy.
    `void` | `removeAssociatedPolicy(Policy associatedPolicy)`
    `void` | `removeResource(Resource resource)`
    `void` | `removeScope(Scope scope)`
    `void` | `setConfig(Map<String,String> config)` Sets a `Map` with string-based key/value pairs representing any additional configuration for this policy.
    `void` | `setDecisionStrategy(DecisionStrategy decisionStrategy)` Sets the {DecisionStrategy} for this policy.
    `void` | `setDescription(String description)` Sets the description for this policy.
    `void` | `setLogic(Logic logic)` Sets the {Logic} for this policy.
    `void` | `setName(String name)` Sets an unique name to this policy.

- - ### Method Detail

    - #### getId

          String getId()

      Returns the unique identifier for this instance.
      Returns:
        the unique identifier for this instance

    - #### getType

          String getType()

      Returns the type of this policy.
      Returns:
        the type of this policy

    - #### getDecisionStrategy

          DecisionStrategy getDecisionStrategy()

      Returns the `DecisionStrategy` for this policy.
      Returns:
        the decision strategy defined for this policy

    - #### setDecisionStrategy

          void setDecisionStrategy(DecisionStrategy decisionStrategy)

      Sets the {DecisionStrategy} for this policy.

    - #### getLogic

          Logic getLogic()

      Returns the `Logic` for this policy.
      Returns:
        the decision strategy defined for this policy

    - #### setLogic

          void setLogic(Logic logic)

      Sets the {Logic} for this policy.

    - #### getConfig

          Map<String,String> getConfig()

      Returns a `Map` holding string-based key/value pairs representing any additional configuration for this policy.
      Returns:
        a map with any additional configuration defined for this policy.

    - #### setConfig

          void setConfig(Map<String,String> config)

      Sets a `Map` with string-based key/value pairs representing any additional configuration for this policy.

    - #### getName

          String getName()

      Returns the name of this policy.
      Returns:
        the name of this policy

    - #### setName

          void setName(String name)

      Sets an unique name to this policy.
      Parameters:
        `name` - an unique name

    - #### getDescription

          String getDescription()

      Returns the description of this policy.
      Returns:
        a description or null of there is no description

    - #### setDescription

          void setDescription(String description)

      Sets the description for this policy.
      Parameters:
        `description` - a description

    - #### getResourceServer

          <R extends ResourceServer> R getResourceServer()

      Returns the `ResourceServer` where this policy belongs to.
      Returns:
        a resource server

    - #### getAssociatedPolicies

          <P extends Policy> Set<P> getAssociatedPolicies()

      Returns the `Policy` instances associated with this policy and used to evaluate authorization decisions when this policy applies.
      Returns:
        the associated policies or an empty set if no policy is associated with this policy

    - #### getResources

          <R extends Resource> Set<R> getResources()

      Returns the `Resource` instances where this policy applies.
      Returns:
        a set with all resource instances where this policy applies. Or an empty set if there is no resource associated with this policy

    - #### getScopes

          <S extends Scope> Set<S> getScopes()

      Returns the `Scope` instances where this policy applies.
      Returns:
        a set with all scope instances where this policy applies. Or an empty set if there is no scope associated with this policy

    - #### addScope

          void addScope(Scope scope)

    - #### removeScope

          void removeScope(Scope scope)

    - #### addAssociatedPolicy

          void addAssociatedPolicy(Policy associatedPolicy)

    - #### removeAssociatedPolicy

          void removeAssociatedPolicy(Policy associatedPolicy)

    - #### addResource

          void addResource(Resource resource)

    - #### removeResource

          void removeResource(Resource resource)

Copyright © 2016 JBoss by Red Hat. All rights reserved.