Interface ConfigurationService

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
ConfigurationServiceEtcdImpl, ConfigurationServiceGrpcImpl

public interface ConfigurationService extends AutoCloseable
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
     
    void
    deleteFiles(@NotNull Collection<String> filenames)
    Atomically remove all properties files in the collection of names.
    @NotNull Map<String,byte[]>
    Load all known configuration files.
    Optional<byte[]>
    getFile(@NotNull String filename)
    Load the named configuration and return the contents as a ByteString.
    void
    updateFile(@NotNull String filename, @org.jetbrains.annotations.NotNull byte[] contents, boolean updateOnSameContents)
    Update the stored properties file with the given name with the new supplied contents.
  • Method Details

    • about

      String about()
    • getFile

      Optional<byte[]> getFile(@NotNull @NotNull String filename) throws ConfigurationAccessException
      Load the named configuration and return the contents as a ByteString.
      Parameters:
      filename - the "filename" to load
      Returns:
      the file contents as a byte array
      Throws:
      ConfigurationAccessException
    • getAllFiles

      @NotNull @NotNull Map<String,byte[]> getAllFiles() throws ConfigurationAccessException
      Load all known configuration files.
      Returns:
      a map of names to file contents. Caller must remember the starting filename.
      Throws:
      ConfigurationAccessException - if the complete result cannot be loaded
    • updateFile

      void updateFile(@NotNull @NotNull String filename, @NotNull @org.jetbrains.annotations.NotNull byte[] contents, boolean updateOnSameContents) throws ConfigurationAccessException
      Update the stored properties file with the given name with the new supplied contents.
      Parameters:
      filename - the filename
      contents - the file contents
      updateOnSameContents - whether the file should be updated even if the contents are the same
      Throws:
      ConfigurationAccessException
    • deleteFiles

      void deleteFiles(@NotNull @NotNull Collection<String> filenames) throws ConfigurationAccessException
      Atomically remove all properties files in the collection of names. Removing a file that does not exist is not considered an error.
      Parameters:
      filenames - the file names to remove
      Throws:
      ConfigurationAccessException - for any errors removing the files.
    • close

      void close()
      Specified by:
      close in interface AutoCloseable