org.keycloak.models.map.authorization.adapter

## Class MapPolicyAdapter<K>

- java.lang.Object
- - org.keycloak.authorization.model.AbstractAuthorizationModel
  - - org.keycloak.models.map.authorization.adapter.AbstractPolicyModel<MapPolicyEntity<K>>
    - - org.keycloak.models.map.authorization.adapter.MapPolicyAdapter<K>

- All Implemented Interfaces:
    Policy

      public abstract class MapPolicyAdapter<K>
      extends AbstractPolicyModel<MapPolicyEntity<K>>

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.authorization.model.Policy

      `Policy.FilterOption, Policy.SearchableFields`

  - ### Field Summary

    - ### Fields inherited from class org.keycloak.models.map.authorization.adapter.AbstractPolicyModel

      `entity`

    - ### Fields inherited from class org.keycloak.authorization.model.AbstractAuthorizationModel

      `storeFactory`

    - ### Fields inherited from interface org.keycloak.authorization.model.Policy

      `CONFIG_SEPARATOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapPolicyAdapter(MapPolicyEntity<K> entity, StoreFactory storeFactory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAssociatedPolicy(Policy associatedPolicy)`
    `void` | `addResource(Resource resource)`
    `void` | `addScope(Scope scope)`
    `Set<Policy>` | `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.
    `Logic` | `getLogic()` Returns the `Logic` for this policy.
    `String` | `getName()` Returns the name of this policy.
    `String` | `getOwner()`
    `Set<Resource>` | `getResources()` Returns the `Resource` instances where this policy applies.
    `ResourceServer` | `getResourceServer()` Returns the `ResourceServer` where this policy belongs to.
    `Set<Scope>` | `getScopes()` Returns the `Scope` instances where this policy applies.
    `String` | `getType()` Returns the type of this policy.
    `void` | `putConfig(String name, String value)`
    `void` | `removeAssociatedPolicy(Policy associatedPolicy)`
    `void` | `removeConfig(String name)`
    `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.
    `void` | `setOwner(String owner)`
    `String` | `toString()`

    - ### Methods inherited from class org.keycloak.models.map.authorization.adapter.AbstractPolicyModel

      `equals, hashCode`

    - ### Methods inherited from class org.keycloak.authorization.model.AbstractAuthorizationModel

      `throwExceptionIfReadonly`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.authorization.model.Policy

      `getId`

- - ### Constructor Detail

    - #### MapPolicyAdapter

          public MapPolicyAdapter(MapPolicyEntity<K> entity,
                                  StoreFactory storeFactory)

  - ### Method Detail

    - #### getType

          public String getType()

      Description copied from interface: `Policy`
      Returns the type of this policy.
      Returns:
        the type of this policy

    - #### getDecisionStrategy

          public DecisionStrategy getDecisionStrategy()

      Description copied from interface: `Policy`
      Returns the `DecisionStrategy` for this policy.
      Returns:
        the decision strategy defined for this policy

    - #### setDecisionStrategy

          public void setDecisionStrategy(DecisionStrategy decisionStrategy)

      Description copied from interface: `Policy`
      Sets the {DecisionStrategy} for this policy.

    - #### getLogic

          public Logic getLogic()

      Description copied from interface: `Policy`
      Returns the `Logic` for this policy.
      Returns:
        the decision strategy defined for this policy

    - #### setLogic

          public void setLogic(Logic logic)

      Description copied from interface: `Policy`
      Sets the {Logic} for this policy.

    - #### getConfig

          public Map<String,String> getConfig()

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

    - #### setConfig

          public void setConfig(Map<String,String> config)

      Description copied from interface: `Policy`
      Sets a `Map` with string-based key/value pairs representing any additional configuration for this policy.

    - #### removeConfig

          public void removeConfig(String name)

    - #### putConfig

          public void putConfig(String name,
                                String value)

    - #### getName

          public String getName()

      Description copied from interface: `Policy`
      Returns the name of this policy.
      Returns:
        the name of this policy

    - #### setName

          public void setName(String name)

      Description copied from interface: `Policy`
      Sets an unique name to this policy.
      Parameters:
        `name` - an unique name

    - #### getDescription

          public String getDescription()

      Description copied from interface: `Policy`
      Returns the description of this policy.
      Returns:
        a description or null of there is no description

    - #### setDescription

          public void setDescription(String description)

      Description copied from interface: `Policy`
      Sets the description for this policy.
      Parameters:
        `description` - a description

    - #### getResourceServer

          public ResourceServer getResourceServer()

      Description copied from interface: `Policy`
      Returns the `ResourceServer` where this policy belongs to.
      Returns:
        a resource server

    - #### getAssociatedPolicies

          public Set<Policy> getAssociatedPolicies()

      Description copied from interface: `Policy`
      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

          public Set<Resource> getResources()

      Description copied from interface: `Policy`
      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

          public Set<Scope> getScopes()

      Description copied from interface: `Policy`
      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

    - #### getOwner

          public String getOwner()

    - #### setOwner

          public void setOwner(String owner)

    - #### addScope

          public void addScope(Scope scope)

    - #### removeScope

          public void removeScope(Scope scope)

    - #### addAssociatedPolicy

          public void addAssociatedPolicy(Policy associatedPolicy)

    - #### removeAssociatedPolicy

          public void removeAssociatedPolicy(Policy associatedPolicy)

    - #### addResource

          public void addResource(Resource resource)

    - #### removeResource

          public void removeResource(Resource resource)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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