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
  • Method Details

    • 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

      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