Interface AgentGeneralRequirementsManager

  • All Known Implementing Classes:
    AgentGeneralRequirementsManagerImpl

    public interface AgentGeneralRequirementsManager
    This class provides functions for some of the most common agent requirements managments
    Since:
    2020.1
    • Method Detail

      • getCompatibleOperatingSystems

        @NotNull
        Collection<String> getCompatibleOperatingSystems​(@NotNull
                                                         BuildTypeSettings settings)
        Parameters:
        settings - settings, which agents are checked
        Returns:
        collection of compatible agents OS names
      • addOperatingSystemRequirement

        void addOperatingSystemRequirement​(@NotNull
                                           BuildTypeSettings settings,
                                           @NotNull
                                           String osName)
        Adds requirement for matching agents by operating system
        Parameters:
        settings - settings, where requirement should be added
        osName - required operating system
      • addOperatingSystemRequirement

        void addOperatingSystemRequirement​(@NotNull
                                           BuildTypeSettings settings,
                                           @NotNull
                                           Collection<String> osNames)
        Adds requirement for matching agents by operating system. All agents, which name is in the collection, will match the resulting requirement
        Parameters:
        settings - settings, where requirement should be added
        osNames - collections of required operating systems
      • addCpuCountRequirement

        void addCpuCountRequirement​(@NotNull
                                    BuildTypeSettings buildTypeSettings,
                                    @NotNull
                                    String minVal,
                                    @NotNull
                                    String maxVal)
        Adds requirement for matching agents by CPU count. All agents, which have CPU count in the range of [minVal, maxVal], will match the resulting requirement. Given bounds are not validated
        Parameters:
        buildTypeSettings - settings, where requirement should be added
        minVal - lower bound for CPU count
        maxVal - upper bound for CPU count
      • addCpuCountRequirement

        void addCpuCountRequirement​(@NotNull
                                    BuildTypeSettings buildTypeSettings,
                                    long minVal,
                                    long maxVal)
                             throws GeneralRequirementsValidationException
        Adds requirement for matching agents by CPU count. All agents, which have CPU count in the range of [minVal, maxVal], will match the resulting requirement. Given bounds are validated
        Parameters:
        buildTypeSettings - settings, where requirement should be added
        minVal - lower bound for CPU count
        maxVal - upper bound for CPU count
        Throws:
        GeneralRequirementsValidationException - if range is not valid
      • getSupportedOperatingSystems

        @NotNull
        Set<String> getSupportedOperatingSystems()
        Returns set of operating systems, which is used for general requirements. This may contain some predefined list and also operating systems of all registered at the moment agent
        Returns:
        supported operating systems set
      • getRequiredOperatingSystems

        @NotNull
        List<String> getRequiredOperatingSystems​(@NotNull
                                                 BuildTypeSettings settings)
        Detects operating systems, required for the build type
        Parameters:
        settings - settings, from which operating systems are detected
        Returns:
        list of detected OS
      • getRequiredOperatingSystems

        @NotNull
        List<String> getRequiredOperatingSystems​(@NotNull
                                                 List<Requirement> requirements)
        Detects operating systems, required by requirements
        Parameters:
        requirements - requirements, from which operating systems are detected
        Returns:
        list of detected OS
      • getRequirementsByName

        @NotNull
        List<Requirement> getRequirementsByName​(@NotNull
                                                String parameterName,
                                                @NotNull
                                                BuildTypeSettings settings)
        Searches for requirement by parameter name
        Parameters:
        parameterName - name, by which requirements are searched
        settings - settings, where requirements are searched
        Returns:
        list of found requirements
      • detectMinumumCpuCount

        long detectMinumumCpuCount​(@NotNull
                                   List<Requirement> requirements)
        Detects minimum CPU count, which satisfies the requirements
        Parameters:
        requirements - list of requirements to satisfy
        Returns:
        detected CPU count
      • detectMaximumCpuCount

        long detectMaximumCpuCount​(@NotNull
                                   List<Requirement> requirements)
        Detects maximum CPU count, which satisfies the requirements
        Parameters:
        requirements - list of requirements to satisfy
        Returns:
        detected CPU count
      • detectMinimumMemorySize

        long detectMinimumMemorySize​(@NotNull
                                     List<Requirement> requirements)
        Detects minimum memory size, which satisfies the requirements
        Parameters:
        requirements - list of requirements to satisfy
        Returns:
        detected memory size
      • detectMaximumMemorySize

        long detectMaximumMemorySize​(@NotNull
                                     List<Requirement> requirements)
        Detects maximum memory size, which satisfies the requirements
        Parameters:
        requirements - list of requirements to satisfy
        Returns:
        detected memory size
      • addMemorySizeRequirement

        void addMemorySizeRequirement​(@NotNull
                                      BuildTypeSettings settings,
                                      @NotNull
                                      String minVal,
                                      @NotNull
                                      String maxVal)
        Adds requirement for matching agents by memory size. All agents, which have memory size in the range of [minVal, maxVal], will match the resulting requirement. Given bounds are not validated
        Parameters:
        buildTypeSettings - settings, where requirement should be added
        minVal - lower bound for memory size
        maxVal - upper bound for memory size
      • addMemorySizeRequirement

        void addMemorySizeRequirement​(@NotNull
                                      BuildTypeSettings buildTypeSettings,
                                      long minVal,
                                      long maxVal)
                               throws GeneralRequirementsValidationException
        Adds requirement for matching agents by memory size. All agents, which have memory size in the range of [minVal, maxVal], will match the resulting requirement. Given bounds are not validated
        Parameters:
        buildTypeSettings - settings, where requirement should be added
        minVal - lower bound for memory size
        maxVal - upper bound for memory size
        Throws:
        GeneralRequirementsValidationException - if bounds are not valid