Top Description Fields Constructors Methods
org.keycloak.representations.idm.authorization

public Class ResourceRepresentation

extends Object
Class Inheritance
Imports
java.net.URI, java.util.Collections, .HashSet, .List, .Map, .Objects, .Set, com.fasterxml.jackson.annotation.JsonIgnore, .JsonInclude, .JsonProperty, .JsonSetter, com.fasterxml.jackson.databind.annotation.JsonDeserialize, org.keycloak.json.StringListMapDeserializer

One or more resources that the resource server manages as a set of protected resources.

For more details, OAuth-resource-reg.

Author
Pedro Igor

Field Summary

Modifier and TypeField and Description
private Map<String, List<String>>
private String
private String
private String
private String
private ResourceOwnerRepresentation
private Boolean
private Set<ScopeRepresentation>
private String
private Set<String>

Constructor Summary

AccessConstructor and Description
public
ResourceRepresentation(String
a human-readable string describing a set of one or more resources
name
,
Set<ScopeRepresentation>
the available scopes for this resource set
scopes
,
Set<String>
a List of URI that provides network locations for the resource set being registered
uris
,
String
a string uniquely identifying the semantics of the resource set
type
,
String
a URI for a graphic icon representing the resource set
iconUri
)

Creates a new instance.

public
public
ResourceRepresentation(String
a human-readable string describing a set of one or more resources
name
,
Set<ScopeRepresentation>
the available scopes for this resource set
scopes
,
Set<String>
a List of URI that provides the network location for the resource set being registered
uris
,
String
a string uniquely identifying the semantics of the resource set
type
)

Creates a new instance.

public
public
ResourceRepresentation(String
a human-readable string describing a set of one or more resources
name
,
Set<ScopeRepresentation>
the available scopes for this resource set
scopes
)

Creates a new instance.

public
public
ResourceRepresentation()

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public void
addScope(String... scopeNames)

public void
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public Map<String, List<String>>
public String
public String
public String
public String
public ResourceOwnerRepresentation
public Boolean
public Set<ScopeRepresentation>
public String
public String
getUri()

Deprecated
public Set<String>
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public void
public void
setDisplayName(String displayName)

public void
setIconUri(String iconUri)

public void
public void
public void
public void
setOwner(String ownerId)

public void
setOwnerManagedAccess(Boolean ownerManagedAccess)

public void
private void
setScopesUma(Set<ScopeRepresentation> scopes)

TODO: This is a workaround to allow deserialization of UMA resource representation.

public void
public void
setUri(String uri)

Deprecated
public void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

attributesback to summary
private Map<String, List<String>> attributes
Annotations
@JsonDeserialize
using:StringListMapDeserializer
displayNameback to summary
private String displayName
iconUriback to summary
private String iconUri
Annotations
@JsonProperty:icon_uri
idback to summary
private String id
Annotations
@JsonProperty:_id
nameback to summary
private String name
ownerback to summary
private ResourceOwnerRepresentation owner
ownerManagedAccessback to summary
private Boolean ownerManagedAccess
scopesback to summary
private Set<ScopeRepresentation> scopes
Annotations
@JsonInclude:NON_EMPTY
@JsonProperty:scopes
typeback to summary
private String type
urisback to summary
private Set<String> uris
Annotations
@JsonProperty:uris

Constructor Detail

ResourceRepresentationback to summary
public ResourceRepresentation(String name, Set<ScopeRepresentation> scopes, Set<String> uris, String type, String iconUri)

Creates a new instance.

Parameters
name:String

a human-readable string describing a set of one or more resources

scopes:Set<ScopeRepresentation>

the available scopes for this resource set

uris:Set<String>

a List of URI that provides network locations for the resource set being registered

type:String

a string uniquely identifying the semantics of the resource set

iconUri:String

a URI for a graphic icon representing the resource set

ResourceRepresentationback to summary
public ResourceRepresentation(String name, Set<ScopeRepresentation> scopes, String uri, String type, String iconUri)
ResourceRepresentationback to summary
public ResourceRepresentation(String name, Set<ScopeRepresentation> scopes, Set<String> uris, String type)

Creates a new instance.

Parameters
name:String

a human-readable string describing a set of one or more resources

scopes:Set<ScopeRepresentation>

the available scopes for this resource set

uris:Set<String>

a List of URI that provides the network location for the resource set being registered

type:String

a string uniquely identifying the semantics of the resource set

ResourceRepresentationback to summary
public ResourceRepresentation(String name, Set<ScopeRepresentation> scopes, String uri, String type)
ResourceRepresentationback to summary
public ResourceRepresentation(String name, Set<ScopeRepresentation> scopes)

Creates a new instance.

Parameters
name:String

a human-readable string describing a set of one or more resources

scopes:Set<ScopeRepresentation>

the available scopes for this resource set

ResourceRepresentationback to summary
public ResourceRepresentation(String name, String... scopes)
ResourceRepresentationback to summary
public ResourceRepresentation()

Creates a new instance.

Method Detail

addScopeback to summary
public void addScope(String... scopeNames)
addScopeback to summary
public void addScope(ScopeRepresentation scope)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getAttributesback to summary
public Map<String, List<String>> getAttributes()
getDisplayNameback to summary
public String getDisplayName()
getIconUriback to summary
public String getIconUri()
getIdback to summary
public String getId()
getNameback to summary
public String getName()
getOwnerback to summary
public ResourceOwnerRepresentation getOwner()
getOwnerManagedAccessback to summary
public Boolean getOwnerManagedAccess()
getScopesback to summary
public Set<ScopeRepresentation> getScopes()
getTypeback to summary
public String getType()
getUriback to summary
public String getUri()

Deprecated

Annotations
@Deprecated
@JsonIgnore
getUrisback to summary
public Set<String> getUris()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

setAttributesback to summary
public void setAttributes(Map<String, List<String>> attributes)
setDisplayNameback to summary
public void setDisplayName(String displayName)
setIconUriback to summary
public void setIconUri(String iconUri)
setIdback to summary
public void setId(String id)
setNameback to summary
public void setName(String name)
setOwnerback to summary
public void setOwner(ResourceOwnerRepresentation owner)
Annotations
@JsonProperty
setOwnerback to summary
public void setOwner(String ownerId)
Annotations
@JsonIgnore
setOwnerManagedAccessback to summary
public void setOwnerManagedAccess(Boolean ownerManagedAccess)
setScopesback to summary
public void setScopes(Set<ScopeRepresentation> scopes)
setScopesUmaback to summary
private void setScopesUma(Set<ScopeRepresentation> scopes)

TODO: This is a workaround to allow deserialization of UMA resource representation. Jackson 2.19+ support aliases, once we upgrade, change this.

Annotations
@JsonSetter:resource_scopes
setTypeback to summary
public void setType(String type)
setUriback to summary
public void setUri(String uri)

Deprecated

Annotations
@Deprecated
@JsonSetter:uri
setUrisback to summary
public void setUris(Set<String> uris)