Interface LocationCache

  • All Known Implementing Classes:
    DiskLocationCache

    public interface LocationCache
    An object which knows how to convert a slow (typically remote) Location to a faster (typically local) one.
    Author:
    Curtis Rueden
    • Method Detail

      • canCache

        boolean canCache​(Location source)
        Gets whether the given location can be cached by this cache.
      • loadChecksum

        String loadChecksum​(Location source)
                     throws IOException
        Loads the checksum value which corresponds to the cached location.
        Parameters:
        source - The source location for which the cached checksum is desired.
        Returns:
        The loaded checksum, or null if one is not available.
        Throws:
        IOException - If something goes wrong accessing the checksum.
        See Also:
        DataHandle.checksum()
      • saveChecksum

        void saveChecksum​(Location source,
                          String checksum)
                   throws IOException
        Associates the given checksum value with the specified source location.
        Parameters:
        source - The source location for which the checksum should be cached.
        checksum - The checksum value to cache.
        Throws:
        IOException - If something goes wrong caching the checksum.
        See Also:
        DataHandle.checksum()