Interface CentralDogma
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractCentralDogma
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes underlying resources that may be used when making requests to the server such as health checking or dns queries.createProject
(String projectName) Creates a project.createRepository
(String projectName, String repositoryName) Creates a repository.default <T> Watcher
<T> fileWatcher
(String projectName, String repositoryName, Query<T> query) Deprecated.<T,
U> Watcher <U> fileWatcher
(String projectName, String repositoryName, Query<T> query, Function<? super T, ? extends U> function) Deprecated.<T,
U> Watcher <U> fileWatcher
(String projectName, String repositoryName, Query<T> query, Function<? super T, ? extends U> function, Executor executor) Deprecated.Returns a newCentralDogmaRepository
that is used to send a request to the specifiedprojectName
andrepositoryName
.CompletableFuture
<List<Change<?>>> getDiff
(String projectName, String repositoryName, Revision from, Revision to, PathPattern pathPattern) Retrieves the diffs of the files matched by the givenPathPattern
between twoRevision
s.<T> CompletableFuture
<Change<T>> Queries a file at two different revisions and returns the diff of the twoQuery
results.default CompletableFuture
<Change<?>> Deprecated.default CompletableFuture
<List<Change<?>>> Deprecated.<T> CompletableFuture
<Entry<T>> Queries a file at the specified revision and path with the specifiedQuery
.default CompletableFuture
<Entry<?>> Deprecated.CompletableFuture
<Map<String, Entry<?>>> getFiles
(String projectName, String repositoryName, Revision revision, PathPattern pathPattern) Retrieves the files matched by thePathPattern
.default CompletableFuture
<Map<String, Entry<?>>> Deprecated.default CompletableFuture
<List<Commit>> getHistory
(String projectName, String repositoryName, Revision from, Revision to) Deprecated.default CompletableFuture
<List<Commit>> getHistory
(String projectName, String repositoryName, Revision from, Revision to, PathPattern pathPattern) Deprecated.getHistory
(String projectName, String repositoryName, Revision from, Revision to, PathPattern pathPattern, int maxCommits) Retrieves the history of the files matched by the givenPathPattern
between twoRevision
s.default CompletableFuture
<List<Commit>> getHistory
(String projectName, String repositoryName, Revision from, Revision to, String pathPattern) Deprecated.default CompletableFuture
<List<Change<?>>> getPreviewDiffs
(String projectName, String repositoryName, Revision baseRevision, Change<?>... changes) Deprecated.CompletableFuture
<List<Change<?>>> getPreviewDiffs
(String projectName, String repositoryName, Revision baseRevision, Iterable<? extends Change<?>> changes) Retrieves the preview diffs, which are hypothetical diffs generated if the specifiedChange
s were successfully pushed to the specified repository.listFiles
(String projectName, String repositoryName, Revision revision, PathPattern pathPattern) Retrieves the list of the files matched by the givenPathPattern
.default CompletableFuture
<Map<String, EntryType>> Deprecated.Retrieves the list of the projects.Retrieves the list of the removed projects, which can be unremoved.listRemovedRepositories
(String projectName) Retrieves the list of the removed repositories, which can be unremoved.listRepositories
(String projectName) Retrieves the list of the repositories.<T> CompletableFuture
<MergedEntry<T>> mergeFiles
(String projectName, String repositoryName, Revision revision, MergeQuery<T> mergeQuery) Retrieves the merged entry of the specifiedMergeQuery
at the specified revision.default CompletableFuture
<MergedEntry<?>> mergeFiles
(String projectName, String repositoryName, Revision revision, MergeSource... mergeSources) Deprecated.default CompletableFuture
<MergedEntry<?>> mergeFiles
(String projectName, String repositoryName, Revision revision, Iterable<MergeSource> mergeSources) Deprecated.normalizeRevision
(String projectName, String repositoryName, Revision revision) Converts the relative revision number to the absolute revision number. e.g.purgeProject
(String projectName) Purges a project that was removed before.purgeRepository
(String projectName, String repositoryName) Purges a repository that was removed before.default CompletableFuture
<PushResult> push
(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, Change<?>... changes) Deprecated.default CompletableFuture
<PushResult> push
(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, Iterable<? extends Change<?>> changes) Deprecated.default CompletableFuture
<PushResult> push
(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, String detail, Markup markup, Change<?>... changes) Deprecated.push
(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, String detail, Markup markup, Iterable<? extends Change<?>> changes) Deprecated.default CompletableFuture
<PushResult> push
(String projectName, String repositoryName, Revision baseRevision, String summary, Change<?>... changes) Deprecated.default CompletableFuture
<PushResult> push
(String projectName, String repositoryName, Revision baseRevision, String summary, Iterable<? extends Change<?>> changes) Deprecated.default CompletableFuture
<PushResult> push
(String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Change<?>... changes) Deprecated.push
(String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Iterable<? extends Change<?>> changes) Pushes the specifiedChange
s to the repository.removeProject
(String projectName) Removes a project.removeRepository
(String projectName, String repositoryName) Removes a repository.repositoryWatcher
(String projectName, String repositoryName, String pathPattern) Deprecated.<T> Watcher
<T> repositoryWatcher
(String projectName, String repositoryName, String pathPattern, Function<Revision, ? extends T> function) Deprecated.<T> Watcher
<T> repositoryWatcher
(String projectName, String repositoryName, String pathPattern, Function<Revision, ? extends T> function, Executor executor) Deprecated.unremoveProject
(String projectName) Unremoves a project.unremoveRepository
(String projectName, String repositoryName) Unremoves a repository.default <T> CompletableFuture
<Entry<T>> Deprecated.default <T> CompletableFuture
<Entry<T>> watchFile
(String projectName, String repositoryName, Revision lastKnownRevision, Query<T> query, long timeoutMillis) Deprecated.<T> CompletableFuture
<Entry<T>> watchFile
(String projectName, String repositoryName, Revision lastKnownRevision, Query<T> query, long timeoutMillis, boolean errorOnEntryNotFound) Waits for the file matched by the specifiedQuery
to be changed since the specifiedlastKnownRevision
.watchRepository
(String projectName, String repositoryName, Revision lastKnownRevision, PathPattern pathPattern, long timeoutMillis, boolean errorOnEntryNotFound) Waits for the files matched by the specifiedPathPattern
to be changed since the specifiedlastKnownRevision
.default CompletableFuture
<Revision> watchRepository
(String projectName, String repositoryName, Revision lastKnownRevision, String pathPattern) Deprecated.default CompletableFuture
<Revision> watchRepository
(String projectName, String repositoryName, Revision lastKnownRevision, String pathPattern, long timeoutMillis) Deprecated.Returns aCompletableFuture
which is completed when the initial endpoints of this client are ready.
-
Method Details
-
forRepo
Returns a newCentralDogmaRepository
that is used to send a request to the specifiedprojectName
andrepositoryName
. -
createProject
Creates a project. -
removeProject
Removes a project. A removed project can be unremoved usingunremoveProject(String)
. -
purgeProject
Purges a project that was removed before. -
unremoveProject
Unremoves a project. -
listProjects
CompletableFuture<Set<String>> listProjects()Retrieves the list of the projects.- Returns:
- a
Set
that contains the names of the projects
-
listRemovedProjects
CompletableFuture<Set<String>> listRemovedProjects()Retrieves the list of the removed projects, which can be unremoved.- Returns:
- a
Set
that contains the names of the removed projects
-
createRepository
CompletableFuture<CentralDogmaRepository> createRepository(String projectName, String repositoryName) Creates a repository. -
removeRepository
Removes a repository. A removed repository can be unremoved usingunremoveRepository(String, String)
. -
purgeRepository
Purges a repository that was removed before. -
unremoveRepository
CompletableFuture<CentralDogmaRepository> unremoveRepository(String projectName, String repositoryName) Unremoves a repository. -
listRepositories
Retrieves the list of the repositories.- Returns:
- a
Map
of repository name andRepositoryInfo
pairs
-
listRemovedRepositories
Retrieves the list of the removed repositories, which can be unremoved.- Returns:
- a
Set
that contains the names of the removed repositories
-
normalizeRevision
CompletableFuture<Revision> normalizeRevision(String projectName, String repositoryName, Revision revision) Converts the relative revision number to the absolute revision number. e.g.-1 -> 3
- Returns:
- the absolute
Revision
-
listFiles
@Deprecated default CompletableFuture<Map<String,EntryType>> listFiles(String projectName, String repositoryName, Revision revision, String pathPattern) Deprecated.Retrieves the list of the files matched by the given path pattern.- Returns:
- a
Map
of file path and type pairs
-
listFiles
CompletableFuture<Map<String,EntryType>> listFiles(String projectName, String repositoryName, Revision revision, PathPattern pathPattern) Retrieves the list of the files matched by the givenPathPattern
. This method is equivalent to calling:CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .files(pathPattern) .list(revision);
- Returns:
- a
Map
of file path and type pairs
-
getFile
@Deprecated default CompletableFuture<Entry<?>> getFile(String projectName, String repositoryName, Revision revision, String path) Deprecated.Retrieves the file at the specified revision and path. This method is a shortcut ofgetFile(projectName, repositoryName, revision, Query.identity(path)
. Consider usinggetFile(String, String, Revision, Query)
withQuery.ofText(String)
orQuery.ofJson(String)
if you already know the file type.- Returns:
- the
Entry
at the givenpath
-
getFile
<T> CompletableFuture<Entry<T>> getFile(String projectName, String repositoryName, Revision revision, Query<T> query) Queries a file at the specified revision and path with the specifiedQuery
. This method is equivalent to calling:CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .file(query) .get(revision);
-
getFiles
@Deprecated default CompletableFuture<Map<String,Entry<?>>> getFiles(String projectName, String repositoryName, Revision revision, String pathPattern) Deprecated.Retrieves the files matched by the path pattern. -
getFiles
CompletableFuture<Map<String,Entry<?>>> getFiles(String projectName, String repositoryName, Revision revision, PathPattern pathPattern) Retrieves the files matched by thePathPattern
. This method is equivalent to calling:CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .file(pathPattern) .get(revision);
-
mergeFiles
@Deprecated default CompletableFuture<MergedEntry<?>> mergeFiles(String projectName, String repositoryName, Revision revision, MergeSource... mergeSources) Deprecated.Retrieves the merged entry of the specifiedMergeSource
s at the specified revision. Only JSON entry merge is currently supported. The JSON files are merged sequentially as specified in themergeSources
.Note that only
ObjectNode
is recursively merged traversing the children. Other node types are simply replaced.- Returns:
- the
MergedEntry
which contains the result of the merge
-
mergeFiles
@Deprecated default CompletableFuture<MergedEntry<?>> mergeFiles(String projectName, String repositoryName, Revision revision, Iterable<MergeSource> mergeSources) Deprecated.Retrieves the merged entry of the specifiedMergeSource
s at the specified revision. Only JSON entry merge is currently supported. The JSON files are merged sequentially as specified in themergeSources
.Note that only
ObjectNode
is recursively merged traversing the children. Other node types are simply replaced.- Returns:
- the
MergedEntry
which contains the result of the merge
-
mergeFiles
<T> CompletableFuture<MergedEntry<T>> mergeFiles(String projectName, String repositoryName, Revision revision, MergeQuery<T> mergeQuery) Retrieves the merged entry of the specifiedMergeQuery
at the specified revision. Only JSON entry merge is currently supported. The JSON files are merged sequentially as specified in theMergeQuery
. This method is equivalent to calling:CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .merge(mergeQuery) .get(revision);
Note that only
ObjectNode
is recursively merged traversing the children. Other node types are simply replaced.- Returns:
- the
MergedEntry
which contains the result of the merge
-
getHistory
@Deprecated default CompletableFuture<List<Commit>> getHistory(String projectName, String repositoryName, Revision from, Revision to) Deprecated.Retrieves the history of the repository between twoRevision
s. This method is a shortcut ofgetHistory(projectName, repositoryName, from, to, "/**")
. Note that this method does not retrieve the diffs but only metadata about the changes. UsegetDiff(String, String, Revision, Revision, Query)
orgetDiff(String, String, Revision, Revision, PathPattern)
to retrieve the diffs. -
getHistory
@Deprecated default CompletableFuture<List<Commit>> getHistory(String projectName, String repositoryName, Revision from, Revision to, String pathPattern) Deprecated.Retrieves the history of the files matched by the given path pattern between twoRevision
s.Note that this method does not retrieve the diffs but only metadata about the changes. Use
getDiff(String, String, Revision, Revision, Query)
orgetDiff(String, String, Revision, Revision, PathPattern)
to retrieve the diffs.- Returns:
- a
List
that contains theCommit
s of the files matched by the givenPathPattern
in the specified repository
-
getHistory
@Deprecated default CompletableFuture<List<Commit>> getHistory(String projectName, String repositoryName, Revision from, Revision to, PathPattern pathPattern) Deprecated.Retrieves the history of the files matched by the givenPathPattern
between twoRevision
s.Note that this method does not retrieve the diffs but only metadata about the changes. Use
DiffRequest
to retrieve the diffs.- Returns:
- a
List
that contains theCommit
s of the files matched by the givenPathPattern
in the specified repository
-
getHistory
CompletableFuture<List<Commit>> getHistory(String projectName, String repositoryName, Revision from, Revision to, PathPattern pathPattern, int maxCommits) Retrieves the history of the files matched by the givenPathPattern
between twoRevision
s. This method is equivalent to calling:CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .history(pathPattern) .maxCommits(maxCommits) .get(from, to);
Note that this method does not retrieve the diffs but only metadata about the changes. Use
DiffRequest
to retrieve the diffs.- Returns:
- a
List
that contains theCommit
s of the files matched by the givenPathPattern
in the specified repository
-
getDiff
@Deprecated default CompletableFuture<Change<?>> getDiff(String projectName, String repositoryName, Revision from, Revision to, String path) Deprecated.Returns the diff of a file between twoRevision
s. This method is a shortcut ofgetDiff(projectName, repositoryName, from, to, Query.identity(path))
. Consider usinggetDiff(String, String, Revision, Revision, Query)
withQuery.ofText(String)
orQuery.ofJson(String)
if you already know the file type.- Returns:
- the
Change
that contains the diff of the givenpath
between the specified two revisions
-
getDiff
<T> CompletableFuture<Change<T>> getDiff(String projectName, String repositoryName, Revision from, Revision to, Query<T> query) Queries a file at two different revisions and returns the diff of the twoQuery
results. This method is equivalent to calling:CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .diff(query) .get(from, to);
- Returns:
- the
Change
that contains the diff of the file matched by the givenquery
between the specified two revisions
-
getDiff
CompletableFuture<List<Change<?>>> getDiff(String projectName, String repositoryName, Revision from, Revision to, PathPattern pathPattern) Retrieves the diffs of the files matched by the givenPathPattern
between twoRevision
s.CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .diff(pathPattern) .get(from, to);
- Returns:
- a
List
of theChange
s that contain the diffs between the files matched by the givenPathPattern
between two revisions.
-
getDiffs
@Deprecated default CompletableFuture<List<Change<?>>> getDiffs(String projectName, String repositoryName, Revision from, Revision to, String pathPattern) Deprecated.Retrieves the diffs of the files matched by the given path pattern between twoRevision
s.- Returns:
- a
List
of theChange
s that contain the diffs between the files matched by the givenPathPattern
between two revisions.
-
getPreviewDiffs
@Deprecated default CompletableFuture<List<Change<?>>> getPreviewDiffs(String projectName, String repositoryName, Revision baseRevision, Change<?>... changes) Deprecated.Retrieves the preview diffs, which are hypothetical diffs generated if the specifiedChange
s were successfully pushed to the specified repository. This operation is useful for pre-checking if the specifiedChange
s will be applied as expected without any conflicts.- Returns:
- the diffs which would be committed if the specified
Change
s were pushed successfully
-
getPreviewDiffs
CompletableFuture<List<Change<?>>> getPreviewDiffs(String projectName, String repositoryName, Revision baseRevision, Iterable<? extends Change<?>> changes) Retrieves the preview diffs, which are hypothetical diffs generated if the specifiedChange
s were successfully pushed to the specified repository. This operation is useful for pre-checking if the specifiedChange
s will be applied as expected without any conflicts. This method is equivalent to calling:CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .diff(changes) .get(baseRevision);
- Returns:
- the diffs which would be committed if the specified
Change
s were pushed successfully
-
push
@Deprecated default CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, String summary, Change<?>... changes) Deprecated.Pushes the specifiedChange
s to the repository.- Returns:
- the
PushResult
which tells theRevision
and timestamp of the newCommit
-
push
@Deprecated default CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, String summary, Iterable<? extends Change<?>> changes) Deprecated.Pushes the specifiedChange
s to the repository.- Returns:
- the
PushResult
which tells theRevision
and timestamp of the newCommit
-
push
@Deprecated default CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Change<?>... changes) Deprecated.Pushes the specifiedChange
s to the repository.- Returns:
- the
PushResult
which tells theRevision
and timestamp of the newCommit
-
push
CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Iterable<? extends Change<?>> changes) Pushes the specifiedChange
s to the repository. This method is equivalent to calling:CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .commit(summary, changes) .detail(detail, markup) .push(baseRevision);
- Returns:
- the
PushResult
which tells theRevision
and timestamp of the newCommit
-
push
@Deprecated default CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, Change<?>... changes) Deprecated.Pushes the specifiedChange
s to the repository.- Returns:
- the
PushResult
which tells theRevision
and timestamp of the newCommit
-
push
@Deprecated default CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, Iterable<? extends Change<?>> changes) Deprecated.Pushes the specifiedChange
s to the repository.- Returns:
- the
PushResult
which tells theRevision
and timestamp of the newCommit
-
push
@Deprecated default CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, String detail, Markup markup, Change<?>... changes) Deprecated.Pushes the specifiedChange
s to the repository.- Returns:
- the
PushResult
which tells theRevision
and timestamp of the newCommit
-
push
@Deprecated CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, String detail, Markup markup, Iterable<? extends Change<?>> changes) Deprecated.Pushes the specifiedChange
s to the repository.- Returns:
- the
PushResult
which tells theRevision
and timestamp of the newCommit
-
watchRepository
@Deprecated default CompletableFuture<Revision> watchRepository(String projectName, String repositoryName, Revision lastKnownRevision, String pathPattern) Deprecated.Waits for the files matched by the specifiedpathPattern
to be changed since the specifiedlastKnownRevision
. If no changes were made within 1 minute, the returnedCompletableFuture
will be completed withnull
.- Returns:
- the latest known
Revision
which contains the changes for the matched files.null
if the files were not changed for 1 minute since the invocation of this method. Even before the timeout, the watch may return null earlier due to issues such as server restart.
-
watchRepository
@Deprecated default CompletableFuture<Revision> watchRepository(String projectName, String repositoryName, Revision lastKnownRevision, String pathPattern, long timeoutMillis) Deprecated.Waits for the files matched by the specifiedpathPattern
to be changed since the specifiedlastKnownRevision
. If no changes were made within the specifiedtimeoutMillis
, the returnedCompletableFuture
will be completed withnull
. It is recommended to specify the largesttimeoutMillis
allowed by the server.- Returns:
- the latest known
Revision
which contains the changes for the matched files.null
if the files were not changed fortimeoutMillis
milliseconds since the invocation of this method. Even before the timeout, the watch may return null earlier due to issues such as server restart.
-
watchRepository
CompletableFuture<Revision> watchRepository(String projectName, String repositoryName, Revision lastKnownRevision, PathPattern pathPattern, long timeoutMillis, boolean errorOnEntryNotFound) Waits for the files matched by the specifiedPathPattern
to be changed since the specifiedlastKnownRevision
. If no changes were made within the specifiedtimeoutMillis
, the returnedCompletableFuture
will be completed withnull
. It is recommended to specify the largesttimeoutMillis
allowed by the server. This method is equivalent to calling:CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .watch(pathPattern) .timeoutMillis(timeoutMillis) .errorOnEntryNotFound(errorOnEntryNotFound) .start(lastKnownRevision);
- Returns:
- the latest known
Revision
which contains the changes for the matched files.null
if the files were not changed fortimeoutMillis
milliseconds since the invocation of this method. Even before the timeout, the watch may return null earlier due to issues such as server restart.EntryNotFoundException
is raised if the target does not exist.
-
watchFile
@Deprecated default <T> CompletableFuture<Entry<T>> watchFile(String projectName, String repositoryName, Revision lastKnownRevision, Query<T> query) Deprecated.Waits for the file matched by the specifiedQuery
to be changed since the specifiedlastKnownRevision
. If no changes were made within 1 minute, the returnedCompletableFuture
will be completed withnull
. -
watchFile
@Deprecated default <T> CompletableFuture<Entry<T>> watchFile(String projectName, String repositoryName, Revision lastKnownRevision, Query<T> query, long timeoutMillis) Deprecated.Waits for the file matched by the specifiedQuery
to be changed since the specifiedlastKnownRevision
. If no changes were made within the specifiedtimeoutMillis
, the returnedCompletableFuture
will be completed withnull
. It is recommended to specify the largesttimeoutMillis
allowed by the server. -
watchFile
<T> CompletableFuture<Entry<T>> watchFile(String projectName, String repositoryName, Revision lastKnownRevision, Query<T> query, long timeoutMillis, boolean errorOnEntryNotFound) Waits for the file matched by the specifiedQuery
to be changed since the specifiedlastKnownRevision
. If the file does not exist anderrorOnEntryNotFound
istrue
, the returnedCompletableFuture
will be completed exceptionally withEntryNotFoundException
. If no changes were made within the specifiedtimeoutMillis
, the returnedCompletableFuture
will be completed withnull
. It is recommended to specify the largesttimeoutMillis
allowed by the server. This method is equivalent to calling:CentralDogma dogma = ... dogma.forRepo(projectName, repositoryName) .watch(query) .timeoutMillis(timeoutMillis) .errorOnEntryNotFound(errorOnEntryNotFound) .start(lastKnownRevision);
- Returns:
- the
Entry
which contains the latest knownQuery
result.null
if the file was not changed fortimeoutMillis
milliseconds since the invocation of this method. Even before the timeout, the watch may return null earlier due to issues such as server restart.EntryNotFoundException
is raised if the target does not exist.
-
fileWatcher
@Deprecated default <T> Watcher<T> fileWatcher(String projectName, String repositoryName, Query<T> query) Deprecated. -
fileWatcher
@Deprecated <T,U> Watcher<U> fileWatcher(String projectName, String repositoryName, Query<T> query, Function<? super T, ? extends U> function) Deprecated.Returns aWatcher
which notifies its listeners after applying the specifiedFunction
when the result of the givenQuery
becomes available or changes. e.g:Watcher<MyType> watcher = client.fileWatcher( "foo", "bar", Query.ofJson("/baz.json"), content -> new ObjectMapper().treeToValue(content, MyType.class)); watcher.watch((revision, myValue) -> { assert myValue instanceof MyType; ... });
Note that
Function
by default is executed by a blocking task executor so that you can safely call a blocking operation. -
fileWatcher
@Deprecated <T,U> Watcher<U> fileWatcher(String projectName, String repositoryName, Query<T> query, Function<? super T, ? extends U> function, Executor executor) Deprecated.Returns aWatcher
which notifies its listeners after applying the specifiedFunction
when the result of the givenQuery
becomes available or changes. e.g:Watcher<MyType> watcher = client.fileWatcher( "foo", "bar", Query.ofJson("/baz.json"), content -> new ObjectMapper().treeToValue(content, MyType.class), executor); watcher.watch((revision, myValue) -> { assert myValue instanceof MyType; ... });
-
repositoryWatcher
@Deprecated default Watcher<Revision> repositoryWatcher(String projectName, String repositoryName, String pathPattern) Deprecated.Returns aWatcher
which notifies its listeners when the specified repository has a new commit that contains the changes for the files matched by the givenpathPattern
. e.g:Watcher<Revision> watcher = client.repositoryWatcher("foo", "bar", "/*.json"); watcher.watch(revision -> { ... });
-
repositoryWatcher
@Deprecated <T> Watcher<T> repositoryWatcher(String projectName, String repositoryName, String pathPattern, Function<Revision, ? extends T> function) Deprecated.Returns aWatcher
which notifies its listeners when the specified repository has a new commit that contains the changes for the files matched by the givenpathPattern
. e.g:Watcher<Map<String, Entry<?>> watcher = client.repositoryWatcher( "foo", "bar", "/*.json", revision -> client.getFiles("foo", "bar", revision, "/*.json").join()); watcher.watch((revision, contents) -> { ... });
Function
by default is executed by a blocking task executor so that you can safely call a blocking operation.Note that you may get
RevisionNotFoundException
during thegetFiles()
call and may have to retry in the above example due to a known issue. -
repositoryWatcher
@Deprecated <T> Watcher<T> repositoryWatcher(String projectName, String repositoryName, String pathPattern, Function<Revision, ? extends T> function, Executor executor) Deprecated.Returns aWatcher
which notifies its listeners when the specified repository has a new commit that contains the changes for the files matched by the givenpathPattern
. e.g:
Note that you may getWatcher<Map<String, Entry<?>> watcher = client.repositoryWatcher( "foo", "bar", "/*.json", revision -> client.getFiles("foo", "bar", revision, "/*.json").join(), executor); watcher.watch((revision, contents) -> { ... });
RevisionNotFoundException
during thegetFiles()
call and may have to retry in the above example due to a known issue. -
whenEndpointReady
CompletableFuture<Void> whenEndpointReady()Returns aCompletableFuture
which is completed when the initial endpoints of this client are ready. It is recommended to wait for the initial endpoints in order to send the first request without additional delay. -
close
Closes underlying resources that may be used when making requests to the server such as health checking or dns queries.- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
WatcherRequest.start()
viaCentralDogmaRepository.watcher(Query)
.