Class 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
    • Constructor Detail

      • SimpleAgentTypePolicy

        public SimpleAgentTypePolicy​(int policyKind,
                                     @Nullable
                                     Set<String> projectIds,
                                     @Nullable
                                     Set<String> buildTypeIds)
        Makes an instance.
        Parameters:
        policyKind - 1 - all, 2 - selected.
        poolId -
        buildTypeIds - selected build types.
    • Method Detail

      • getPolicyKind

        public int getPolicyKind()
        Kind of the policy.
        Specified by:
        getPolicyKind in interface AgentTypePolicy
        Returns:
        1 - run all, 2 - run selected only.
      • getAllowedProjects

        @NotNull
        public Set<String> getAllowedProjects()
        Allowed projects.
        Specified by:
        getAllowedProjects in interface AgentTypePolicy
        Returns:
        an immutable set of project identifiers; may be ampty.
      • getAllowedBuildTypes

        @NotNull
        public Set<String> getAllowedBuildTypes()
        Selected build types.
        Specified by:
        getAllowedBuildTypes in interface AgentTypePolicy
        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 interface AgentTypePolicy
        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 interface AgentTypePolicy
        Parameters:
        projectId -
        buildTypeId - build configuration to check.
        Returns:
        true if allowed.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object