Class PassthroughCacheMetaStore

  • All Implemented Interfaces:
    MetaReader, MetaStore

    public class PassthroughCacheMetaStore
    extends java.lang.Object
    implements MetaReader, MetaStore
    An in memory cache that will pass through to a provided local tuf store.
    • Method Detail

      • getIdentifier

        public java.lang.String getIdentifier()
        Description copied from interface: MetaStore
        A generic string for identifying the local store in debug messages. A file system based implementation might return the path being used for storage, while an in-memory store may just return something like 'in-memory'.
        Specified by:
        getIdentifier in interface MetaStore
      • readMeta

        public <T extends SignedTufMeta<? extends TufMeta>> java.util.Optional<T> readMeta​(java.lang.String roleName,
                                                                                           java.lang.Class<T> tClass)
                                                                                    throws java.io.IOException
        Description copied from interface: MetaReader
        Return a named metadata item if there is any.
        Specified by:
        readMeta in interface MetaReader
        Parameters:
        roleName - the name of the role to load (root, timestamp, snapshot, targets, or a delegated target role)
        tClass - the class type
        Returns:
        an instance of the signed metadata for the role if it was found
        Throws:
        java.io.IOException - if an error occurs reading from the backing store
      • writeMeta

        public void writeMeta​(java.lang.String roleName,
                              SignedTufMeta<? extends TufMeta> meta)
                       throws java.io.IOException
        Description copied from interface: MetaStore
        Generic method to store one of the SignedTufMeta resources in the local tuf store.
        Specified by:
        writeMeta in interface MetaStore
        Parameters:
        roleName - the name of the role
        meta - the metadata to store
        Throws:
        java.io.IOException - if writing the resource causes an IO error
      • clearMeta

        public void clearMeta​(java.lang.String role)
                       throws java.io.IOException
        Description copied from interface: MetaStore
        Generic method to remove meta, useful when keys rotated in root. Deletion is not optional, implementers must ensure meta is removed from the storage medium.
        Specified by:
        clearMeta in interface MetaStore
        Throws:
        java.io.IOException - implementations that read/write IO to clear the data may throw IOException
        See Also:
        5.3.11