Class MapResourceAdapter
- java.lang.Object
-
- org.keycloak.authorization.model.AbstractAuthorizationModel
-
- org.keycloak.models.map.authorization.adapter.AbstractResourceModel<MapResourceEntity>
-
- org.keycloak.models.map.authorization.adapter.MapResourceAdapter
-
- All Implemented Interfaces:
Resource
public class MapResourceAdapter extends AbstractResourceModel<MapResourceEntity>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.authorization.model.Resource
Resource.FilterOption, Resource.SearchableFields
-
-
Field Summary
-
Fields inherited from class org.keycloak.models.map.authorization.adapter.AbstractResourceModel
entity
-
Fields inherited from class org.keycloak.authorization.model.AbstractAuthorizationModel
storeFactory
-
-
Constructor Summary
Constructors Constructor Description MapResourceAdapter(RealmModel realm, ResourceServer resourceServer, MapResourceEntity entity, StoreFactory storeFactory)
-
Method Summary
All Methods Instance Methods Concrete 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.StringtoString()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.-
Methods inherited from class org.keycloak.models.map.authorization.adapter.AbstractResourceModel
equals, hashCode
-
Methods inherited from class org.keycloak.authorization.model.AbstractAuthorizationModel
throwExceptionIfReadonly
-
-
-
-
Constructor Detail
-
MapResourceAdapter
public MapResourceAdapter(RealmModel realm, ResourceServer resourceServer, MapResourceEntity entity, StoreFactory storeFactory)
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:ResourceReturns the unique identifier for this instance.- Returns:
- the unique identifier for this instance
-
getName
public String getName()
Description copied from interface:ResourceReturns the resource's name.- Returns:
- the name of this resource
-
setName
public void setName(String name)
Description copied from interface:ResourceSets a name for this resource. The name must be unique.- Parameters:
name- the name of this resource
-
getDisplayName
public String getDisplayName()
Description copied from interface:ResourceReturns the end user friendly name for this resource. If not defined, value forResource.getName()is returned.- Returns:
- the friendly name for this resource
-
setDisplayName
public void setDisplayName(String name)
Description copied from interface:ResourceSets an end user friendly name for this resource.- Parameters:
name- the name of this resource
-
updateUris
public void updateUris(Set<String> uri)
Description copied from interface:ResourceSets a list ofURIthat uniquely identify this resource.- Parameters:
uri- anURIfor this resource
-
getType
public String getType()
Description copied from interface:ResourceReturns a string representing the type of this resource.- Returns:
- the type of this resource or null if not defined
-
setType
public void setType(String type)
Description copied from interface:ResourceSets a string representing the type of this resource.- Parameters:
type- the type of this resource or null if not defined
-
getScopes
public List<Scope> getScopes()
Description copied from interface:Resource- Returns:
- a list with all scopes associated with this resource
-
getIconUri
public String getIconUri()
Description copied from interface:ResourceReturns an iconURIfor this resource.- Returns:
- a uri for an icon
-
setIconUri
public void setIconUri(String iconUri)
Description copied from interface:ResourceSets an iconURIfor this resource.- Parameters:
iconUri- an uri for an icon
-
getResourceServer
public ResourceServer getResourceServer()
Description copied from interface:ResourceReturns theResourceServerto where this resource belongs to.- Returns:
- the resource server associated with this resource
-
getOwner
public String getOwner()
Description copied from interface:ResourceReturns the resource's owner, which is usually an identifier that uniquely identifies the resource's owner.- Returns:
- the owner of this resource
-
isOwnerManagedAccess
public boolean isOwnerManagedAccess()
Description copied from interface:ResourceIndicates if this resource can be managed by the resource owner.- Returns:
trueif this resource can be managed by the resource owner. Otherwise,false.
-
setOwnerManagedAccess
public void setOwnerManagedAccess(boolean ownerManagedAccess)
Description copied from interface:ResourceSets if this resource can be managed by the resource owner.- Parameters:
ownerManagedAccess-trueindicates that this resource can be managed by the resource owner.
-
updateScopes
public void updateScopes(Set<Scope> scopes)
Description copied from interface:ResourceUpdate the set of scopes associated with this resource.- Parameters:
scopes- the list of scopes to update
-
getAttributes
public Map<String,List<String>> getAttributes()
Description copied from interface:ResourceReturns the attributes associated with this resource.- Returns:
- a map holding the attributes associated with this resource
-
getSingleAttribute
public String getSingleAttribute(String name)
Description copied from interface:ResourceReturns the first value of an attribute with the givenname- Parameters:
name- of the attribute- Returns:
- the first value of an attribute
-
getAttribute
public List<String> getAttribute(String name)
Description copied from interface:ResourceReturns the values of an attribute with the givenname- Parameters:
name- of the attribute- Returns:
- the values of an attribute
-
setAttribute
public void setAttribute(String name, List<String> values)
Description copied from interface:ResourceSets an attribute with the givennameandvalues.- Parameters:
name- the attribute namevalues- the attribute values
-
removeAttribute
public void removeAttribute(String name)
-
-