Class PolicyAdapter
java.lang.Object
org.keycloak.models.cache.infinispan.authorization.PolicyAdapter
- All Implemented Interfaces:
CachedModel<Policy>
,Policy
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.authorization.model.Policy
Policy.FilterOption
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CachedPolicy
protected final StoreFactoryCacheSession
protected boolean
protected Policy
Fields inherited from interface org.keycloak.authorization.model.Policy
CONFIG_SEPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAssociatedPolicy
(Policy associatedPolicy) void
addResource
(Resource resource) void
boolean
Returns thePolicy
instances associated with this policy and used to evaluate authorization decisions when this policy applies.long
When was the model was loaded from database.Returns aMap
holding string-based key/value pairs representing any additional configuration for this policy.Returns theDecisionStrategy
for this policy.Invalidates the cache for this model and returns a delegate that represents the actual data providerReturns the description of this policy.getId()
Returns the unique identifier for this instance.getLogic()
Returns theLogic
for this policy.getName()
Returns the name of this policy.getOwner()
Returns theResource
instances where this policy applies.Returns theResourceServer
where this policy belongs to.Returns theScope
instances where this policy applies.getType()
Returns the type of this policy.int
hashCode()
void
Invalidate the cache for this modelprotected void
protected boolean
void
void
removeAssociatedPolicy
(Policy associatedPolicy) void
removeConfig
(String name) void
removeResource
(Resource resource) void
removeScope
(Scope scope) void
Sets aMap
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
Sets the {Logic} for this policy.void
Sets an unique name to this policy.void
-
Field Details
-
cached
-
cacheSession
-
updated
-
invalidated
protected boolean invalidated -
associatedPolicies
-
resources
-
scopes
-
-
Constructor Details
-
PolicyAdapter
-
-
Method Details
-
getDelegateForUpdate
Description copied from interface:CachedModel
Invalidates the cache for this model and returns a delegate that represents the actual data provider- Specified by:
getDelegateForUpdate
in interfaceCachedModel<Policy>
- Returns:
-
invalidateFlag
protected void invalidateFlag() -
invalidate
public void invalidate()Description copied from interface:CachedModel
Invalidate the cache for this model- Specified by:
invalidate
in interfaceCachedModel<Policy>
-
getCacheTimestamp
public long getCacheTimestamp()Description copied from interface:CachedModel
When was the model was loaded from database.- Specified by:
getCacheTimestamp
in interfaceCachedModel<Policy>
- Returns:
-
isUpdated
protected boolean isUpdated() -
getId
Description copied from interface:Policy
Returns the unique identifier for this instance. -
getName
Description copied from interface:Policy
Returns the name of this policy. -
setName
Description copied from interface:Policy
Sets an unique name to this policy. -
getResourceServer
Description copied from interface:Policy
Returns theResourceServer
where this policy belongs to.- Specified by:
getResourceServer
in interfacePolicy
- Returns:
- a resource server
-
getType
Description copied from interface:Policy
Returns the type of this policy. -
getDecisionStrategy
Description copied from interface:Policy
Returns theDecisionStrategy
for this policy.- Specified by:
getDecisionStrategy
in interfacePolicy
- Returns:
- the decision strategy defined for this policy
-
setDecisionStrategy
Description copied from interface:Policy
Sets the {DecisionStrategy} for this policy.- Specified by:
setDecisionStrategy
in interfacePolicy
- Parameters:
decisionStrategy
- for this policy
-
getLogic
Description copied from interface:Policy
Returns theLogic
for this policy. -
setLogic
Description copied from interface:Policy
Sets the {Logic} for this policy. -
getConfig
Description copied from interface:Policy
Returns aMap
holding string-based key/value pairs representing any additional configuration for this policy. -
setConfig
Description copied from interface:Policy
Sets aMap
with string-based key/value pairs representing any additional configuration for this policy. -
removeConfig
- Specified by:
removeConfig
in interfacePolicy
-
putConfig
-
getDescription
Description copied from interface:Policy
Returns the description of this policy.- Specified by:
getDescription
in interfacePolicy
- Returns:
- a description or null of there is no description
-
setDescription
Description copied from interface:Policy
Sets the description for this policy.- Specified by:
setDescription
in interfacePolicy
- Parameters:
description
- a description
-
getAssociatedPolicies
Description copied from interface:Policy
Returns thePolicy
instances associated with this policy and used to evaluate authorization decisions when this policy applies.- Specified by:
getAssociatedPolicies
in interfacePolicy
- Returns:
- the associated policies or an empty set if no policy is associated with this policy
-
getResources
Description copied from interface:Policy
Returns theResource
instances where this policy applies.- Specified by:
getResources
in interfacePolicy
- Returns:
- a set with all resource instances where this policy applies. Or an empty set if there is no resource associated with this policy
-
addScope
-
removeScope
- Specified by:
removeScope
in interfacePolicy
-
addAssociatedPolicy
- Specified by:
addAssociatedPolicy
in interfacePolicy
-
removeAssociatedPolicy
- Specified by:
removeAssociatedPolicy
in interfacePolicy
-
addResource
- Specified by:
addResource
in interfacePolicy
-
removeResource
- Specified by:
removeResource
in interfacePolicy
-
getScopes
Description copied from interface:Policy
Returns theScope
instances where this policy applies. -
getOwner
-
setOwner
-
equals
-
hashCode
public int hashCode()
-