Package org.opensaml.storage.impl.client

# Interface ClientStorageServiceStore

All Known Implementing Classes:
  `AbstractClientStorageServiceStore`, `JSONClientStorageServiceStore`, `XMLClientStorageServiceStore`

public interface ClientStorageServiceStore
Abstraction for the storage and reconstitution of data for a `ClientStorageService`.

Since:
  4.1.0

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static interface`
`ClientStorageServiceStore.Factory`
A factory for producing new `ClientStorageServiceStore` instances.

## Method Summary

Modifier and Type
Method
Description
`Map<String,Map<String,MutableStorageRecord<?>>>`
`getContextMap()`
Get the map of contexts to manipulate during operations.
`ClientStorageService.ClientStorageSource`
`getSource()`
Get the data source.
`boolean`
`isDirty()`
Get the dirty bit for the current data.
`void`
`load(String raw, ClientStorageService.ClientStorageSource src)`
Reconstitute stored data.
`ClientStorageServiceOperation`
`save(ClientStorageService storageService)`
Serialize current state of stored data into a storage operation.
`void`
`setDirty(boolean flag)`
Set the dirty bit for the current data.

## Method Details

### getSource

@Nullable 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

### getContextMap

@Nonnull @Live Map<String,Map<String,MutableStorageRecord<?>>> getContextMap()
Get the map of contexts to manipulate during operations.

Returns:
  map of contexts to manipulate

### load

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.

Parameters:
  `raw` - serialized data to load
  `src` - storage source

### save

@Nullable ClientStorageServiceOperation save(@Nonnull ClientStorageService storageService) throws IOException
Serialize current state of stored data into a storage operation.

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