public class ResourceAdapter extends Object implements Resource, CachedModel<Resource>
Resource.FilterOption, Resource.SearchableFields| Modifier and Type | Field and Description |
|---|---|
protected CachedResource |
cached |
protected StoreFactoryCacheSession |
cacheSession |
protected boolean |
invalidated |
protected List<Scope> |
scopes |
protected Resource |
updated |
| Constructor and Description |
|---|
ResourceAdapter(CachedResource cached,
StoreFactoryCacheSession cacheSession) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
List<String> |
getAttribute(String name)
Returns the values of an attribute with the given
name |
Map<String,List<String>> |
getAttributes()
Returns the attributes associated with this resource.
|
long |
getCacheTimestamp()
When was the model was loaded from database.
|
Resource |
getDelegateForUpdate()
Invalidates the cache for this model and returns a delegate that represents the actual data provider
|
String |
getDisplayName()
Returns the end user friendly name for this resource.
|
String |
getIconUri()
Returns an icon
URI for this resource. |
String |
getId()
Returns the unique identifier for this instance.
|
String |
getName()
Returns the resource's name.
|
String |
getOwner()
Returns the resource's owner, which is usually an identifier that uniquely identifies the resource's owner.
|
String |
getResourceServer()
Returns the
ResourceServer to where this resource belongs to. |
List<Scope> |
getScopes()
|
String |
getSingleAttribute(String name)
Returns the first value of an attribute with the given
name |
String |
getType()
Returns a string representing the type of this resource.
|
Set<String> |
getUris()
|
int |
hashCode() |
void |
invalidate()
Invalidate the cache for this model
|
protected void |
invalidateFlag() |
boolean |
isOwnerManagedAccess()
Indicates if this resource can be managed by the resource owner.
|
protected boolean |
isUpdated() |
void |
removeAttribute(String name) |
void |
setAttribute(String name,
List<String> values)
Sets an attribute with the given
name and values. |
void |
setDisplayName(String name)
Sets an end user friendly name for this resource.
|
void |
setIconUri(String iconUri)
Sets an icon
URI for this resource. |
void |
setName(String name)
Sets a name for this resource.
|
void |
setOwnerManagedAccess(boolean ownerManagedAccess)
Sets if this resource can be managed by the resource owner.
|
void |
setType(String type)
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 of
URI that uniquely identify this resource. |
protected final CachedResource cached
protected final StoreFactoryCacheSession cacheSession
protected Resource updated
protected boolean invalidated
public ResourceAdapter(CachedResource cached, StoreFactoryCacheSession cacheSession)
public Resource getDelegateForUpdate()
CachedModelgetDelegateForUpdate in interface CachedModel<Resource>protected void invalidateFlag()
public void invalidate()
CachedModelinvalidate in interface CachedModel<Resource>public long getCacheTimestamp()
CachedModelgetCacheTimestamp in interface CachedModel<Resource>protected boolean isUpdated()
public String getId()
Resourcepublic String getName()
Resourcepublic void setName(String name)
Resourcepublic String getDisplayName()
ResourceResource.getName() is returned.getDisplayName in interface Resourcepublic void setDisplayName(String name)
ResourcesetDisplayName in interface Resourcename - the name of this resourcepublic String getIconUri()
ResourceURI for this resource.getIconUri in interface Resourcepublic void setIconUri(String iconUri)
ResourceURI for this resource.setIconUri in interface Resourcepublic String getResourceServer()
ResourceResourceServer to where this resource belongs to.getResourceServer in interface Resourcepublic void updateUris(Set<String> uris)
ResourceURI that uniquely identify this resource.updateUris in interface Resourceuris - an URI for this resourcepublic String getType()
Resourcepublic void setType(String type)
Resourcepublic String getOwner()
Resourcepublic boolean isOwnerManagedAccess()
ResourceisOwnerManagedAccess in interface Resourcetrue if this resource can be managed by the resource owner. Otherwise, false.public void setOwnerManagedAccess(boolean ownerManagedAccess)
ResourcesetOwnerManagedAccess in interface ResourceownerManagedAccess - true indicates that this resource can be managed by the resource owner.public void updateScopes(Set<Scope> scopes)
ResourceupdateScopes in interface Resourcescopes - the list of scopes to updatepublic Map<String,List<String>> getAttributes()
ResourcegetAttributes in interface Resourcepublic String getSingleAttribute(String name)
ResourcenamegetSingleAttribute in interface Resourcepublic List<String> getAttribute(String name)
ResourcenamegetAttribute in interface Resourcepublic void setAttribute(String name, List<String> values)
Resourcename and values.setAttribute in interface Resourcename - the attribute namepublic void removeAttribute(String name)
removeAttribute in interface ResourceCopyright © 2021 JBoss by Red Hat. All rights reserved.