Class SimpleAgentTypePolicy
- java.lang.Object
-
- jetbrains.buildServer.serverSide.agentTypes.SimpleAgentTypePolicy
-
- All Implemented Interfaces:
AgentTypePolicy
public final class SimpleAgentTypePolicy extends Object implements AgentTypePolicy
Determines which configurations allowed to run on the agent. Value object.- Since:
- 7.0
- Author:
- Leonid Bushuev from JetBrains
-
-
Field Summary
Fields Modifier and Type Field Description static intBT_RESTRICTED_POLICYstatic intRUN_ALL_POLICY
-
Constructor Summary
Constructors Constructor Description SimpleAgentTypePolicy(int policyKind, Set<String> projectIds, Set<String> buildTypeIds)Makes an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Set<String>getAllowedBuildTypes()Selected build types.Set<String>getAllowedProjects()Allowed projects.intgetPolicyKind()Kind of the policy.inthashCode()booleanisAllowedToRun(String projectId, String buildTypeId)Checks whether the specified build configuration is allowed to run on this agent.booleanisBuildTypeAllowed(String buildTypeId)Checks whether the specified build configuration is selected by this policy (this method does not consider pool associations).StringtoString()
-
-
-
Field Detail
-
RUN_ALL_POLICY
public static final int RUN_ALL_POLICY
- See Also:
- Constant Field Values
-
BT_RESTRICTED_POLICY
public static final int BT_RESTRICTED_POLICY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPolicyKind
public int getPolicyKind()
Kind of the policy.- Specified by:
getPolicyKindin interfaceAgentTypePolicy- Returns:
- 1 - run all, 2 - run selected only.
-
getAllowedProjects
@NotNull public Set<String> getAllowedProjects()
Allowed projects.- Specified by:
getAllowedProjectsin interfaceAgentTypePolicy- Returns:
- an immutable set of project identifiers; may be ampty.
-
getAllowedBuildTypes
@NotNull public Set<String> getAllowedBuildTypes()
Selected build types.- Specified by:
getAllowedBuildTypesin interfaceAgentTypePolicy- Returns:
- an immutable set of build type identifiers; may be ampty.
-
isBuildTypeAllowed
public boolean isBuildTypeAllowed(@NotNull String buildTypeId)Checks whether the specified build configuration is selected by this policy (this method does not consider pool associations).- Specified by:
isBuildTypeAllowedin interfaceAgentTypePolicy- Returns:
- see above
-
isAllowedToRun
public boolean isAllowedToRun(@NotNull String projectId, @NotNull String buildTypeId)Checks whether the specified build configuration is allowed to run on this agent.- Specified by:
isAllowedToRunin interfaceAgentTypePolicy- Parameters:
projectId-buildTypeId- build configuration to check.- Returns:
- true if allowed.
-
-