public interface ClaimStore
Modifier and Type | Method and Description |
---|---|
void |
clearImmutable()
Empties the immutable set of claims.
|
void |
clearReadOnly()
Empties the read only set of claims.
|
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.
You must use method
put(URI, Object, ClaimType)
in order to add a new claim to the claimStore.
Puts the value of a claim in the claim store.
If the claim store already contained a value for the specified claim,
then the old value will be overwritten.
You can supply a |
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.
|
Object get(URI claimUri)
get(java.net.URI, Class)
instead of this method, as it doesn't require you to cast the result.claimUri
- The URI of the claim.null
if this claim has no current value.<T> T get(URI claimUri, Class<T> cls)
claimUri
- The URI of the claim.cls
- The expected type of the claim value.null
if this claim has no current value.ClassCastException
- when the claim value is not of the expected type.Map<URI,Object> getAll()
Map
that maps claim URIs to claim values.Set<URI> getAllReadOnlyClaims()
Map
that maps claim URIs to claim values.Set<URI> getAllImmutableClaims()
Map
that maps claim URIs to claim values.void put(URI claimUri, Object value)
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.
claimUri
- The URI of the claim.value
- The value to put into the claim store.IllegalArgumentException
- If the claim is read-only.@Deprecated void put(URI claimUri, Object value, boolean writeOnce)
put(URI, Object, ClaimType)
in order to add a new claim to the claimStore.
Puts the value of a claim in the claim store.
If the claim store already contained a value for the specified claim,
then the old value will be overwritten.
You can supply a writeOnce
flag to indicate that the value cannot be
overwritten.
claimUri
- The URI of the claim.value
- The value to put into the claim store.writeOnce
- true
if the claim should be read-only.IllegalArgumentException
- If the claim is read-only.void put(URI claimUri, Object value, ClaimType claimType)
claimUri
- The URI of the claim.value
- The value to put into the claim store.claimType
- The type of the claim.IllegalArgumentException
- If the claim is read-only.void put(URI claimUri, Object value, ClaimValueScope claimScope)
IllegalArgumentException
is thrown.claimUri
- The URI of the claim.value
- The value to put into the claim store.claimScope
- The ad-hoc claim scope.IllegalArgumentException
- If the claim is read-only.void put(URI claimUri, Object value, ClaimType claimType, ClaimValueScope claimScope)
IllegalArgumentException
is thrown.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.IllegalArgumentException
- If the claim is read-only.void remove(URI claimUri)
claimUri
- The URI of the claim.IllegalArgumentException
- If the claim is read-only.boolean contains(URI claimUri)
true
if the claim store contains a claim, false
otherwise.claimUri
- The URI of the claim.true
if the claim store contains a claim, false
otherwise.void clearReadOnly()
void clearImmutable()
boolean isReadOnly(URI claimUri)
true
if the claim is read-only, false
otherwise.claimUri
- The URI of the claim.true
if the claim is read-only, false
otherwise.boolean isImmutable(URI claimUri)
true
if the claim is immutable, false
otherwise.claimUri
- The URI of the claim.true
if the claim is immutable, false
otherwise.void setReadOnlyClaims(Collection<URI> readOnlyClaims)
readOnlyClaims
- List of Claimsvoid setImmutableClaims(Collection<URI> immutableClaims)
immutableClaims
- List of Claimsvoid removeRequestScopedClaims()
Map<URI,ClaimValueScope> getAdHocClaimScopes()
ClaimValueScope getConfiguredClaimScope(URI claimUri)
claimUri
- the claim URIvoid shrinkStaticClaims()
boolean isSessionScopedClaim(ClaimValueScope scope)
true
if given scope lives during session.scope
- scope of the claim.false
if scope is null.Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries