com.caucho.server.admin
Class DeployClient

java.lang.Object
  extended by com.caucho.server.admin.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
 java.lang.String addDeployFile(java.lang.String tag, java.lang.String name, java.lang.String sha1)
           
 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
 java.lang.Boolean deploy(java.lang.String tag)
          Deprecated.  
 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)
           
 HostQuery[] listHosts()
          Deprecated.  
 TagQuery[] listTags(java.lang.String host)
          Deprecated.  
 WebAppQuery[] listWebApps(java.lang.String host)
          Deprecated.  
protected  java.io.Serializable query(java.io.Serializable query)
           
 TagResult[] 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
 java.lang.Boolean restart(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)
           
 java.lang.Boolean start(java.lang.String tag)
          Deprecated.  
 StatusQuery status(java.lang.String tag)
          Deprecated.  
 java.lang.Boolean stop(java.lang.String tag)
          Deprecated.  
 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

addDeployFile

public java.lang.String addDeployFile(java.lang.String tag,
                                      java.lang.String name,
                                      java.lang.String sha1)

queryTags

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

restart

public java.lang.Boolean restart(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 java.lang.Boolean start(java.lang.String tag)
Deprecated. 

Starts a controller based on a deployment tag: wars/foo.com/my-war

Parameters:
tag - the encoded controller name

stop

public java.lang.Boolean stop(java.lang.String tag)
Deprecated. 

Stops a controller based on a deployment tag: wars/foo.com/my-war

Parameters:
tag - the encoded controller name

deploy

public java.lang.Boolean deploy(java.lang.String tag)
Deprecated. 

Deploy controller based on a deployment tag: wars/default/foo.com/my-war

Parameters:
tag - the encoded controller name

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

status

public StatusQuery status(java.lang.String tag)
Deprecated. 


listHosts

public HostQuery[] listHosts()
Deprecated. 


listWebApps

public WebAppQuery[] listWebApps(java.lang.String host)
Deprecated. 


listTags

public TagQuery[] listTags(java.lang.String host)
Deprecated. 


query

protected java.io.Serializable query(java.io.Serializable query)

close

public void close()

toString

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

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

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

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