|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RepositorySpi
The Repository is a collection of archives organized by a tag map. Each archive is equivalent to a .jar file or a directory, consisting of the binary data Blobs, the directory name Tree, and a .git Commit item to track versions. The tag map is a map of strings to tag entries, where the entry is the sha1 of the .git Commit root of the archive, and metadata.
Nested Class Summary | |
---|---|
static class |
RepositorySpi.ValidateHashResult
|
Method Summary | |
---|---|
java.lang.String |
addArchive(Path path)
Adds a path as a jar/zip archive to the repository. |
java.lang.String |
addBlob(java.io.InputStream is)
Adds a stream to the repository where the length is not known. |
java.lang.String |
addBlob(java.io.InputStream is,
long length)
Adds a stream to the repository where the length is known. |
java.lang.String |
addCommit(GitCommit commit)
Adds a git commit entry to the repository |
void |
addListener(java.lang.String tagName,
RepositoryTagListener listener)
Adds a tag change listener |
java.lang.String |
addPath(Path path)
Adds a path to the repository. |
java.lang.String |
addTree(GitTree tree)
Adds a git tree to the repository |
void |
checkForUpdate(boolean isExact)
Updates the repository, checking for any changes across the cluster. |
boolean |
exists(java.lang.String contentHash)
Returns true if the file exists. |
void |
expandToPath(java.lang.String contentHash,
Path path)
Expands the repository to the filesystem. |
java.lang.String |
getRepositoryRootHash()
The Commit .git hash for the repository itself. |
java.lang.String |
getTagContentHash(java.lang.String tag)
Convenience method returning the tag's contentHash. |
java.util.Map<java.lang.String,RepositoryTagEntry> |
getTagMap()
Returns the current read-only tag map. |
GitType |
getType(java.lang.String contentHash)
Returns the GitType of the file. |
boolean |
isActive()
|
boolean |
isBlob(java.lang.String contentHash)
Returns true if the file is a blob. |
boolean |
isCommit(java.lang.String contentHash)
Returns true if the file is a commit |
boolean |
isTree(java.lang.String contentHash)
Returns true if the file is a tree |
java.io.InputStream |
openBlob(java.lang.String blobHash)
Opens an InputStream to a git blob |
java.io.InputStream |
openRawGitFile(java.lang.String contentHash)
Opens a stream to the raw git file. |
boolean |
putTag(java.lang.String tag,
java.lang.String contentHash,
java.util.Map<java.lang.String,java.lang.String> attributes)
Atomic operations. |
GitCommit |
readCommit(java.lang.String commitHash)
Reads a git commit entry from the repository |
GitTree |
readTree(java.lang.String treeHash)
Reads a git tree from the repository |
void |
removeListener(java.lang.String tagName,
RepositoryTagListener listener)
Adds a tag change listener |
boolean |
removeTag(java.lang.String tag,
java.util.Map<java.lang.String,java.lang.String> attributes)
Atomic operations. |
void |
setRepositoryRootHash(java.lang.String rootCommitHash)
The root .git hash for the repository itself. |
RepositorySpi.ValidateHashResult |
validateHash(java.lang.String fileName,
java.lang.String contentHash)
Validates a hash, checking that it and its dependencies exist. |
void |
validateRawGitFile(java.lang.String contentHash)
Remove a raw git file |
void |
writeBlobToStream(java.lang.String blobHash,
java.io.OutputStream os)
Writes the contents of a blob to an OutputStream. |
void |
writeRawGitFile(java.lang.String contentHash,
java.io.InputStream is)
Writes a raw git file |
Method Detail |
---|
boolean exists(java.lang.String contentHash)
GitType getType(java.lang.String contentHash)
boolean isBlob(java.lang.String contentHash)
boolean isTree(java.lang.String contentHash)
boolean isCommit(java.lang.String contentHash)
java.lang.String addBlob(java.io.InputStream is) throws java.io.IOException
is
- the blob's input stream
java.io.IOException
java.lang.String addBlob(java.io.InputStream is, long length) throws java.io.IOException
is
- the blob's input streamlength
- the blob's length
java.io.IOException
java.io.InputStream openBlob(java.lang.String blobHash) throws java.io.IOException
java.io.IOException
void writeBlobToStream(java.lang.String blobHash, java.io.OutputStream os)
blobHash
- the hash of the source blobos
- the OutputStream to write tojava.lang.String addTree(GitTree tree) throws java.io.IOException
java.io.IOException
GitTree readTree(java.lang.String treeHash) throws java.io.IOException
java.io.IOException
java.lang.String addCommit(GitCommit commit) throws java.io.IOException
java.io.IOException
GitCommit readCommit(java.lang.String commitHash) throws java.io.IOException
java.io.IOException
RepositorySpi.ValidateHashResult validateHash(java.lang.String fileName, java.lang.String contentHash) throws java.io.IOException
java.io.IOException
java.lang.String addPath(Path path)
java.lang.String addArchive(Path path)
void expandToPath(java.lang.String contentHash, Path path)
java.io.InputStream openRawGitFile(java.lang.String contentHash) throws java.io.IOException
java.io.IOException
void writeRawGitFile(java.lang.String contentHash, java.io.InputStream is) throws java.io.IOException
java.io.IOException
void validateRawGitFile(java.lang.String contentHash)
void checkForUpdate(boolean isExact)
java.util.Map<java.lang.String,RepositoryTagEntry> getTagMap()
java.lang.String getTagContentHash(java.lang.String tag)
boolean putTag(java.lang.String tag, java.lang.String contentHash, java.util.Map<java.lang.String,java.lang.String> attributes)
boolean removeTag(java.lang.String tag, java.util.Map<java.lang.String,java.lang.String> attributes)
void addListener(java.lang.String tagName, RepositoryTagListener listener)
void removeListener(java.lang.String tagName, RepositoryTagListener listener)
java.lang.String getRepositoryRootHash()
void setRepositoryRootHash(java.lang.String rootCommitHash)
rootCommitHash
- the hash of the new .git Commit for the
repository.boolean isActive()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |