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)
ClaimStoreClaimStore.get(java.net.URI, Class)
instead of this method, as it doesn't require you to cast the result.get in interface ClaimStoreclaimUri - The URI of the claim.null if this claim has no current value.public <T> T get(URI claimUri, Class<T> cls)
ClaimStoreget in interface ClaimStoreclaimUri - 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()
ClaimStoregetAll in interface ClaimStoreMap that maps claim URIs to claim values.public Set<URI> getAllReadOnlyClaims()
ClaimStoregetAllReadOnlyClaims in interface ClaimStoreMap that maps claim URIs to claim values.public Set<URI> getAllImmutableClaims()
ClaimStoregetAllImmutableClaims in interface ClaimStoreMap 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 ClaimStoreclaimUri - 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 ClaimStoreclaimUri - 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)
ClaimStoreput in interface ClaimStoreclaimUri - 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)
ClaimStoreIllegalArgumentException is thrown.put in interface ClaimStoreclaimUri - 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)
ClaimStoreIllegalArgumentException is thrown.put in interface ClaimStoreclaimUri - 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)
ClaimStoregetConfiguredClaimScope in interface ClaimStoreclaimUri - the claim URIpublic void remove(URI claimUri)
ClaimStoreremove in interface ClaimStoreclaimUri - The URI of the claim.public boolean contains(URI claimUri)
ClaimStoretrue if the claim store contains a claim, false otherwise.contains in interface ClaimStoreclaimUri - The URI of the claim.true if the claim store contains a claim, false otherwise.public void clearReadOnly()
ClaimStoreclearReadOnly in interface ClaimStorepublic void clearImmutable()
ClaimStoreclearImmutable in interface ClaimStorepublic boolean isReadOnly(URI claimUri)
ClaimStoretrue if the claim is read-only, false otherwise.isReadOnly in interface ClaimStoreclaimUri - The URI of the claim.true if the claim is read-only, false otherwise.public boolean isImmutable(URI claimUri)
ClaimStoretrue if the claim is immutable, false otherwise.isImmutable in interface ClaimStoreclaimUri - The URI of the claim.true if the claim is immutable, false otherwise.public DefaultClaimStore clone()
public void shrinkStaticClaims()
ClaimStoreshrinkStaticClaims in interface ClaimStorepublic void setReadOnlyClaims(Collection<URI> readOnlyClaims)
ClaimStoresetReadOnlyClaims in interface ClaimStorereadOnlyClaims - List of Claimspublic void setImmutableClaims(Collection<URI> immutableClaims)
ClaimStoresetImmutableClaims in interface ClaimStoreimmutableClaims - List of Claimspublic boolean isSessionScopedClaim(ClaimValueScope scope)
ClaimStoretrue if given scope lives during session.isSessionScopedClaim in interface ClaimStorescope - scope of the claim.false if scope is null.public void removeRequestScopedClaims()
ClaimStoreremoveRequestScopedClaims in interface ClaimStorepublic Map<URI,Object> getClaimValues()
ClaimStoregetClaimValues in interface ClaimStorepublic Set<URI> getReadOnly()
ClaimStoregetReadOnly in interface ClaimStorepublic Set<URI> getImmutable()
getImmutable in interface ClaimStorepublic Map<URI,ClaimValueScope> getAdHocClaimScopes()
getAdHocClaimScopes in interface ClaimStoreCopyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries