public class ClusterRepository extends AbstractRepository
RepositorySpi.ValidateHashResult
Constructor and Description |
---|
ClusterRepository(RepositorySpi localRepository) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addBlob(java.io.InputStream is)
Adds a path to the repository.
|
java.lang.String |
addBlob(java.io.InputStream is,
long length)
Adds a path to the repository.
|
java.lang.String |
addCommit(GitCommit commit)
Adds a git commit to the repository
|
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 based on the system store.
|
boolean |
exists(java.lang.String sha1)
Returns the file's git type: blob, tree, or commit
|
void |
expandToPath(java.lang.String contentHash,
Path path)
Writes the contents to a stream.
|
java.lang.String |
getRepositoryRootHash()
Returns the hash stored in the git tag
|
GitType |
getType(java.lang.String hash)
Returns the file's git type: blob, tree, or commit
|
void |
init()
initialize the repository
|
boolean |
isActive() |
boolean |
load(java.lang.String sha1)
Loads from remote
|
java.io.InputStream |
openBlob(java.lang.String sha1)
Opens a stream to a 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> commitMetaData)
Adds a tag
|
GitCommit |
readCommit(java.lang.String sha1)
Reads a git commit from the repository
|
GitTree |
readTree(java.lang.String sha1)
Reads a git tree from the repository
|
boolean |
removeTag(java.lang.String tagName,
java.util.Map<java.lang.String,java.lang.String> commitMetaData)
Removes a tag
|
void |
setRepositoryRootHash(java.lang.String repositoryCommitHash)
Sets the hash stored in the git tag
|
void |
start()
Start the repository
|
void |
stop() |
protected void |
updateLoad(java.lang.String sha1,
boolean isNew)
Updates the tag map from a load.
|
protected void |
updateRepositoryRoot(java.lang.String sha1,
long sequence) |
void |
validateRawGitFile(java.lang.String hash)
Removes a raw git file
|
void |
writeBlobToStream(java.lang.String blobHash,
java.io.OutputStream os)
Writes the contents to a stream.
|
void |
writeRawGitFile(java.lang.String sha1,
java.io.InputStream is)
Writes a raw git file
|
addArchive, addArchive, addArchive, addListener, addTagData, checkForUpdate, commitArchive, commitArchive, commitPath, getCommitHash, getRepositoryTag, getTagContentHash, getTagHash, getTagMap, getTagSequence, isBlob, isCommit, isTree, loadLocalRoot, removeListener, removeTag, removeTagData, setTagMap, toString, update, updateTagMap, validateHash, validateRawHash
public ClusterRepository(RepositorySpi localRepository)
public void init()
init
in class AbstractRepository
public void start()
AbstractRepository
start
in class AbstractRepository
public void stop()
stop
in class AbstractRepository
public boolean isActive()
public void checkForUpdate(boolean isExact)
checkForUpdate
in interface RepositorySpi
checkForUpdate
in class AbstractRepository
protected void updateLoad(java.lang.String sha1, boolean isNew)
updateLoad
in class AbstractRepository
protected void updateRepositoryRoot(java.lang.String sha1, long sequence)
updateRepositoryRoot
in class AbstractRepository
public boolean load(java.lang.String sha1)
public boolean putTag(java.lang.String tag, java.lang.String contentHash, java.util.Map<java.lang.String,java.lang.String> commitMetaData)
putTag
in interface RepositorySpi
putTag
in class AbstractRepository
tagName
- the symbolic tag for the repositorycontentHash
- the hash of the tag's contentcommitMessage
- user's message for the commitcommitMetaData
- additional commit meta-datapublic boolean removeTag(java.lang.String tagName, java.util.Map<java.lang.String,java.lang.String> commitMetaData)
removeTag
in interface RepositorySpi
removeTag
in class AbstractRepository
tagName
- the symbolic tag for the repositorycommitMessage
- user's message for the commitcommitMetaData
- additional commit attributespublic java.lang.String getRepositoryRootHash()
getRepositoryRootHash
in interface RepositorySpi
getRepositoryRootHash
in class AbstractRepository
public void setRepositoryRootHash(java.lang.String repositoryCommitHash)
setRepositoryRootHash
in interface RepositorySpi
setRepositoryRootHash
in class AbstractRepository
repositoryCommitHash
- the hash of the new .git Commit for the
repository.public boolean exists(java.lang.String sha1)
exists
in interface RepositorySpi
exists
in class AbstractRepository
public GitType getType(java.lang.String hash)
getType
in interface RepositorySpi
getType
in class AbstractRepository
public java.lang.String addPath(Path path)
addPath
in interface RepositorySpi
addPath
in class AbstractRepository
public java.lang.String addBlob(java.io.InputStream is) throws java.io.IOException
is
- the blob's input streamjava.io.IOException
public java.lang.String addBlob(java.io.InputStream is, long length) throws java.io.IOException
addBlob
in interface RepositorySpi
addBlob
in class AbstractRepository
is
- the blob's input streamlength
- the blob's lengthjava.io.IOException
public java.io.InputStream openBlob(java.lang.String sha1) throws java.io.IOException
openBlob
in interface RepositorySpi
openBlob
in class AbstractRepository
java.io.IOException
public GitTree readTree(java.lang.String sha1) throws java.io.IOException
readTree
in interface RepositorySpi
readTree
in class AbstractRepository
java.io.IOException
public java.lang.String addTree(GitTree tree) throws java.io.IOException
addTree
in interface RepositorySpi
addTree
in class AbstractRepository
java.io.IOException
public GitCommit readCommit(java.lang.String sha1) throws java.io.IOException
readCommit
in interface RepositorySpi
readCommit
in class AbstractRepository
java.io.IOException
public java.lang.String addCommit(GitCommit commit) throws java.io.IOException
addCommit
in interface RepositorySpi
addCommit
in class AbstractRepository
java.io.IOException
public void writeBlobToStream(java.lang.String blobHash, java.io.OutputStream os)
writeBlobToStream
in interface RepositorySpi
writeBlobToStream
in class AbstractRepository
blobHash
- the hash of the source blobos
- the OutputStream to write topublic void expandToPath(java.lang.String contentHash, Path path)
expandToPath
in interface RepositorySpi
expandToPath
in class AbstractRepository
public java.io.InputStream openRawGitFile(java.lang.String contentHash) throws java.io.IOException
openRawGitFile
in interface RepositorySpi
openRawGitFile
in class AbstractRepository
java.io.IOException
public void writeRawGitFile(java.lang.String sha1, java.io.InputStream is) throws java.io.IOException
writeRawGitFile
in interface RepositorySpi
writeRawGitFile
in class AbstractRepository
java.io.IOException
public void validateRawGitFile(java.lang.String hash)
AbstractRepository
validateRawGitFile
in interface RepositorySpi
validateRawGitFile
in class AbstractRepository