public class DefaultClaimStore extends Object implements Serializable, ClaimStore
Modifier | Constructor and Description |
---|---|
|
DefaultClaimStore()
Constructor, creates and initializes a new
ClaimStore . |
protected |
DefaultClaimStore(Map<URI,Object> values,
Set<URI> readOnlyFields)
Deprecated.
This constructor should not be used, as it copies only part of the state of the object.
It clears all immutable fields and ad-hoc claim scopes.
|
protected |
DefaultClaimStore(Map<URI,Object> values,
Set<URI> readOnlyFields,
Set<URI> immutableFields)
Deprecated.
This constructor should not be used, as it copies only part of the state of the object.
It clears all and ad-hoc claim scopes.
|
protected |
DefaultClaimStore(Map<URI,Object> values,
Set<URI> readOnlyFields,
Set<URI> immutableFields,
Map<URI,ClaimValueScope> adHocClaimScopesRef)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clearImmutable()
Empties the immutable set of claims.
|
void |
clearReadOnly()
Empties the read only set of claims.
|
DefaultClaimStore |
clone()
Creates and returns a copy of this object.
|
boolean |
contains(URI claimUri)
Returns
true if the claim store contains a claim, false otherwise. |
Object |
get(URI claimUri)
Gets the value of a claim from the claim store.
|
<T> T |
get(URI claimUri,
Class<T> cls)
Gets the value of a claim from the claim store.
|
Map<URI,ClaimValueScope> |
getAdHocClaimScopes() |
Map<URI,Object> |
getAll()
Gets a map containing all the claim values in the claim store.
|
Set<URI> |
getAllImmutableClaims()
Gets a set containing all the immutable claim in the claim store.
|
Set<URI> |
getAllReadOnlyClaims()
Gets a set containing all the read only claim in the claim store.
|
Map<URI,Object> |
getClaimValues()
Current values of claims.
|
ClaimValueScope |
getConfiguredClaimScope(URI claimUri)
Returns the configured scope of the claim identified by URI.
|
Set<URI> |
getImmutable() |
Set<URI> |
getReadOnly()
Claims in this set are read-only.
|
boolean |
isImmutable(URI claimUri)
Returns
true if the claim is immutable, false otherwise. |
boolean |
isReadOnly(URI claimUri)
Returns
true if the claim is read-only, false otherwise. |
boolean |
isSessionScopedClaim(ClaimValueScope scope)
Returns
true if given scope lives during session. |
void |
put(URI claimUri,
Object value)
Puts the value of a claim in the claim store.
|
void |
put(URI claimUri,
Object value,
boolean writeOnce)
Deprecated.
|
void |
put(URI claimUri,
Object value,
ClaimType claimType)
Puts the value of a claim in the claim store.
|
void |
put(URI claimUri,
Object value,
ClaimType claimType,
ClaimValueScope claimScope)
Puts the value of a claim in the claim store, under the following conditions.
|
void |
put(URI claimUri,
Object value,
ClaimValueScope claimScope)
Puts the value of a claim in the claim store, under the following conditions.
|
void |
remove(URI claimUri)
Removes the value of a claim from the claim store.
|
void |
removeRequestScopedClaims()
Goes through the claims in the ClaimStore and deletes the ones that don't have a configured scope for SESSION.
|
void |
setImmutableClaims(Collection<URI> immutableClaims)
Set a collection of claim as immutable.
|
void |
setReadOnlyClaims(Collection<URI> readOnlyClaims)
Set a collection of claim as read-only.
|
void |
shrinkStaticClaims()
Removes all static-scoped claims from claim value map.
|
public DefaultClaimStore()
ClaimStore
.
method is called internally by the framework, clients should not
normally create a claim store directly.@Deprecated protected DefaultClaimStore(Map<URI,Object> values, Set<URI> readOnlyFields)
values
- Values.readOnlyFields
- Read-only fields.@Deprecated protected DefaultClaimStore(Map<URI,Object> values, Set<URI> readOnlyFields, Set<URI> immutableFields)
values
- Values.readOnlyFields
- Read-only fields.immutableFields
- Immutable fields.protected DefaultClaimStore(Map<URI,Object> values, Set<URI> readOnlyFields, Set<URI> immutableFields, Map<URI,ClaimValueScope> adHocClaimScopesRef)
clone()
method.values
- Values.readOnlyFields
- Read-only fields.immutableFields
- Immutable fields.adHocClaimScopesRef
- Ad-hoc claim scopes.public Object get(URI claimUri)
ClaimStore
ClaimStore.get(java.net.URI, Class)
instead of this method, as it doesn't require you to cast the result.get
in interface ClaimStore
claimUri
- The URI of the claim.null
if this claim has no current value.public <T> T get(URI claimUri, Class<T> cls)
ClaimStore
get
in interface ClaimStore
claimUri
- The URI of the claim.cls
- The expected type of the claim value.null
if this claim has no current value.public Map<URI,Object> getAll()
ClaimStore
getAll
in interface ClaimStore
Map
that maps claim URIs to claim values.public Set<URI> getAllReadOnlyClaims()
ClaimStore
getAllReadOnlyClaims
in interface ClaimStore
Map
that maps claim URIs to claim values.public Set<URI> getAllImmutableClaims()
ClaimStore
getAllImmutableClaims
in interface ClaimStore
Map
that maps claim URIs to claim values.public void put(URI claimUri, Object value)
ClaimStore
If the claim is read-only, an IllegalArgumentException
is thrown.
If the claim is immutable, and there is not yet a value for the claim in the claim store, the value is stored.
If the claim is immutable, and there is already a value for the claim in the claim store, the value in the claim store is not modified - nothing happens.
put
in interface ClaimStore
claimUri
- The URI of the claim.value
- The value to put into the claim store.@Deprecated public void put(URI claimUri, Object value, boolean writeOnce)
put
in interface ClaimStore
claimUri
- The URI of the claim.value
- The value to put into the claim store.writeOnce
- true
if the claim should be read-only.public void put(URI claimUri, Object value, ClaimType claimType)
ClaimStore
put
in interface ClaimStore
claimUri
- The URI of the claim.value
- The value to put into the claim store.claimType
- The type of the claim.public void put(URI claimUri, Object value, ClaimValueScope claimScope)
ClaimStore
IllegalArgumentException
is thrown.put
in interface ClaimStore
claimUri
- The URI of the claim.value
- The value to put into the claim store.claimScope
- The ad-hoc claim scope.public void put(URI claimUri, Object value, ClaimType claimType, ClaimValueScope claimScope)
ClaimStore
IllegalArgumentException
is thrown.put
in interface ClaimStore
claimUri
- The URI of the claim.value
- The value to put into the claim store.claimType
- The type of the claim for ad-hoc claims.claimScope
- The scope of the claim for ad-hoc claims.public ClaimValueScope getConfiguredClaimScope(URI claimUri)
ClaimStore
getConfiguredClaimScope
in interface ClaimStore
claimUri
- the claim URIpublic void remove(URI claimUri)
ClaimStore
remove
in interface ClaimStore
claimUri
- The URI of the claim.public boolean contains(URI claimUri)
ClaimStore
true
if the claim store contains a claim, false
otherwise.contains
in interface ClaimStore
claimUri
- The URI of the claim.true
if the claim store contains a claim, false
otherwise.public void clearReadOnly()
ClaimStore
clearReadOnly
in interface ClaimStore
public void clearImmutable()
ClaimStore
clearImmutable
in interface ClaimStore
public boolean isReadOnly(URI claimUri)
ClaimStore
true
if the claim is read-only, false
otherwise.isReadOnly
in interface ClaimStore
claimUri
- The URI of the claim.true
if the claim is read-only, false
otherwise.public boolean isImmutable(URI claimUri)
ClaimStore
true
if the claim is immutable, false
otherwise.isImmutable
in interface ClaimStore
claimUri
- The URI of the claim.true
if the claim is immutable, false
otherwise.public DefaultClaimStore clone()
public void shrinkStaticClaims()
ClaimStore
shrinkStaticClaims
in interface ClaimStore
public void setReadOnlyClaims(Collection<URI> readOnlyClaims)
ClaimStore
setReadOnlyClaims
in interface ClaimStore
readOnlyClaims
- List of Claimspublic void setImmutableClaims(Collection<URI> immutableClaims)
ClaimStore
setImmutableClaims
in interface ClaimStore
immutableClaims
- List of Claimspublic boolean isSessionScopedClaim(ClaimValueScope scope)
ClaimStore
true
if given scope lives during session.isSessionScopedClaim
in interface ClaimStore
scope
- scope of the claim.false
if scope is null.public void removeRequestScopedClaims()
ClaimStore
removeRequestScopedClaims
in interface ClaimStore
public Map<URI,Object> getClaimValues()
ClaimStore
getClaimValues
in interface ClaimStore
public Set<URI> getReadOnly()
ClaimStore
getReadOnly
in interface ClaimStore
public Set<URI> getImmutable()
getImmutable
in interface ClaimStore
public Map<URI,ClaimValueScope> getAdHocClaimScopes()
getAdHocClaimScopes
in interface ClaimStore
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries