Class AgentTypeImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.agentTypes.AgentTypeImpl
-
- All Implemented Interfaces:
AgentBuildHistory
,AgentDescription
,AgentType
,SAgentType
public class AgentTypeImpl extends Object implements SAgentType
- Author:
- Eugene Petrenko Created: 10.03.2010 14:58:41
-
-
Constructor Summary
Constructors Constructor Description AgentTypeImpl(AgentTypeDetails agentTypeDetails, AgentType data, AgentPoolManager agentPoolManager, BuildAgentManager buildAgentManager, BuildHistoryEx history)
AgentTypeImpl(AgentType data, AgentTypeProviderRegistry agentTypeProviderRegistry, AgentPoolManager agentPoolManager, BuildAgentManager buildAgentManager, BuildHistoryEx history)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsAgentDescriptionData()
boolean
equals(Object o)
AgentPool
getAgentPool()
int
getAgentPoolId()
int
getAgentTypeId()
AgentTypeKey
getAgentTypeKey()
Map<String,String>
getAvailableParameters()
Returns map of parameters available on the agent.String
getAvailableParameterValue(String parameterName)
Returns value of a single available parameter.Set<String>
getAvailableRunTypeIds()
Returns set of runner types available on the agentList<RunType>
getAvailableRunTypes()
Returns list of runners available on the agentList<String>
getAvailableVcsPlugins()
List<SFinishedBuild>
getBuildHistory(User user, boolean includeCanceled)
Returns the build history of this agent.Map<String,String>
getBuildParameters()
Returns map of build parameters that will be added to the build parameters when build is started on the agent.Map<String,String>
getConfigurationParameters()
Returns map of configuration parameters that are defined on the build agent.int
getCpuBenchmarkIndex()
Returns this agent CPU benchmark index.int
getCpuCount()
Returns the number of CPUs of this agentMap<String,String>
getDefinedParameters()
Returns map of parameters explicitly defined in the agent configuration file.AgentTypeDetails
getDetails()
String
getOperatingSystemName()
Returns name of the operating system where the agent is currently running.AgentTypePolicy
getPolicy()
SBuildAgent
getRealAgent()
For real agent types returns the corresponding agent or null if it does not exist anymore.int
hashCode()
boolean
isCaseInsensitiveEnvironment()
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.agentTypes.SAgentType
isCloud
-
-
-
-
Constructor Detail
-
AgentTypeImpl
public AgentTypeImpl(@NotNull AgentType data, @NotNull AgentTypeProviderRegistry agentTypeProviderRegistry, @NotNull AgentPoolManager agentPoolManager, @NotNull BuildAgentManager buildAgentManager, @NotNull BuildHistoryEx history)
-
AgentTypeImpl
public AgentTypeImpl(@NotNull AgentTypeDetails agentTypeDetails, @NotNull AgentType data, @NotNull AgentPoolManager agentPoolManager, @NotNull BuildAgentManager buildAgentManager, @NotNull BuildHistoryEx history)
-
-
Method Detail
-
getBuildHistory
@NotNull public List<SFinishedBuild> getBuildHistory(@Nullable User user, boolean includeCanceled)
Description copied from interface:AgentBuildHistory
Returns the build history of this agent.The history can be filtered by user, as well as by cancelled builds.
- Specified by:
getBuildHistory
in interfaceAgentBuildHistory
- Parameters:
user
- if set the result will contain only builds byuser
includeCanceled
- if set the result will include canceled builds as well- Returns:
- build history
-
getDetails
@NotNull public AgentTypeDetails getDetails()
- Specified by:
getDetails
in interfaceSAgentType
- Returns:
- runtime details of the associated agent type
-
getAgentTypeId
public int getAgentTypeId()
- Specified by:
getAgentTypeId
in interfaceAgentType
-
getAgentTypeKey
@NotNull public AgentTypeKey getAgentTypeKey()
- Specified by:
getAgentTypeKey
in interfaceAgentType
-
getAgentPoolId
public int getAgentPoolId()
- Specified by:
getAgentPoolId
in interfaceAgentType
-
getAgentPool
@NotNull public AgentPool getAgentPool()
- Specified by:
getAgentPool
in interfaceSAgentType
-
getRealAgent
@Nullable public SBuildAgent getRealAgent()
Description copied from interface:SAgentType
For real agent types returns the corresponding agent or null if it does not exist anymore. For cloud agent types returns null always.- Specified by:
getRealAgent
in interfaceSAgentType
- Returns:
- see above
-
getAvailableParameters
@NotNull public Map<String,String> getAvailableParameters()
Description copied from interface:AgentDescription
Returns map of parameters available on the agent. These parameters include environment variables defined for the agent process as well as parameters defined in the agent configuration file.- Specified by:
getAvailableParameters
in interfaceAgentDescription
- Returns:
- see above
-
getAvailableParameterValue
@Nullable public String getAvailableParameterValue(@NotNull String parameterName)
Description copied from interface:AgentDescription
Returns value of a single available parameter. This is equivalent to {@link #getAvailableParameters().get(name)} but can work faster.- Specified by:
getAvailableParameterValue
in interfaceAgentDescription
- Parameters:
parameterName
- name of the parameter- Returns:
- see above
-
getAvailableRunTypes
@NotNull public List<RunType> getAvailableRunTypes()
Description copied from interface:AgentDescription
Returns list of runners available on the agent- Specified by:
getAvailableRunTypes
in interfaceAgentDescription
- Returns:
- list of runners ordered by display name
-
getAvailableRunTypeIds
@NotNull public Set<String> getAvailableRunTypeIds()
Description copied from interface:AgentDescription
Returns set of runner types available on the agent- Specified by:
getAvailableRunTypeIds
in interfaceAgentDescription
- Returns:
- set of runner types
-
getAvailableVcsPlugins
@NotNull public List<String> getAvailableVcsPlugins()
- Specified by:
getAvailableVcsPlugins
in interfaceAgentDescription
-
getCpuBenchmarkIndex
public int getCpuBenchmarkIndex()
Description copied from interface:AgentDescription
Returns this agent CPU benchmark index. The higher this value the more powerful agent CPU.- Specified by:
getCpuBenchmarkIndex
in interfaceAgentDescription
- Returns:
- CPU index or -1 if index is not available
-
getCpuCount
public int getCpuCount()
Description copied from interface:AgentDescription
Returns the number of CPUs of this agent- Specified by:
getCpuCount
in interfaceAgentDescription
- Returns:
- number of CPUs or -1 if count is not available
-
getDefinedParameters
@NotNull public Map<String,String> getDefinedParameters()
Description copied from interface:AgentDescription
Returns map of parameters explicitly defined in the agent configuration file.- Specified by:
getDefinedParameters
in interfaceAgentDescription
- Returns:
- see above
-
getOperatingSystemName
@NotNull public String getOperatingSystemName()
Description copied from interface:AgentDescription
Returns name of the operating system where the agent is currently running.- Specified by:
getOperatingSystemName
in interfaceAgentDescription
- Returns:
- name of the operating system where the agent is currently running.
-
getConfigurationParameters
@NotNull public Map<String,String> getConfigurationParameters()
Description copied from interface:AgentDescription
Returns map of configuration parameters that are defined on the build agent. Those parameters may be defined in agent configuration files or may be provided by agent plugins.- Specified by:
getConfigurationParameters
in interfaceAgentDescription
- Returns:
- map of parameters
-
getBuildParameters
@NotNull public Map<String,String> getBuildParameters()
Description copied from interface:AgentDescription
Returns map of build parameters that will be added to the build parameters when build is started on the agent. Keys in the map have prefixesConstants.SYSTEM_PREFIX
orConstants.ENV_PREFIX
- Specified by:
getBuildParameters
in interfaceAgentDescription
- Returns:
- map of build parameters.
-
isCaseInsensitiveEnvironment
public boolean isCaseInsensitiveEnvironment()
- Specified by:
isCaseInsensitiveEnvironment
in interfaceAgentDescription
- Returns:
- true if names of environment variables are case insensitive
-
getPolicy
@NotNull public AgentTypePolicy getPolicy()
-
containsAgentDescriptionData
public boolean containsAgentDescriptionData()
- Specified by:
containsAgentDescriptionData
in interfaceSAgentType
- Returns:
- true if agent contains AgentDescription from some connected agent
-
-