Interface ETagStore


public interface ETagStore

Pluggable store for request ETag values.

As described in Conditional GET, the TROLIE specification relies heavily on use of Conditional GETs, using the standard ETag response header (see standards) to mark the version of data returned.

Implementations of this interface provide key-value storage for these ETags as application state. By default, the TrolieClientBuilder will inject an in-memory implementation of this store. Users may wish to override this interface however to use storage such as a database that better maps to their own application architecture.

  • Method Summary

    Modifier and Type
    Method
    Description
    getETag(String endpointPath)
    Get the currently stored eTag for this particular path.
    void
    putETag(String endpointPath, String eTag)
    Store a new value at this particular path.
  • Method Details

    • getETag

      String getETag(String endpointPath)
      Get the currently stored eTag for this particular path.
      Parameters:
      endpointPath - The full path at which data is requested is effectively the key to look up the data.
      Returns:
      raw string value if stored, null if non-existent.
    • putETag

      void putETag(String endpointPath, String eTag)
      Store a new value at this particular path.
      Parameters:
      endpointPath - The full path at which data is requested is effectively the key to look up the data.
      eTag - value of the eTag as returned in the response header from the TROLIE server.