public interface CommitIndex
Modifier and Type | Method and Description |
---|---|
void |
addCommit(Commit commit,
Repository repository)
Associates the provided
Commit with the specified Repository . |
void |
addProperty(String commitId,
String key,
String value)
Stores a string commit property.
|
Page<IndexedCommit> |
findByProperty(String propertyKey,
String propertyValue,
boolean caseSensitive,
PageRequest pageRequest)
Retrieves all
indexed commits that have a given property with a specified value. |
IndexedCommit |
getCommit(String commitId)
Retrieves the specified commit if it's been indexed.
|
Map<String,PropertyMap> |
getProperties(Iterable<String> commitIds,
Iterable<String> propertyKeys)
Retrieves a properties for each of the specified commits, matching the provided
propertyKeys . |
PropertyMap |
getProperties(String commitId,
Iterable<String> propertyKeys)
Retrieves a property map containing all properties stored against the given commit, matching
propertyKeys . |
boolean |
isIndexed(String commitId,
Repository repository) |
void |
removeCommit(String commitId,
Repository repository)
Removes the association between the specified commit and repository in the index.
|
void |
removeProperty(String commitId,
String key,
String value)
Removes a commit property.
|
Page<IndexedCommit> |
search(IndexSearchRequest searchRequest,
PageRequest pageRequest)
Searches the index for any matching commits.
|
Page<MinimalRepositoryCommit> |
searchRepositoryCommits(IndexSearchRequest indexSearchRequest,
PageRequest pageRequest)
Search the index for any
commits matching the provided search request. |
void addCommit(@Nonnull Commit commit, @Nonnull Repository repository)
Commit
with the specified Repository
.commit
- the commitrepository
- the repositoryvoid addProperty(@Nonnull String commitId, @Nonnull String key, @Nonnull String value)
commitId
- the commit IDkey
- the property keyvalue
- the property value@Nonnull Page<IndexedCommit> findByProperty(@Nonnull String propertyKey, @Nonnull String propertyValue, boolean caseSensitive, @Nonnull PageRequest pageRequest)
indexed commits
that have a given property with a specified value.propertyKey
- the property keypropertyValue
- the property valuecaseSensitive
- whether matches against value
should be case-sensitivepageRequest
- the page requestIndexedCommit commits
that have the provided property. The results in the page
are ordered by authorTimestamp
descending@Nullable IndexedCommit getCommit(@Nonnull String commitId)
commitId
- the commit ID
IndexedCommit
, or null
if the specified commit has not been indexed@Nonnull PropertyMap getProperties(@Nonnull String commitId, @Nonnull Iterable<String> propertyKeys)
propertyKeys
. The value of all the properties is of type Set<String>
.commitId
- the commit idpropertyKeys
- the property keys to retrievecommitId
, matching propertyKeys
. Can be empty, but not
null
.@Nonnull Map<String,PropertyMap> getProperties(@Nonnull Iterable<String> commitIds, @Nonnull Iterable<String> propertyKeys)
propertyKeys
. The
value of all the properties is of type Set<String>
.commitIds
- commit IDspropertyKeys
- the property keys to retrieve for each commitcommitIds
, matching propertyKeys
, mapped by commit IDs.
Can be empty, but not null
.boolean isIndexed(@Nonnull String commitId, @Nonnull Repository repository)
commitId
- the commit ID
repository
- the repositoryvoid removeCommit(@Nonnull String commitId, @Nonnull Repository repository)
commitId
- the ID
of the commit to remove from the indexrepository
- the repository to remove the commit's association forvoid removeProperty(@Nonnull String commitId, @Nonnull String key, @Nonnull String value)
commitId
- the commit IDkey
- the property keyvalue
- the property value@Nonnull Page<IndexedCommit> search(@Nonnull IndexSearchRequest searchRequest, @Nonnull PageRequest pageRequest)
searchRequest
- the criteria to matchpageRequest
- a pageRequest to delimit the searchIndexedCommit
s, possibly empty if no indexed commits match@Nonnull Page<MinimalRepositoryCommit> searchRepositoryCommits(@Nonnull IndexSearchRequest indexSearchRequest, @Nonnull PageRequest pageRequest) throws IllegalArgumentException
commits
matching the provided search request. Only
commits in repositories that the current user has access to will be returned. The provided
filter
should be at least 7 characters long.indexSearchRequest
- the search requestpageRequest
- the page requestcommits
that match the criteria and that are in repositories
the current user has access toIllegalArgumentException
- if criteria.getFilter()
is less than 7 charactersCopyright © 2019 Atlassian. All rights reserved.