Class ProjectPoolAgentTypePolicy

    • Constructor Detail

      • ProjectPoolAgentTypePolicy

        public ProjectPoolAgentTypePolicy​(int policyKind,
                                          @NotNull
                                          Supplier<Set<String>> projectIdsSupplier,
                                          @Nullable
                                          Set<String> buildTypeIds)
    • Method Detail

      • getPolicyKind

        public int getPolicyKind()
        Kind of the policy. See SimpleAgentTypePolicy
        Specified by:
        getPolicyKind in interface AgentTypePolicy
        Returns:
        1 - run all configurations from associated (by pool) projects, 2 - run selected only (but from associated projects).
      • 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