Package org.opensaml.storage.impl.client
Class ClientStorageService.ClientStorageServiceStore
- java.lang.Object
-
- org.opensaml.storage.impl.client.ClientStorageService.ClientStorageServiceStore
-
- Enclosing class:
- ClientStorageService
public class ClientStorageService.ClientStorageServiceStore extends Object
Implements a session-bound backing store and locking mechanism for theClientStorageService.
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,Map<String,MutableStorageRecord<?>>>contextMapThe underlying map of data records.private booleandirtyDirty bit.private ClientStorageService.ClientStorageSourcesourceData source.
-
Constructor Summary
Constructors Constructor Description ClientStorageServiceStore(String raw, ClientStorageService.ClientStorageSource src)Reconstitute stored data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) Map<String,Map<String,MutableStorageRecord<?>>>getContextMap()Get the map of contexts to manipulate during operations.ClientStorageService.ClientStorageSourcegetSource()Get the data source.(package private) booleanisDirty()Get the dirty bit for the current data.(package private) ClientStorageServiceOperationsave()Serialize current state of stored data into a storage operation.(package private) voidsetDirty(boolean flag)Set the dirty bit for the current data.
-
-
-
Field Detail
-
contextMap
@Nonnull @NonnullElements private final Map<String,Map<String,MutableStorageRecord<?>>> contextMap
The underlying map of data records.
-
source
@Nonnull private final ClientStorageService.ClientStorageSource source
Data source.
-
dirty
private boolean dirty
Dirty bit.
-
-
Constructor Detail
-
ClientStorageServiceStore
ClientStorageServiceStore(@Nullable @NotEmpty String raw, @Nonnull ClientStorageService.ClientStorageSource src)
Reconstitute stored data.The dirty bit is set based on the result. If successful, the bit is cleared, but if an error occurs, it will be set.
- Parameters:
raw- serialized data to loadsrc- data source
-
-
Method Detail
-
getContextMap
@Nonnull @NonnullElements @Live Map<String,Map<String,MutableStorageRecord<?>>> getContextMap()
Get the map of contexts to manipulate during operations.- Returns:
- map of contexts to manipulate
-
getSource
@Nonnull public ClientStorageService.ClientStorageSource getSource()
Get the data source.- Returns:
- data source
-
isDirty
boolean isDirty()
Get the dirty bit for the current data.- Returns:
- status of dirty bit
-
setDirty
void setDirty(boolean flag)
Set the dirty bit for the current data.- Parameters:
flag- dirty bit to set
-
save
@Nullable ClientStorageServiceOperation save() throws IOException
Serialize current state of stored data into a storage operation.- Returns:
- the operation, or a null if the data has not been modified since loading or saving
- Throws:
IOException- if an error occurs
-
-