public class DeployClient extends java.lang.Object implements Repository
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MESSAGE_ATTRIBUTE |
static java.lang.String |
USER_ATTRIBUTE |
static java.lang.String |
VERSION_ATTRIBUTE |
Constructor and Description |
---|
DeployClient() |
DeployClient(java.lang.String serverId) |
DeployClient(java.lang.String url,
ActorSender client) |
DeployClient(java.lang.String host,
int port,
java.lang.String userName,
java.lang.String password) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(java.lang.String tagName,
RepositoryTagListener listener)
Adds a tag change listener
|
java.lang.String |
calculateFileDigest(java.io.InputStream is,
long length) |
void |
close() |
java.lang.String |
commitArchive(CommitBuilder commit,
java.io.InputStream is)
Uploads the contents of a jar/zip file to a Resin server.
|
java.lang.String |
commitArchive(CommitBuilder commit,
Path jar)
Uploads the contents of a jar/zip file to a Resin server.
|
java.lang.String |
commitArchive(CommitBuilder commit,
Path jar,
long timeout) |
java.lang.String |
commitPath(CommitBuilder commit,
Path path)
Uploads the contents of a jar/zip file to a Resin server.
|
java.lang.String |
commitPath(CommitBuilder commit,
Path path,
long timeout) |
java.lang.Boolean |
copyTag(CommitBuilder target,
CommitBuilder source)
Copies a tag
|
static void |
fillInVersion(CommitBuilder commit,
java.lang.String version) |
java.lang.String[] |
getCommitList(java.lang.String[] commitList) |
boolean |
getFile(java.lang.String tagName,
java.lang.String fileName,
java.io.OutputStream os) |
java.lang.String |
getTagContentHash(java.lang.String tag)
Convenience method returning the tag's contentHash.
|
java.lang.Throwable |
getTagException(java.lang.String tag)
Returns the state for a tag.
|
java.util.Map<java.lang.String,RepositoryTagEntry> |
getTagMap()
Returns the current read-only tag map.
|
java.lang.String |
getTagState(java.lang.String tag)
Returns the state for a tag.
|
java.lang.String |
getUrl() |
java.lang.String[] |
listFiles(java.lang.String tagName,
java.lang.String fileName) |
DeployTagResult[] |
queryTags(java.lang.String pattern) |
void |
removeListener(java.lang.String tagName,
RepositoryTagListener listener)
Adds a tag change listener
|
boolean |
removeTag(CommitBuilder commit)
deletes a tag from the repository
|
DeployControllerState |
restart(java.lang.String tag)
Starts a controller based on a deployment tag: wars/foo.com/my-war
|
DeployControllerState |
restartCluster(java.lang.String tag)
Starts a controller based on a deployment tag: wars/foo.com/my-war
|
void |
sendFile(java.lang.String sha1,
long length,
java.io.InputStream is) |
DeployControllerState |
start(java.lang.String tag)
Starts a controller based on a deployment tag: wars/foo.com/my-war
|
DeployControllerState |
stop(java.lang.String tag)
Stops a controller based on a deployment tag: wars/foo.com/my-war
|
java.lang.String |
toString() |
boolean |
undeploy(CommitBuilder commit)
Undeploy a controller based on a deployment tag: wars/foo.com/my-war
|
void |
writeRawGitFile(java.lang.String sha1,
java.io.InputStream is) |
public static final java.lang.String USER_ATTRIBUTE
public static final java.lang.String MESSAGE_ATTRIBUTE
public static final java.lang.String VERSION_ATTRIBUTE
public DeployClient()
public DeployClient(java.lang.String serverId)
public DeployClient(java.lang.String url, ActorSender client)
public DeployClient(java.lang.String host, int port, java.lang.String userName, java.lang.String password)
public java.lang.String getUrl()
public java.lang.String commitArchive(CommitBuilder commit, Path jar)
commitArchive
in interface Repository
tag
- symbolic name of the jar file to addjar
- path to the jar fileattributes
- commit attributes including user, message, and versionpublic java.lang.String commitArchive(CommitBuilder commit, Path jar, long timeout)
public java.lang.String commitArchive(CommitBuilder commit, java.io.InputStream is)
commitArchive
in interface Repository
tag
- symbolic name of the jar file to addjar
- path to the jar fileattributes
- commit attributes including user, message, and versionpublic java.lang.String commitPath(CommitBuilder commit, Path path)
commitPath
in interface Repository
tag
- symbolic name of the jar file to addjar
- path to the jar fileattributes
- commit attributes including user, message, and versionpublic java.lang.String commitPath(CommitBuilder commit, Path path, long timeout)
public java.lang.Boolean copyTag(CommitBuilder target, CommitBuilder source)
tag
- the new tag to createsourceTag
- the source tag from which to copyattributes
- commit attributes including user and messagepublic boolean removeTag(CommitBuilder commit)
removeTag
in interface Repository
tag
- the tag to removeattributes
- commit attributes including user and messagepublic java.lang.String getTagState(java.lang.String tag)
public java.lang.Throwable getTagException(java.lang.String tag)
public void sendFile(java.lang.String sha1, long length, java.io.InputStream is) throws java.io.IOException
java.io.IOException
public void writeRawGitFile(java.lang.String sha1, java.io.InputStream is) throws java.io.IOException
java.io.IOException
public java.lang.String[] getCommitList(java.lang.String[] commitList)
public boolean getFile(java.lang.String tagName, java.lang.String fileName, java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public java.lang.String[] listFiles(java.lang.String tagName, java.lang.String fileName) throws java.io.IOException
java.io.IOException
public java.lang.String calculateFileDigest(java.io.InputStream is, long length) throws java.io.IOException
java.io.IOException
public DeployTagResult[] queryTags(java.lang.String pattern)
public boolean undeploy(CommitBuilder commit)
commit
- the encoded controller namepublic DeployControllerState restart(java.lang.String tag)
tag
- the encoded controller namepublic DeployControllerState restartCluster(java.lang.String tag)
tag
- the encoded controller namepublic DeployControllerState start(java.lang.String tag)
tag
- the encoded controller namepublic DeployControllerState stop(java.lang.String tag)
tag
- the encoded controller namepublic void close()
public java.lang.String toString()
toString
in class java.lang.Object
public static final void fillInVersion(CommitBuilder commit, java.lang.String version)
public void addListener(java.lang.String tagName, RepositoryTagListener listener)
Repository
addListener
in interface Repository
public java.lang.String getTagContentHash(java.lang.String tag)
Repository
getTagContentHash
in interface Repository
public void removeListener(java.lang.String tagName, RepositoryTagListener listener)
Repository
removeListener
in interface Repository
public java.util.Map<java.lang.String,RepositoryTagEntry> getTagMap()
Repository
getTagMap
in interface Repository