Class RuntimeDescriptionDatabase


  • @ThreadSafe
    public final class RuntimeDescriptionDatabase
    extends java.lang.Object
    A persistent database of runtime descriptions.
    • Method Detail

      • open

        public static RuntimeDescriptionDatabase open​(java.nio.file.Path path)
                                               throws java.io.IOException
        Open an existing, or create a new, on-disk cache. The cache will be populated from the contents of the given directory if it exists and contains runtime descriptions.
        Parameters:
        path - The directory
        Returns:
        A new cache
        Throws:
        java.io.IOException - On I/O errors
      • updated

        public java.util.Optional<java.time.OffsetDateTime> updated()
        Returns:
        The time of the most recent database update
      • add

        public void add​(RuntimeDescription description)
        Add a runtime to the cache. The runtime will be persisted to disk, but no exception will be raised if persisting the file fails.
        Parameters:
        description - The runtimes to be added
      • delete

        public void delete​(java.lang.String id)
        Delete a runtime from the cache. The runtime will be deleted from disk, but no exception will be raised if deleting the file fails.
        Parameters:
        id - The runtimes to be added
      • descriptions

        public java.util.Map<java.lang.String,​RuntimeDescription> descriptions()
        Returns:
        A read-only map of the current runtimes