Class ResourceAdapter
java.lang.Object
org.keycloak.models.cache.infinispan.authorization.ResourceAdapter
- All Implemented Interfaces:
CachedModel<Resource>
,Resource
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.authorization.model.Resource
Resource.FilterOption, Resource.SearchableFields
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CachedResource
protected final StoreFactoryCacheSession
protected boolean
protected Resource
-
Constructor Summary
ConstructorDescriptionResourceAdapter
(CachedResource cached, StoreFactoryCacheSession cacheSession) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getAttribute
(String name) Returns the values of an attribute with the givenname
Returns the attributes associated with this resource.long
When was the model was loaded from database.Invalidates the cache for this model and returns a delegate that represents the actual data providerReturns the end user friendly name for this resource.Returns an iconURI
for this resource.getId()
Returns the unique identifier for this instance.getName()
Returns the resource's name.getOwner()
Returns the resource's owner, which is usually an identifier that uniquely identifies the resource's owner.Returns theResourceServer
to where this resource belongs to.getSingleAttribute
(String name) Returns the first value of an attribute with the givenname
getType()
Returns a string representing the type of this resource.getUris()
int
hashCode()
void
Invalidate the cache for this modelprotected void
boolean
Indicates if this resource can be managed by the resource owner.protected boolean
void
removeAttribute
(String name) void
setAttribute
(String name, List<String> values) Sets an attribute with the givenname
andvalues
.void
setDisplayName
(String name) Sets an end user friendly name for this resource.void
setIconUri
(String iconUri) Sets an iconURI
for this resource.void
Sets a name for this resource.void
setOwnerManagedAccess
(boolean ownerManagedAccess) Sets if this resource can be managed by the resource owner.void
Sets a string representing the type of this resource.void
updateScopes
(Set<Scope> scopes) Update the set of scopes associated with this resource.void
updateUris
(Set<String> uris) Sets a list ofURI
that uniquely identify this resource.
-
Field Details
-
cached
-
cacheSession
-
updated
-
invalidated
protected boolean invalidated -
scopes
-
-
Constructor Details
-
ResourceAdapter
-
-
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<Resource>
- 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<Resource>
-
getCacheTimestamp
public long getCacheTimestamp()Description copied from interface:CachedModel
When was the model was loaded from database.- Specified by:
getCacheTimestamp
in interfaceCachedModel<Resource>
- Returns:
-
isUpdated
protected boolean isUpdated() -
getId
Description copied from interface:Resource
Returns the unique identifier for this instance. -
getName
Description copied from interface:Resource
Returns the resource's name. -
setName
Description copied from interface:Resource
Sets a name for this resource. The name must be unique. -
getDisplayName
Description copied from interface:Resource
Returns the end user friendly name for this resource. If not defined, value forResource.getName()
is returned.- Specified by:
getDisplayName
in interfaceResource
- Returns:
- the friendly name for this resource
-
setDisplayName
Description copied from interface:Resource
Sets an end user friendly name for this resource.- Specified by:
setDisplayName
in interfaceResource
- Parameters:
name
- the name of this resource
-
getIconUri
Description copied from interface:Resource
Returns an iconURI
for this resource.- Specified by:
getIconUri
in interfaceResource
- Returns:
- a uri for an icon
-
setIconUri
Description copied from interface:Resource
Sets an iconURI
for this resource.- Specified by:
setIconUri
in interfaceResource
- Parameters:
iconUri
- an uri for an icon
-
getResourceServer
Description copied from interface:Resource
Returns theResourceServer
to where this resource belongs to.- Specified by:
getResourceServer
in interfaceResource
- Returns:
- the resource server associated with this resource
-
getUris
Description copied from interface:Resource
-
updateUris
Description copied from interface:Resource
Sets a list ofURI
that uniquely identify this resource.- Specified by:
updateUris
in interfaceResource
- Parameters:
uris
- anURI
for this resource
-
getType
Description copied from interface:Resource
Returns a string representing the type of this resource. -
setType
Description copied from interface:Resource
Sets a string representing the type of this resource. -
getScopes
Description copied from interface:Resource
-
getOwner
Description copied from interface:Resource
Returns the resource's owner, which is usually an identifier that uniquely identifies the resource's owner. -
isOwnerManagedAccess
public boolean isOwnerManagedAccess()Description copied from interface:Resource
Indicates if this resource can be managed by the resource owner.- Specified by:
isOwnerManagedAccess
in interfaceResource
- Returns:
true
if this resource can be managed by the resource owner. Otherwise,false
.
-
setOwnerManagedAccess
public void setOwnerManagedAccess(boolean ownerManagedAccess) Description copied from interface:Resource
Sets if this resource can be managed by the resource owner.- Specified by:
setOwnerManagedAccess
in interfaceResource
- Parameters:
ownerManagedAccess
-true
indicates that this resource can be managed by the resource owner.
-
updateScopes
Description copied from interface:Resource
Update the set of scopes associated with this resource.- Specified by:
updateScopes
in interfaceResource
- Parameters:
scopes
- the list of scopes to update
-
getAttributes
Description copied from interface:Resource
Returns the attributes associated with this resource.- Specified by:
getAttributes
in interfaceResource
- Returns:
- a map holding the attributes associated with this resource
-
getSingleAttribute
Description copied from interface:Resource
Returns the first value of an attribute with the givenname
- Specified by:
getSingleAttribute
in interfaceResource
- Parameters:
name
- of the attribute- Returns:
- the first value of an attribute
-
getAttribute
Description copied from interface:Resource
Returns the values of an attribute with the givenname
- Specified by:
getAttribute
in interfaceResource
- Parameters:
name
- of the attribute- Returns:
- the values of an attribute
-
setAttribute
Description copied from interface:Resource
Sets an attribute with the givenname
andvalues
.- Specified by:
setAttribute
in interfaceResource
- Parameters:
name
- the attribute namevalues
- the attribute values
-
removeAttribute
- Specified by:
removeAttribute
in interfaceResource
-
equals
-
hashCode
public int hashCode()
-