Package org.keycloak.authorization.model
Interface Resource
- 
- All Known Implementing Classes:
- AbstractResourceModel,- MapResourceAdapter,- ResourceAdapter,- ResourceAdapter
 
 public interface ResourceRepresents a resource, which is usually protected by a set of policies within a resource server.- Author:
- Pedro Igor
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classResource.FilterOptionstatic classResource.SearchableFields
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.StringgetDisplayName()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()booleanisOwnerManagedAccess()Indicates if this resource can be managed by the resource owner.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> uri)Sets a list ofURIthat uniquely identify this resource.
 
- 
- 
- 
Method Detail- 
getIdString getId() Returns the unique identifier for this instance.- Returns:
- the unique identifier for this instance
 
 - 
getNameString getName() Returns the resource's name.- Returns:
- the name of this resource
 
 - 
setNamevoid setName(String name) Sets a name for this resource. The name must be unique.- Parameters:
- name- the name of this resource
 
 - 
getDisplayNameString getDisplayName() Returns the end user friendly name for this resource. If not defined, value forgetName()is returned.- Returns:
- the friendly name for this resource
 
 - 
setDisplayNamevoid setDisplayName(String name) Sets an end user friendly name for this resource.- Parameters:
- name- the name of this resource
 
 - 
updateUrisvoid updateUris(Set<String> uri) Sets a list ofURIthat uniquely identify this resource.- Parameters:
- uri- an- URIfor this resource
 
 - 
getTypeString getType() Returns a string representing the type of this resource.- Returns:
- the type of this resource or null if not defined
 
 - 
setTypevoid setType(String type) Sets a string representing the type of this resource.- Parameters:
- type- the type of this resource or null if not defined
 
 - 
setIconUrivoid setIconUri(String iconUri) Sets an iconURIfor this resource.- Parameters:
- iconUri- an uri for an icon
 
 - 
getResourceServerResourceServer getResourceServer() Returns theResourceServerto where this resource belongs to.- Returns:
- the resource server associated with this resource
 
 - 
getOwnerString getOwner() Returns the resource's owner, which is usually an identifier that uniquely identifies the resource's owner.- Returns:
- the owner of this resource
 
 - 
isOwnerManagedAccessboolean isOwnerManagedAccess() Indicates if this resource can be managed by the resource owner.- Returns:
- trueif this resource can be managed by the resource owner. Otherwise,- false.
 
 - 
setOwnerManagedAccessvoid setOwnerManagedAccess(boolean ownerManagedAccess) Sets if this resource can be managed by the resource owner.- Parameters:
- ownerManagedAccess-- trueindicates that this resource can be managed by the resource owner.
 
 - 
updateScopesvoid updateScopes(Set<Scope> scopes) Update the set of scopes associated with this resource.- Parameters:
- scopes- the list of scopes to update
 
 - 
getAttributesMap<String,List<String>> getAttributes() Returns the attributes associated with this resource.- Returns:
- a map holding the attributes associated with this resource
 
 - 
getSingleAttributeString getSingleAttribute(String name) Returns the first value of an attribute with the givenname- Parameters:
- name- of the attribute
- Returns:
- the first value of an attribute
 
 - 
getAttributeList<String> getAttribute(String name) Returns the values of an attribute with the givenname- Parameters:
- name- of the attribute
- Returns:
- the values of an attribute
 
 - 
setAttributevoid setAttribute(String name, List<String> values) Sets an attribute with the givennameandvalues.- Parameters:
- name- the attribute name
- values- the attribute values
 
 - 
removeAttributevoid removeAttribute(String name) 
 
- 
 
-