Package csw.config.api.javadsl
Interface IConfigService
- All Superinterfaces:
IConfigClientService
Defines an interface to be used by admin users for storing and retrieving configuration information
-
Method Summary
Modifier and TypeMethodDescriptioncsw.config.api.scaladsl.ConfigService
asScala()
Returns the Scala API for this instance of config servicecreate
(Path path, ConfigData configData, boolean annex, String comment) Creates a file at the given path with given data and comment.create
(Path path, ConfigData configData, String comment) Creates a file at the given path with given data and comment.CompletableFuture<scala.runtime.BoxedUnit>
Deletes the given config file (older versions will still be available)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 instantgetActiveVersion
(Path path) Returns the version which represents the "active version" of the file at the given path.Gets and returns the file at the given path with the specified revision id.Gets the file at the given path as it existed on the given instant.Gets and returns the latest file at the given path.Query the metadata of config serverReturns the history of versions of the file at given pathReturns the history of versions of the file at the given path.Returns the history of versions of the file at the given path for a range of period specified byfrom
andto
.Returns the history of versions of the file at the given path for a range of period specified byfrom
andto
.historyActive
(Path path) Returns the history of active versions of the file at given pathhistoryActive
(Path path, int maxResults) Returns the history of active versions of the file at the given path.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 byfrom
andto
.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 byfrom
andto
.historyActiveFrom
(Path path, Instant from) Returns the history of active versions of the file at the given path for a range of period starting fromfrom
till the current instant.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 fromfrom
till the current instant.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 uptoupTo
.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 byfrom
andto
.historyFrom
(Path path, Instant from) Returns the history of versions of the file at the given path for a range of period starting fromfrom
till the current instant.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 fromfrom
till the current instant.historyUpTo
(Path path, Instant upTo) Returns the history of versions of the file at the given path for a range of period starting from the beginning and uptoupTo
.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 byfrom
andto
.list()
Returns a list containing all of the known config filesReturns a list containing all of the known config files of given type(Annex or Normal)Returns a list containing all of the known config files of given type(Annex or Normal) and whose name matches the provided patternReturns a list containing all of the known config files whose name matches the provided patternCompletableFuture<scala.runtime.BoxedUnit>
resetActiveVersion
(Path path, String comment) Resets the "active version" of the file at the given path to the latest version.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.update
(Path path, ConfigData configData, String comment) Updates the config file at the given path with given data and comment.Methods inherited from interface csw.config.api.javadsl.IConfigClientService
exists, exists, getActive
-
Method Details
-
asScala
csw.config.api.scaladsl.ConfigService asScala()Returns the Scala API for this instance of config service- Specified by:
asScala
in interfaceIConfigClientService
- Returns:
- (undocumented)
-
create
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 rootconfigData
- contents of the fileannex
- 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
orInvalidInput
orFileNotFound
-
create
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 rootconfigData
- contents of the filecomment
- 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
orInvalidInput
orFileNotFound
-
delete
Deletes the given config file (older versions will still be available)- Parameters:
path
- the file path relative to the repository rootcomment
- comment to associate with this operation- Returns:
- a CompletableFuture that completes on deletion of file or fails with
InvalidInput
orFileNotFound
-
getActiveByTime
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 roottime
- the target instant- Returns:
- a CompletableFuture object that can be used to access the file's data, if found or fails with
EmptyResponse
orInvalidInput
orFileNotFound
-
getActiveVersion
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
orFileNotFound
-
getById
Gets and returns the file at the given path with the specified revision id.- Parameters:
path
- the file path relative to the repository rootid
- 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
orInvalidInput
orFileNotFound
-
getByTime
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 roottime
- the target date- Returns:
- a CompletableFuture that can be used to access the file's data, if found or fails with
EmptyResponse
orInvalidInput
orFileNotFound
-
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
orInvalidInput
orFileNotFound
-
getMetadata
CompletableFuture<ConfigMetadata> getMetadata()Query the metadata of config server- Returns:
- a CompletableFuture that completes with an object containing config server's metadata or fails with
InvalidInput
orFileNotFound
-
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 byfrom
andto
. The size of the list is limited uptomaxResults
.- Parameters:
path
- the file path relative to the repository rootfrom
- the start of the history rangeto
- the end of the history rangemaxResults
- 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
orFileNotFound
-
history
Returns the history of versions of the file at the given path for a range of period specified byfrom
andto
.- Parameters:
path
- the file path relative to the repository rootfrom
- the start of the history rangeto
- 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
orFileNotFound
-
history
Returns the history of versions of the file at the given path. The size of the list is limited uptomaxResults
.- Parameters:
path
- the file path relative to the repository rootmaxResults
- 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
orFileNotFound
-
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
orFileNotFound
-
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 byfrom
andto
. The size of the list is limited uptomaxResults
.- Parameters:
path
- the file path relative to the repository rootfrom
- the start of the history rangeto
- the end of the history rangemaxResults
- 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
orFileNotFound
-
historyActive
Returns the history of active versions of the file at the given path for a range of period specified byfrom
andto
.- Parameters:
path
- the file path relative to the repository rootfrom
- the start of the history rangeto
- 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
orFileNotFound
-
historyActive
Returns the history of active versions of the file at the given path. The size of the list is limited uptomaxResults
.- Parameters:
path
- the file path relative to the repository rootmaxResults
- 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
orFileNotFound
-
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
orFileNotFound
-
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 fromfrom
till the current instant. The size of the list is limited uptomaxResults
.- Parameters:
path
- the file path relative to the repository rootfrom
- the start of the history rangemaxResults
- 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
orFileNotFound
-
historyActiveFrom
Returns the history of active versions of the file at the given path for a range of period starting fromfrom
till the current instant.- Parameters:
path
- the file path relative to the repository rootfrom
- 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
orFileNotFound
-
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 byfrom
andto
. The size of the list is limited uptomaxResults
.- Parameters:
path
- the file path relative to the repository rootupTo
- the end of the history rangemaxResults
- 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
orFileNotFound
-
historyActiveUpTo
Returns the history of active versions of the file at the given path for a range of period starting from the beginning and uptoupTo
.- Parameters:
path
- the file path relative to the repository rootupTo
- 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
orFileNotFound
-
historyFrom
Returns the history of versions of the file at the given path for a range of period starting fromfrom
till the current instant. The size of the list is limited uptomaxResults
.- Parameters:
path
- the file path relative to the repository rootfrom
- the start of the history rangemaxResults
- 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
orFileNotFound
-
historyFrom
Returns the history of versions of the file at the given path for a range of period starting fromfrom
till the current instant.- Parameters:
path
- the file path relative to the repository rootfrom
- 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
orFileNotFound
-
historyUpTo
Returns the history of versions of the file at the given path for a range of period specified byfrom
andto
. The size of the list is limited uptomaxResults
.- Parameters:
path
- the file path relative to the repository rootupTo
- the end of the history rangemaxResults
- 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
orFileNotFound
-
historyUpTo
Returns the history of versions of the file at the given path for a range of period starting from the beginning and uptoupTo
.- Parameters:
path
- the file path relative to the repository rootupTo
- 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
orFileNotFound
-
list
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
orFileNotFound
-
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
orFileNotFound
-
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
orFileNotFound
-
list
CompletableFuture<List<ConfigFileInfo>> 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
orFileNotFound
-
resetActiveVersion
Resets the "active version" of the file at the given path to the latest version.- Parameters:
path
- the file path relative to the repository rootcomment
- comment to associate with this operation- Returns:
- a CompletableFuture that completes when active version is reset or fails with
InvalidInput
orFileNotFound
-
setActiveVersion
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 rootid
- 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
orFileNotFound
-
update
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 rootconfigData
- contents of the filecomment
- 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
orFileNotFound
-