jetbrains.buildServer.agent.impl
Class XmlRpcAgentLogListener

java.lang.Object
  extended by jetbrains.buildServer.agent.impl.XmlRpcAgentLogListener
All Implemented Interfaces:
AgentLogListener

public class XmlRpcAgentLogListener
extends java.lang.Object
implements AgentLogListener


Field Summary
protected  java.lang.String myMethodPrefix
           
protected  XmlRpcTarget myTarget
           
 
Constructor Summary
  XmlRpcAgentLogListener(int localPort)
          This constructor must be used in runtime only, i.e.
protected XmlRpcAgentLogListener(java.lang.String serverUrl, int connectionTimeout)
           
 
Method Summary
 boolean buildFinished(java.lang.String buildId, java.util.Date finishDate, boolean buildFailed)
           
 boolean buildInterrupted(java.lang.String buildId)
           
 boolean isBuildFailing(java.lang.String buildId)
          Checks for build status on the build server.
 boolean log(java.lang.String buildId, java.util.Vector messagesXml)
          Return value indicates, whether this message was accepted by server.
 boolean markCheckoutDirClean(java.lang.String buildId)
          This method must be called if sources on the agent correspond to revision associated with this agent on the server, i.e.
 boolean markCheckoutDirDirty(java.lang.String buildId)
          Should be called by agent when agent is going to modify content of the checkout directory, either by applying a patch to this directory, or when agent is going to clean files from it.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myTarget

protected XmlRpcTarget myTarget

myMethodPrefix

protected final java.lang.String myMethodPrefix
Constructor Detail

XmlRpcAgentLogListener

public XmlRpcAgentLogListener(int localPort)
This constructor must be used in runtime only, i.e. when test listener reports messages to localhost

Parameters:
localPort - port

XmlRpcAgentLogListener

protected XmlRpcAgentLogListener(java.lang.String serverUrl,
                                 int connectionTimeout)
Method Detail

log

public boolean log(java.lang.String buildId,
                   java.util.Vector messagesXml)
Description copied from interface: AgentLogListener
Return value indicates, whether this message was accepted by server. If returned false, no other messages with given buildId should be sent for corresponding buildId

Specified by:
log in interface AgentLogListener

buildFinished

public boolean buildFinished(java.lang.String buildId,
                             java.util.Date finishDate,
                             boolean buildFailed)
Specified by:
buildFinished in interface AgentLogListener

buildInterrupted

public boolean buildInterrupted(java.lang.String buildId)
Specified by:
buildInterrupted in interface AgentLogListener

markCheckoutDirClean

public boolean markCheckoutDirClean(java.lang.String buildId)
Description copied from interface: AgentLogListener
This method must be called if sources on the agent correspond to revision associated with this agent on the server, i.e. this method must be called if patch was successfully applied and build was not personal, or when personal build finished and personal patch was successfully reverted.

Specified by:
markCheckoutDirClean in interface AgentLogListener
Parameters:
buildId - id of the build
Returns:
true if command was successfully sent to server

markCheckoutDirDirty

public boolean markCheckoutDirDirty(java.lang.String buildId)
Description copied from interface: AgentLogListener
Should be called by agent when agent is going to modify content of the checkout directory, either by applying a patch to this directory, or when agent is going to clean files from it.

When server receives this command it forgets revisions associated with the agent and build configuration. If "patchApplied" command will not be sent next time clean patch will be sent to agent for this build configuration. Note: this command must be synchronous on the agent side, i.e. we must ensure that server has processed this command before agent will apply patch.

Specified by:
markCheckoutDirDirty in interface AgentLogListener
Parameters:
buildId - id of the build
Returns:
true if command was successfully sent to server

isBuildFailing

public boolean isBuildFailing(java.lang.String buildId)
                       throws java.lang.InterruptedException
Description copied from interface: AgentLogListener
Checks for build status on the build server. The call is synchronous, it makes sure that previous logged messages are sent to the server.

Specified by:
isBuildFailing in interface AgentLogListener
Returns:
true if build status on the server is failing
Throws:
java.lang.InterruptedException - if action was removed from the queue for some reason, and could not be completed (for instance, build is obsolete)

toString

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