org.eclipse.jgit.storage.dht.spi
Interface RefTable

All Known Implementing Classes:
CacheRefTable

public interface RefTable

Tracks all branches and tags for a repository.

Each repository has one or more references, pointing to the most recent revision on that branch, or to the tagged revision if its a tag.


Method Summary
 boolean compareAndPut(RefKey refKey, GitStore.RefData oldData, GitStore.RefData newData)
          Compare a reference, and put if it matches.
 boolean compareAndRemove(RefKey refKey, GitStore.RefData oldData)
          Compare a reference, and delete if it matches.
 java.util.Map<RefKey,GitStore.RefData> getAll(Context options, RepositoryKey repository)
          Read all known references in the repository.
 

Method Detail

getAll

java.util.Map<RefKey,GitStore.RefData> getAll(Context options,
                                              RepositoryKey repository)
                                              throws DhtException,
                                                     java.util.concurrent.TimeoutException
Read all known references in the repository.

Parameters:
options - options to control reading.
repository - the repository to load the references from.
Returns:
map of all references. Empty map if there are no references.
Throws:
DhtException - the database cannot be read.
java.util.concurrent.TimeoutException - the operation to read the database timed out.

compareAndRemove

boolean compareAndRemove(RefKey refKey,
                         GitStore.RefData oldData)
                         throws DhtException,
                                java.util.concurrent.TimeoutException
Compare a reference, and delete if it matches.

Parameters:
refKey - reference to delete.
oldData - the old data for the reference. The delete only occurs if the value is still equal to oldData.
Returns:
true if the delete was successful; false if the current value does not match oldData.
Throws:
DhtException - the database cannot be updated.
java.util.concurrent.TimeoutException - the operation to modify the database timed out.

compareAndPut

boolean compareAndPut(RefKey refKey,
                      GitStore.RefData oldData,
                      GitStore.RefData newData)
                      throws DhtException,
                             java.util.concurrent.TimeoutException
Compare a reference, and put if it matches.

Parameters:
refKey - reference to create or replace.
oldData - the old data for the reference. The put only occurs if the value is still equal to oldData. Use RefDataUtil.NONE if the reference should not exist and is being created.
newData - new value to store.
Returns:
true if the put was successful; false if the current value does not match prior.
Throws:
DhtException - the database cannot be updated.
java.util.concurrent.TimeoutException - the operation to modify the database timed out.


Copyright © 2011. All Rights Reserved.