com.caucho.server.deploy
Class DeployClient

java.lang.Object
  extended by com.caucho.server.deploy.DeployClient
All Implemented Interfaces:
Repository
Direct Known Subclasses:
WebAppDeployClient

public class DeployClient
extends java.lang.Object
implements Repository

Deploy Client API


Field Summary
static java.lang.String MESSAGE_ATTRIBUTE
           
static java.lang.String USER_ATTRIBUTE
           
static java.lang.String VERSION_ATTRIBUTE
           
 
Constructor Summary
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)
           
 
Method Summary
 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 commitPath(CommitBuilder commit, Path path)
          Uploads the contents of a jar/zip file to a Resin server.
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

USER_ATTRIBUTE

public static final java.lang.String USER_ATTRIBUTE
See Also:
Constant Field Values

MESSAGE_ATTRIBUTE

public static final java.lang.String MESSAGE_ATTRIBUTE
See Also:
Constant Field Values

VERSION_ATTRIBUTE

public static final java.lang.String VERSION_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

DeployClient

public DeployClient()

DeployClient

public DeployClient(java.lang.String serverId)

DeployClient

public DeployClient(java.lang.String url,
                    ActorSender client)

DeployClient

public DeployClient(java.lang.String host,
                    int port,
                    java.lang.String userName,
                    java.lang.String password)
Method Detail

getUrl

public java.lang.String getUrl()

commitArchive

public java.lang.String commitArchive(CommitBuilder commit,
                                      Path jar)
Uploads the contents of a jar/zip file to a Resin server. The jar is unzipped and each component is uploaded separately. For wars, this means that only the changed files need updates.

Specified by:
commitArchive in interface Repository
Parameters:
tag - symbolic name of the jar file to add
jar - path to the jar file
attributes - commit attributes including user, message, and version

commitArchive

public java.lang.String commitArchive(CommitBuilder commit,
                                      java.io.InputStream is)
Uploads the contents of a jar/zip file to a Resin server. The jar is unzipped and each component is uploaded separately. For wars, this means that only the changed files need updates.

Specified by:
commitArchive in interface Repository
Parameters:
tag - symbolic name of the jar file to add
jar - path to the jar file
attributes - commit attributes including user, message, and version

commitPath

public java.lang.String commitPath(CommitBuilder commit,
                                   Path path)
Uploads the contents of a jar/zip file to a Resin server. The jar is unzipped and each component is uploaded separately. For wars, this means that only the changed files need updates.

Specified by:
commitPath in interface Repository
Parameters:
tag - symbolic name of the jar file to add
jar - path to the jar file
attributes - commit attributes including user, message, and version

copyTag

public java.lang.Boolean copyTag(CommitBuilder target,
                                 CommitBuilder source)
Copies a tag

Parameters:
tag - the new tag to create
sourceTag - the source tag from which to copy
attributes - commit attributes including user and message

removeTag

public boolean removeTag(CommitBuilder commit)
deletes a tag from the repository

Specified by:
removeTag in interface Repository
Parameters:
tag - the tag to remove
attributes - commit attributes including user and message

getTagState

public java.lang.String getTagState(java.lang.String tag)
Returns the state for a tag.


getTagException

public java.lang.Throwable getTagException(java.lang.String tag)
Returns the state for a tag.


sendFile

public void sendFile(java.lang.String sha1,
                     long length,
                     java.io.InputStream is)
              throws java.io.IOException
Throws:
java.io.IOException

writeRawGitFile

public void writeRawGitFile(java.lang.String sha1,
                            java.io.InputStream is)
                     throws java.io.IOException
Throws:
java.io.IOException

getCommitList

public java.lang.String[] getCommitList(java.lang.String[] commitList)

getFile

public boolean getFile(java.lang.String tagName,
                       java.lang.String fileName,
                       java.io.OutputStream os)
                throws java.io.IOException
Throws:
java.io.IOException

listFiles

public java.lang.String[] listFiles(java.lang.String tagName,
                                    java.lang.String fileName)
                             throws java.io.IOException
Throws:
java.io.IOException

calculateFileDigest

public java.lang.String calculateFileDigest(java.io.InputStream is,
                                            long length)
                                     throws java.io.IOException
Throws:
java.io.IOException

queryTags

public DeployTagResult[] queryTags(java.lang.String pattern)

undeploy

public boolean undeploy(CommitBuilder commit)
Undeploy a controller based on a deployment tag: wars/foo.com/my-war

Parameters:
commit - the encoded controller name

restart

public DeployControllerState restart(java.lang.String tag)
Starts a controller based on a deployment tag: wars/foo.com/my-war

Parameters:
tag - the encoded controller name

restartCluster

public DeployControllerState restartCluster(java.lang.String tag)
Starts a controller based on a deployment tag: wars/foo.com/my-war

Parameters:
tag - the encoded controller name

start

public DeployControllerState start(java.lang.String tag)
Starts a controller based on a deployment tag: wars/foo.com/my-war

Parameters:
tag - the encoded controller name

stop

public DeployControllerState stop(java.lang.String tag)
Stops a controller based on a deployment tag: wars/foo.com/my-war

Parameters:
tag - the encoded controller name

close

public void close()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

fillInVersion

public static final void fillInVersion(CommitBuilder commit,
                                       java.lang.String version)

addListener

public void addListener(java.lang.String tagName,
                        RepositoryTagListener listener)
Description copied from interface: Repository
Adds a tag change listener

Specified by:
addListener in interface Repository

getTagContentHash

public java.lang.String getTagContentHash(java.lang.String tag)
Description copied from interface: Repository
Convenience method returning the tag's contentHash.

Specified by:
getTagContentHash in interface Repository

removeListener

public void removeListener(java.lang.String tagName,
                           RepositoryTagListener listener)
Description copied from interface: Repository
Adds a tag change listener

Specified by:
removeListener in interface Repository

getTagMap

public java.util.Map<java.lang.String,RepositoryTagEntry> getTagMap()
Description copied from interface: Repository
Returns the current read-only tag map.

Specified by:
getTagMap in interface Repository