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 int
BT_RESTRICTED_POLICY
static int
RUN_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 boolean
equals(Object o)
Set<String>
getAllowedBuildTypes()
Selected build types.Set<String>
getAllowedProjects()
Allowed projects.int
getPolicyKind()
Kind of the policy.int
hashCode()
boolean
isAllowedToRun(String projectId, String buildTypeId)
Checks whether the specified build configuration is allowed to run on this agent.boolean
isBuildTypeAllowed(String buildTypeId)
Checks whether the specified build configuration is selected by this policy (this method does not consider pool associations).String
toString()
-
-
-
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:
getPolicyKind
in interfaceAgentTypePolicy
- Returns:
- 1 - run all, 2 - run selected only.
-
getAllowedProjects
@NotNull public Set<String> getAllowedProjects()
Allowed projects.- Specified by:
getAllowedProjects
in interfaceAgentTypePolicy
- Returns:
- an immutable set of project identifiers; may be ampty.
-
getAllowedBuildTypes
@NotNull public Set<String> getAllowedBuildTypes()
Selected build types.- Specified by:
getAllowedBuildTypes
in 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:
isBuildTypeAllowed
in 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:
isAllowedToRun
in interfaceAgentTypePolicy
- Parameters:
projectId
-buildTypeId
- build configuration to check.- Returns:
- true if allowed.
-
-