Interface IConfigService

All Superinterfaces:
IConfigClientService

public interface IConfigService extends IConfigClientService
Defines an interface to be used by admin users for storing and retrieving configuration information
  • Method Details

    • asScala

      csw.config.api.scaladsl.ConfigService asScala()
      Returns the Scala API for this instance of config service
      Specified by:
      asScala in interface IConfigClientService
      Returns:
      (undocumented)
    • create

      CompletableFuture<ConfigId> create(Path path, ConfigData configData, boolean annex, String comment)
      Creates a file at the given path with given data and comment. An IOException is thrown if the file already exists.

      Parameters:
      path - the file path relative to the repository root
      configData - contents of the file
      annex - true if the file requires special handling (external storage)
      comment - comment to associate with this operation
      Returns:
      a CompletableFuture that completes with unique id that can be used to refer to the file or fail with FileAlreadyExists or InvalidInput or FileNotFound
    • create

      CompletableFuture<ConfigId> create(Path path, ConfigData configData, String comment)
      Creates a file at the given path with given data and comment. The file is stored normally(annex is considered as false by default) An IOException is thrown if the file already exists.

      Parameters:
      path - the file path relative to the repository root
      configData - contents of the file
      comment - comment to associate with this operation
      Returns:
      a CompletableFuture that completes with unique id that can be used to refer to the file or fail with FileAlreadyExists or InvalidInput or FileNotFound
    • delete

      CompletableFuture<scala.runtime.BoxedUnit> delete(Path path, String comment)
      Deletes the given config file (older versions will still be available)

      Parameters:
      path - the file path relative to the repository root
      comment - comment to associate with this operation
      Returns:
      a CompletableFuture that completes on deletion of file or fails with InvalidInput or FileNotFound
    • getActiveByTime

      CompletableFuture<Optional<ConfigData>> getActiveByTime(Path path, Instant time)
      Gets and returns the content of active version of the file at the given path as it existed on the given instant

      Parameters:
      path - the file path relative to the repository root
      time - the target instant
      Returns:
      a CompletableFuture object that can be used to access the file's data, if found or fails with EmptyResponse or InvalidInput or FileNotFound
    • getActiveVersion

      CompletableFuture<Optional<ConfigId>> getActiveVersion(Path path)
      Returns the version which represents the "active version" of the file at the given path.

      Parameters:
      path - the file path relative to the repository root
      Returns:
      a CompletableFuture that completes with id representing the current active version or fails with InvalidInput or FileNotFound
    • getById

      Gets and returns the file at the given path with the specified revision id.

      Parameters:
      path - the file path relative to the repository root
      id - an id used to specify a specific version to fetch
      Returns:
      a CompletableFuture that can be used to access the file's data, if found or fails with EmptyResponse or InvalidInput or FileNotFound
    • getByTime

      CompletableFuture<Optional<ConfigData>> getByTime(Path path, Instant time)
      Gets the file at the given path as it existed on the given instant. If instant is before the file was created, the initial version is returned. If instant is after the last change, the most recent version is returned.

      Parameters:
      path - the file path relative to the repository root
      time - the target date
      Returns:
      a CompletableFuture that can be used to access the file's data, if found or fails with EmptyResponse or InvalidInput or FileNotFound
    • getLatest

      Gets and returns the latest file at the given path.

      Parameters:
      path - the file path relative to the repository root
      Returns:
      a CompletableFuture that can be used to access the file's data, if found or fails with EmptyResponse or InvalidInput or FileNotFound
    • getMetadata

      Query the metadata of config server

      Returns:
      a CompletableFuture that completes with an object containing config server's metadata or fails with InvalidInput or FileNotFound
    • history

      CompletableFuture<List<ConfigFileRevision>> history(Path path, Instant from, Instant to, int maxResults)
      Returns the history of versions of the file at the given path for a range of period specified by from and to. The size of the list is limited upto maxResults.

      Parameters:
      path - the file path relative to the repository root
      from - the start of the history range
      to - the end of the history range
      maxResults - the maximum number of history results to return (default: unlimited)
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • history

      Returns the history of versions of the file at the given path for a range of period specified by from and to.

      Parameters:
      path - the file path relative to the repository root
      from - the start of the history range
      to - the end of the history range
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • history

      CompletableFuture<List<ConfigFileRevision>> history(Path path, int maxResults)
      Returns the history of versions of the file at the given path. The size of the list is limited upto maxResults.

      Parameters:
      path - the file path relative to the repository root
      maxResults - the maximum number of history results to return
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • history

      Returns the history of versions of the file at given path

      Parameters:
      path - the file path relative to the repository root
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyActive

      CompletableFuture<List<ConfigFileRevision>> historyActive(Path path, Instant from, Instant to, int maxResults)
      Returns the history of active versions of the file at the given path for a range of period specified by from and to. The size of the list is limited upto maxResults.

      Parameters:
      path - the file path relative to the repository root
      from - the start of the history range
      to - the end of the history range
      maxResults - the maximum number of history results to return (default: unlimited)
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyActive

      CompletableFuture<List<ConfigFileRevision>> historyActive(Path path, Instant from, Instant to)
      Returns the history of active versions of the file at the given path for a range of period specified by from and to.

      Parameters:
      path - the file path relative to the repository root
      from - the start of the history range
      to - the end of the history range
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyActive

      CompletableFuture<List<ConfigFileRevision>> historyActive(Path path, int maxResults)
      Returns the history of active versions of the file at the given path. The size of the list is limited upto maxResults.

      Parameters:
      path - the file path relative to the repository root
      maxResults - the maximum number of history results to return
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyActive

      Returns the history of active versions of the file at given path

      Parameters:
      path - the file path relative to the repository root
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyActiveFrom

      CompletableFuture<List<ConfigFileRevision>> historyActiveFrom(Path path, Instant from, int maxResults)
      Returns the history of active versions of the file at the given path for a range of period starting from from till the current instant. The size of the list is limited upto maxResults.

      Parameters:
      path - the file path relative to the repository root
      from - the start of the history range
      maxResults - the maximum number of results to return
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyActiveFrom

      CompletableFuture<List<ConfigFileRevision>> historyActiveFrom(Path path, Instant from)
      Returns the history of active versions of the file at the given path for a range of period starting from from till the current instant.

      Parameters:
      path - the file path relative to the repository root
      from - the start of the history range
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyActiveUpTo

      CompletableFuture<List<ConfigFileRevision>> historyActiveUpTo(Path path, Instant upTo, int maxResults)
      Returns the history of active versions of the file at the given path for a range of period specified by from and to. The size of the list is limited upto maxResults.

      Parameters:
      path - the file path relative to the repository root
      upTo - the end of the history range
      maxResults - the maximum number of history results to return (default: unlimited)
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyActiveUpTo

      CompletableFuture<List<ConfigFileRevision>> historyActiveUpTo(Path path, Instant upTo)
      Returns the history of active versions of the file at the given path for a range of period starting from the beginning and upto upTo.

      Parameters:
      path - the file path relative to the repository root
      upTo - the end of the history range
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyFrom

      CompletableFuture<List<ConfigFileRevision>> historyFrom(Path path, Instant from, int maxResults)
      Returns the history of versions of the file at the given path for a range of period starting from from till the current instant. The size of the list is limited upto maxResults.

      Parameters:
      path - the file path relative to the repository root
      from - the start of the history range
      maxResults - the maximum number of results to return
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyFrom

      Returns the history of versions of the file at the given path for a range of period starting from from till the current instant.

      Parameters:
      path - the file path relative to the repository root
      from - the start of the history range
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyUpTo

      CompletableFuture<List<ConfigFileRevision>> historyUpTo(Path path, Instant upTo, int maxResults)
      Returns the history of versions of the file at the given path for a range of period specified by from and to. The size of the list is limited upto maxResults.

      Parameters:
      path - the file path relative to the repository root
      upTo - the end of the history range
      maxResults - the maximum number of history results to return (default: unlimited)
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • historyUpTo

      Returns the history of versions of the file at the given path for a range of period starting from the beginning and upto upTo.

      Parameters:
      path - the file path relative to the repository root
      upTo - the end of the history range
      Returns:
      a CompletableFuture that completes with a list containing one ConfigFileHistory object for each version of path or fails with InvalidInput or FileNotFound
    • list

      CompletableFuture<List<ConfigFileInfo>> list(FileType fileType, String pattern)
      Returns a list containing all of the known config files of given type(Annex or Normal) and whose name matches the provided pattern

      Parameters:
      fileType - the file type(Annex or Normal)
      pattern - pattern to match against the file name
      Returns:
      a CompletableFuture that completes ith a list containing one ConfigFileInfo object for each known config file or fails with InvalidInput or FileNotFound
    • list

      Returns a list containing all of the known config files of given type(Annex or Normal)

      Parameters:
      fileType - the file type(Annex or Normal)
      Returns:
      a CompletableFuture that completes ith a list containing one ConfigFileInfo object for each known config file or fails with InvalidInput or FileNotFound
    • list

      Returns a list containing all of the known config files whose name matches the provided pattern

      Parameters:
      pattern - pattern to match against the file name
      Returns:
      a CompletableFuture that completes ith a list containing one ConfigFileInfo object for each known config file or fails with InvalidInput or FileNotFound
    • list

      Returns a list containing all of the known config files

      Returns:
      a CompletableFuture that completes ith a list containing one ConfigFileInfo object for each known config file or fails with InvalidInput or FileNotFound
    • resetActiveVersion

      CompletableFuture<scala.runtime.BoxedUnit> resetActiveVersion(Path path, String comment)
      Resets the "active version" of the file at the given path to the latest version.

      Parameters:
      path - the file path relative to the repository root
      comment - comment to associate with this operation
      Returns:
      a CompletableFuture that completes when active version is reset or fails with InvalidInput or FileNotFound
    • setActiveVersion

      CompletableFuture<scala.runtime.BoxedUnit> setActiveVersion(Path path, ConfigId id, String comment)
      Sets the "active version" to be the version provided for the file at the given path. If this method is not called, the active version will always be the version with which the file was created After calling this method, the version with the given Id will be the active version.

      Parameters:
      path - the file path relative to the repository root
      id - an id used to specify a specific version (by default the id of the version with which the file was created i.e. 1)
      comment - comment to associate with this operation
      Returns:
      a CompletableFuture that completes when active version is set or fails with InvalidInput or FileNotFound
    • update

      CompletableFuture<ConfigId> update(Path path, ConfigData configData, String comment)
      Updates the config file at the given path with given data and comment. An FileNotFoundException is thrown if the file does not exists.

      Parameters:
      path - the file path relative to the repository root
      configData - contents of the file
      comment - comment to associate with this file
      Returns:
      a CompletableFuture that completes with unique id that can be used to refer to the file or fails with InvalidInput or FileNotFound