Class ResourceAdapter
- java.lang.Object
- 
- org.keycloak.models.cache.infinispan.authorization.ResourceAdapter
 
- 
- All Implemented Interfaces:
- CachedModel<Resource>,- Resource
 
 public class ResourceAdapter extends Object implements Resource, CachedModel<Resource> - Version:
- $Revision: 1 $
- Author:
- Bill Burke
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.keycloak.authorization.model.ResourceResource.FilterOption, Resource.SearchableFields
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected CachedResourcecachedprotected StoreFactoryCacheSessioncacheSessionprotected booleaninvalidatedprotected List<Scope>scopesprotected Resourceupdated
 - 
Constructor SummaryConstructors Constructor Description ResourceAdapter(CachedResource cached, StoreFactoryCacheSession cacheSession)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)List<String>getAttribute(String name)Returns the values of an attribute with the givennameMap<String,List<String>>getAttributes()Returns the attributes associated with this resource.longgetCacheTimestamp()When was the model was loaded from database.ResourcegetDelegateForUpdate()Invalidates the cache for this model and returns a delegate that represents the actual data providerStringgetDisplayName()Returns the end user friendly name for this resource.StringgetIconUri()Returns an iconURIfor this resource.StringgetId()Returns the unique identifier for this instance.StringgetName()Returns the resource's name.StringgetOwner()Returns the resource's owner, which is usually an identifier that uniquely identifies the resource's owner.ResourceServergetResourceServer()Returns theResourceServerto where this resource belongs to.List<Scope>getScopes()StringgetSingleAttribute(String name)Returns the first value of an attribute with the givennameStringgetType()Returns a string representing the type of this resource.Set<String>getUris()inthashCode()voidinvalidate()Invalidate the cache for this modelprotected voidinvalidateFlag()booleanisOwnerManagedAccess()Indicates if this resource can be managed by the resource owner.protected booleanisUpdated()voidremoveAttribute(String name)voidsetAttribute(String name, List<String> values)Sets an attribute with the givennameandvalues.voidsetDisplayName(String name)Sets an end user friendly name for this resource.voidsetIconUri(String iconUri)Sets an iconURIfor this resource.voidsetName(String name)Sets a name for this resource.voidsetOwnerManagedAccess(boolean ownerManagedAccess)Sets if this resource can be managed by the resource owner.voidsetType(String type)Sets a string representing the type of this resource.voidupdateScopes(Set<Scope> scopes)Update the set of scopes associated with this resource.voidupdateUris(Set<String> uris)Sets a list ofURIthat uniquely identify this resource.
 
- 
- 
- 
Field Detail- 
cachedprotected final CachedResource cached 
 - 
cacheSessionprotected final StoreFactoryCacheSession cacheSession 
 - 
updatedprotected Resource updated 
 - 
invalidatedprotected boolean invalidated 
 
- 
 - 
Constructor Detail- 
ResourceAdapterpublic ResourceAdapter(CachedResource cached, StoreFactoryCacheSession cacheSession) 
 
- 
 - 
Method Detail- 
getDelegateForUpdatepublic Resource getDelegateForUpdate() Description copied from interface:CachedModelInvalidates the cache for this model and returns a delegate that represents the actual data provider- Specified by:
- getDelegateForUpdatein interface- CachedModel<Resource>
- Returns:
 
 - 
invalidateFlagprotected void invalidateFlag() 
 - 
invalidatepublic void invalidate() Description copied from interface:CachedModelInvalidate the cache for this model- Specified by:
- invalidatein interface- CachedModel<Resource>
 
 - 
getCacheTimestamppublic long getCacheTimestamp() Description copied from interface:CachedModelWhen was the model was loaded from database.- Specified by:
- getCacheTimestampin interface- CachedModel<Resource>
- Returns:
 
 - 
isUpdatedprotected boolean isUpdated() 
 - 
getIdpublic String getId() Description copied from interface:ResourceReturns the unique identifier for this instance.
 - 
getNamepublic String getName() Description copied from interface:ResourceReturns the resource's name.
 - 
