jetbrains.buildServer.agent.vcs
Class AgentVcsSupport

java.lang.Object
  extended by jetbrains.buildServer.agent.vcs.AgentVcsSupport
All Implemented Interfaces:
AgentExtension, AgentVcsExtension, AgentVcsSupportContext, AgentVcsSupportCore, TeamCityExtension

public abstract class AgentVcsSupport
extends java.lang.Object
implements AgentVcsSupportContext, AgentVcsSupportCore

Default implementation of AgentVcsSupportContext. All VcsSupport on agent implementations are strongly recommended to inherit from this class. Inheriting from this class may strongly increase backward compatibility with forthcoming TeamCity releases.

Since:
4.5

Constructor Summary
AgentVcsSupport()
           
 
Method Summary
 boolean canRun(BuildAgentConfiguration agentConfiguration, TextLogger messageLog)
          This method may be called at any time.
 AgentVcsSupportCore getCore()
           
abstract  java.lang.String getName()
          Name of the VCS plugin.
abstract  UpdatePolicy getUpdatePolicy()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentVcsSupport

public AgentVcsSupport()
Method Detail

getCore

@NotNull
public AgentVcsSupportCore getCore()
Specified by:
getCore in interface AgentVcsSupportContext
Returns:
object that provides basic functionality for VCS support.

getUpdatePolicy

@NotNull
public abstract UpdatePolicy getUpdatePolicy()
Specified by:
getUpdatePolicy in interface AgentVcsSupportContext
Returns:
vcs update policy. See UpdatePolicy for details.

getName

@NotNull
public abstract java.lang.String getName()
Description copied from interface: AgentVcsSupportCore
Name of the VCS plugin. Should be the same as VcsSupportConfig.getName()

Specified by:
getName in interface AgentVcsSupportCore
Returns:
see above

canRun

public boolean canRun(@NotNull
                      BuildAgentConfiguration agentConfiguration,
                      @NotNull
                      TextLogger messageLog)
Description copied from interface: AgentVcsSupportCore
This method may be called at any time. It's guaranteed vcs plugin will be disabled if it has returned false from this method. But subsequent calls to canRun are still possible.

Specified by:
canRun in interface AgentVcsSupportCore
Parameters:
agentConfiguration - - current agent configuration
messageLog - - logger to log user-related information on plugin availability
Returns:
true if the vcs support can run in this particular environment or not. For example, returning 'false' is a way for a runner to refuse to run on a system that is not supported by the runner If 'false' is returned, the Agent won't register the vcs support and it won't be advertised to the build server server during agent's registration