Package org.opensaml.storage.impl.client
Class AbstractClientStorageServiceStore
java.lang.Object
org.opensaml.storage.impl.client.AbstractClientStorageServiceStore
- All Implemented Interfaces:
ClientStorageServiceStore
- Direct Known Subclasses:
JSONClientStorageServiceStore,XMLClientStorageServiceStore
public abstract class AbstractClientStorageServiceStore
extends Object
implements ClientStorageServiceStore
Base class for the storage and reconstitution of data for a
ClientStorageService.- Since:
- 4.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensaml.storage.impl.client.ClientStorageServiceStore
ClientStorageServiceStore.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<String,Map<String, MutableStorageRecord<?>>> The underlying map of data records.private booleanDirty bit.Data source. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidReconstitute stored data.Get the map of contexts to manipulate during operations.Get the data source.booleanisDirty()Get the dirty bit for the current data.voidReconstitute stored data.abstract ClientStorageServiceOperationsave(ClientStorageService storageService) Serialize current state of stored data into a storage operation.voidsetDirty(boolean flag) Set the dirty bit for the current data.
-
Field Details
-
contextMap
The underlying map of data records. -
source
Data source. -
dirty
private boolean dirtyDirty bit.
-
-
Constructor Details
-
AbstractClientStorageServiceStore
AbstractClientStorageServiceStore()Reconstitute stored data.
-
-
Method Details
-
getSource
Get the data source.- Specified by:
getSourcein interfaceClientStorageServiceStore- Returns:
- data source
-
isDirty
public boolean isDirty()Get the dirty bit for the current data.- Specified by:
isDirtyin interfaceClientStorageServiceStore- Returns:
- status of dirty bit
-
setDirty
public void setDirty(boolean flag) Set the dirty bit for the current data.- Specified by:
setDirtyin interfaceClientStorageServiceStore- Parameters:
flag- dirty bit to set
-
getContextMap
Get the map of contexts to manipulate during operations.- Specified by:
getContextMapin interfaceClientStorageServiceStore- Returns:
- map of contexts to manipulate
-
load
public void load(@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.
By design this method should not throw under any non-catastrophic conditions.
- Specified by:
loadin interfaceClientStorageServiceStore- Parameters:
raw- serialized data to loadsrc- storage source
-
doLoad
Reconstitute stored data.- Parameters:
raw- serialized data to load- Throws:
IOException- if an error occurs
-
save
@Nullable public abstract ClientStorageServiceOperation save(@Nonnull ClientStorageService storageService) throws IOException Serialize current state of stored data into a storage operation.- Specified by:
savein interfaceClientStorageServiceStore- Parameters:
storageService- storage service- Returns:
- the operation, or a null if the data has not been modified since loading or saving
- Throws:
IOException- if an error occurs
-