public interface

CommitIndex

implements DeprecatedChangesetIndex
com.atlassian.stash.idx.CommitIndex

Class Overview

Index to store meta data against commits. This interface serves to decouple commit indexing from storing metadata in an index.

Summary

Public Methods
void addProperty(String commitId, String key, String value)
Stores a string commit property.
@Nonnull Page<IndexedCommit> findByProperty(String propertyKey, String propertyValue, boolean caseSensitive, PageRequest pageRequest)
Retrieves all indexed commits that have a given property with a specified value.
@Nonnull PropertyMap getProperties(String commitId, Iterable<String> propertyKeys)
Retrieves a property map containing all properties stored against the given commit, matching propertyKeys.
@Nonnull Map<String, PropertyMap> getProperties(Iterable<String> commitIds, Iterable<String> propertyKeys)
Retrieves a properties for each of the specified commits, matching the provided propertyKeys.
void removeProperty(String commitId, String key, String value)
Removes a commit property.
[Expand]
Inherited Methods
From interface com.atlassian.stash.idx.DeprecatedChangesetIndex

Public Methods

public void addProperty (String commitId, String key, String value)

Stores a string commit property. If the property (name-value pair) already exists, calling this method will have no effect.

Parameters
commitId the commit ID
key the property key
value the property value

@Nonnull public Page<IndexedCommit> findByProperty (String propertyKey, String propertyValue, boolean caseSensitive, PageRequest pageRequest)

Retrieves all indexed commits that have a given property with a specified value.

Parameters
propertyKey the property key
propertyValue the property value
caseSensitive whether matches against value should be case-sensitive
pageRequest the page request
Returns
  • a page of IndexedCommit commits that have the provided property. The results in the page are ordered by authorTimestamp descending

@Nonnull public PropertyMap getProperties (String commitId, Iterable<String> propertyKeys)

Retrieves a property map containing all properties stored against the given commit, matching propertyKeys. The value of all the properties is of type Set<String>.

Parameters
commitId the commit id
propertyKeys the property keys to retrieve
Returns
  • properties for commit with commitId, matching propertyKeys. Can be empty, but not null.

@Nonnull public Map<String, PropertyMap> getProperties (Iterable<String> commitIds, Iterable<String> propertyKeys)

Retrieves a properties for each of the specified commits, matching the provided propertyKeys. The value of all the properties is of type Set<String>.

Parameters
commitIds commit IDs
propertyKeys the property keys to retrieve for each commit
Returns
  • properties for each commit in commitIds, matching propertyKeys, mapped by commit IDs. Can be empty, but not null.

public void removeProperty (String commitId, String key, String value)

Removes a commit property.

Parameters
commitId the commit ID
key the property key
value the property value