Class RefsUnreadableInMemoryRepository.RefsUnreadableRefDatabase
java.lang.Object
org.eclipse.jgit.lib.RefDatabase
org.eclipse.jgit.internal.storage.dfs.DfsRefDatabase
org.eclipse.jgit.internal.storage.dfs.DfsReftableDatabase
org.eclipse.jgit.internal.storage.dfs.InMemoryRepository.MemRefDatabase
org.eclipse.jgit.http.test.RefsUnreadableInMemoryRepository.RefsUnreadableRefDatabase
- Enclosing class:
RefsUnreadableInMemoryRepository
private class RefsUnreadableInMemoryRepository.RefsUnreadableRefDatabase
extends InMemoryRepository.MemRefDatabase
-
Nested Class Summary
Nested classes/interfaces inherited from class DfsRefDatabase
DfsRefDatabase.RefCache -
Field Summary
Fields inherited from class RefDatabase
ALL, MAX_SYMBOLIC_REF_DEPTH, SEARCH_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRead a single reference.Get a section of the reference namespace.getRefsByPrefix(String prefix) Returns refs whose names start with a given prefix.getRefsByPrefixWithExclusions(String include, Set<String> excludes) Returns refs whose names start with a given prefix excluding all refs that start with one of the given prefixes.Returns all refs that resolve directly to the givenObjectId.Methods inherited from class InMemoryRepository.MemRefDatabase
getReftableConfig, performsAtomicTransactionsMethods inherited from class DfsReftableDatabase
cachePeeledState, compactDuringCommit, compareAndPut, compareAndRemove, getLock, hasFastTipsWithSha1, hasVersioning, isNameConflicting, newBatchUpdate, peel, scanAllRefs, stackMethods inherited from class DfsRefDatabase
close, create, getAdditionalRefs, getRepository, newRename, newUpdate, refreshMethods inherited from class RefDatabase
exactRef, findRef, findRef, firstExactRef, getConflictingNames, getRef, getRefs, getRefsByPrefix, hasRefs
-
Constructor Details
-
RefsUnreadableRefDatabase
private RefsUnreadableRefDatabase()
-
-
Method Details
-
exactRef
Read a single reference.Unlike
RefDatabase.findRef(String), this method expects an unshortened reference name and does not search using the standardRefDatabase.SEARCH_PATH.- Overrides:
exactRefin classDfsReftableDatabase- Parameters:
name- the unabbreviated name of the reference.- Returns:
- the reference (if it exists); else
null. - Throws:
IOException- the reference space cannot be accessed.
-
getRefs
Get a section of the reference namespace.- Overrides:
getRefsin classDfsReftableDatabase- Parameters:
prefix- prefix to search the namespace with; must end with/. If the empty string (RefDatabase.ALL), obtain a complete snapshot of all references.- Returns:
- modifiable map that is a complete snapshot of the current
reference namespace, with
prefixremoved from the start of each key. The map can be an unsorted map. - Throws:
IOException- the reference space cannot be accessed.
-
getRefsByPrefix
Returns refs whose names start with a given prefix.The default implementation uses
RefDatabase.getRefs(String). Implementors ofRefDatabaseshould override this method directly if a better implementation is possible.- Overrides:
getRefsByPrefixin classDfsReftableDatabase- Parameters:
prefix- string that names of refs should start with; may be empty (to return all refs).- Returns:
- immutable list of refs whose names start with
prefix. - Throws:
IOException- the reference space cannot be accessed.
-
getRefsByPrefixWithExclusions
public List<Ref> getRefsByPrefixWithExclusions(String include, Set<String> excludes) throws IOException Returns refs whose names start with a given prefix excluding all refs that start with one of the given prefixes.The default implementation is not efficient. Implementors of
RefDatabaseshould override this method directly if a better implementation is possible.- Overrides:
getRefsByPrefixWithExclusionsin classDfsReftableDatabase- Parameters:
include- string that names of refs should start with; may be empty.excludes- strings that names of refs can't start with; may be empty.- Returns:
- immutable list of refs whose names start with
prefixand none of the strings inexclude. - Throws:
IOException- the reference space cannot be accessed.
-
getTipsWithSha1
Returns all refs that resolve directly to the givenObjectId. Includes peeledObjectIds. This is the inverse lookup ofRefDatabase.exactRef(String...).The default implementation uses a linear scan. Implementors of
RefDatabaseshould override this method directly if a better implementation is possible.- Overrides:
getTipsWithSha1in classDfsReftableDatabase- Parameters:
id-ObjectIdto resolve- Returns:
- a
SetofRefs whose tips point to the provided id. - Throws:
IOException- the reference space cannot be accessed.
-