Package com.aquima.web.sessionmanager
Class NamespacedKeyValueStore
java.lang.Object
com.aquima.web.sessionmanager.NamespacedKeyValueStore
- All Implemented Interfaces:
com.blueriq.component.api.store.keyvalue.IKeyValueStore
public class NamespacedKeyValueStore
extends Object
implements com.blueriq.component.api.store.keyvalue.IKeyValueStore
An
IKeyValueStore
wrapper which causes all keys to be namespaced by prefixing them with an specified
namespace string followed by the the colon character.
For example, if the namespace is "example", then calling set("test", "value")
will set the "example:test" key
in the key-value store.
- Since:
- 11.0
- Author:
- Petru Galanton
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionNamespacedKeyValueStore
(com.blueriq.component.api.store.keyvalue.IKeyValueStore delegate, String namespace) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
<T> T
deserialize
(byte[] bytes, Class<T> valueType) boolean
<T extends Serializable>
Tcom.blueriq.component.api.store.keyvalue.IKeyPatternBuilder
getNamespacedKey
(String key) Applies the namespace to the given key and returns the result.byte[]
boolean
com.blueriq.component.api.store.keyvalue.IKeyValueStore.IKeyIterator
keyIterator
(com.blueriq.component.api.store.keyvalue.IKeyPattern pattern) keys
(com.blueriq.component.api.store.keyvalue.IKeyPattern pattern) byte[]
serialize
(Serializable value) void
set
(String key, Serializable value) void
set
(String key, Serializable value, long timeout, TimeUnit unit) void
void
-
Constructor Details
-
NamespacedKeyValueStore
public NamespacedKeyValueStore(com.blueriq.component.api.store.keyvalue.IKeyValueStore delegate, String namespace) Creates a new instance.- Parameters:
delegate
- - the delegate IKeyValueStore implementationnamespace
- - the key namespace, must not benull
- Throws:
IllegalArgumentException
- ifnamespace
isnull
-
-
Method Details
-
set
- Specified by:
set
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
set
- Specified by:
set
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
setRaw
- Specified by:
setRaw
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
setRaw
- Specified by:
setRaw
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
get
- Specified by:
get
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
getRaw
- Specified by:
getRaw
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
delete
- Specified by:
delete
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
deleteAll
- Specified by:
deleteAll
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
hasKey
- Specified by:
hasKey
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
expire
- Specified by:
expire
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
keyIterator
public com.blueriq.component.api.store.keyvalue.IKeyValueStore.IKeyIterator keyIterator(com.blueriq.component.api.store.keyvalue.IKeyPattern pattern) - Specified by:
keyIterator
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
keys
- Specified by:
keys
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
getNamespaceSeparator
- Specified by:
getNamespaceSeparator
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
getKeyPatternBuilder
public com.blueriq.component.api.store.keyvalue.IKeyPatternBuilder getKeyPatternBuilder()- Specified by:
getKeyPatternBuilder
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
serialize
- Specified by:
serialize
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
deserialize
- Specified by:
deserialize
in interfacecom.blueriq.component.api.store.keyvalue.IKeyValueStore
-
getNamespacedKey
Applies the namespace to the given key and returns the result.- Parameters:
key
- the key that shold be namespaced- Returns:
- the namespaced key
-