setNamepublic void setName(String name) Description copied from interface:ResourceSets a name for this resource. The name must be unique.
 - 
getDisplayNamepublic String getDisplayName() Description copied from interface:ResourceReturns the end user friendly name for this resource. If not defined, value forResource.getName()is returned.- Specified by:
- getDisplayNamein interface- Resource
- Returns:
- the friendly name for this resource
 
 - 
setDisplayNamepublic void setDisplayName(String name) Description copied from interface:ResourceSets an end user friendly name for this resource.- Specified by:
- setDisplayNamein interface- Resource
- Parameters:
- name- the name of this resource
 
 - 
getIconUripublic String getIconUri() Description copied from interface:ResourceReturns an iconURIfor this resource.- Specified by:
- getIconUriin interface- Resource
- Returns:
- a uri for an icon
 
 - 
setIconUripublic void setIconUri(String iconUri) Description copied from interface:ResourceSets an iconURIfor this resource.- Specified by:
- setIconUriin interface- Resource
- Parameters:
- iconUri- an uri for an icon
 
 - 
getResourceServerpublic ResourceServer getResourceServer() Description copied from interface:ResourceReturns theResourceServerto where this resource belongs to.- Specified by:
- getResourceServerin interface- Resource
- Returns:
- the resource server associated with this resource
 
 - 
updateUrispublic void updateUris(Set<String> uris) Description copied from interface:ResourceSets a list ofURIthat uniquely identify this resource.- Specified by:
- updateUrisin interface- Resource
- Parameters:
- uris- an- URIfor this resource
 
 - 
getTypepublic String getType() Description copied from interface:ResourceReturns a string representing the type of this resource.
 - 
setTypepublic void setType(String type) Description copied from interface:ResourceSets a string representing the type of this resource.
 - 
getOwnerpublic String getOwner() Description copied from interface:ResourceReturns the resource's owner, which is usually an identifier that uniquely identifies the resource's owner.
 - 
isOwnerManagedAccesspublic boolean isOwnerManagedAccess() Description copied from interface:ResourceIndicates if this resource can be managed by the resource owner.- Specified by:
- isOwnerManagedAccessin interface- Resource
- Returns:
- trueif this resource can be managed by the resource owner. Otherwise,- false.
 
 - 
setOwnerManagedAccesspublic void setOwnerManagedAccess(boolean ownerManagedAccess) Description copied from interface:ResourceSets if this resource can be managed by the resource owner.- Specified by:
- setOwnerManagedAccessin interface- Resource
- Parameters:
- ownerManagedAccess-- trueindicates that this resource can be managed by the resource owner.
 
 - 
updateScopespublic void updateScopes(Set<Scope> scopes) Description copied from interface:ResourceUpdate the set of scopes associated with this resource.- Specified by:
- updateScopesin interface- Resource
- Parameters:
- scopes- the list of scopes to update
 
 - 
getAttributespublic Map<String,List<String>> getAttributes() Description copied from interface:ResourceReturns the attributes associated with this resource.- Specified by:
- getAttributesin interface- Resource
- Returns:
- a map holding the attributes associated with this resource
 
 - 
getSingleAttributepublic String getSingleAttribute(String name) Description copied from interface:ResourceReturns the first value of an attribute with the givenname- Specified by:
- getSingleAttributein interface- Resource
- Parameters:
- name- of the attribute
- Returns:
- the first value of an attribute
 
 - 
getAttributepublic List<String> getAttribute(String name) Description copied from interface:ResourceReturns the values of an attribute with the givenname- Specified by:
- getAttributein interface- Resource
- Parameters:
- name- of the attribute
- Returns:
- the values of an attribute
 
 - 
setAttributepublic void setAttribute(String name, List<String> values) Description copied from interface:ResourceSets an attribute with the givennameandvalues.- Specified by:
- setAttributein interface- Resource
- Parameters:
- name- the attribute name
- values- the attribute values
 
 - 
removeAttributepublic void removeAttribute(String name) - Specified by:
- removeAttributein interface- Resource
 
 
- 
 
-