Class CommandEntity

    • Field Detail

      • APPLICATIONS_ENTITY_GRAPH

        public static final java.lang.String APPLICATIONS_ENTITY_GRAPH
        The name of the EntityGraph which will eagerly load the command base fields and its associated applications base fields.
        See Also:
        Constant Field Values
      • APPLICATIONS_DTO_ENTITY_GRAPH

        public static final java.lang.String APPLICATIONS_DTO_ENTITY_GRAPH
        The name of the EntityGraph which will eagerly load the command base fields and its associated applications dto fields.
        See Also:
        Constant Field Values
      • CLUSTER_CRITERIA_ENTITY_GRAPH

        public static final java.lang.String CLUSTER_CRITERIA_ENTITY_GRAPH
        The name of the EntityGraph which will eagerly load the command base fields and its associated cluster criteria.
        See Also:
        Constant Field Values
      • DTO_ENTITY_GRAPH

        public static final java.lang.String DTO_ENTITY_GRAPH
        The name of the EntityGraph which will eagerly load everything needed to construct a Command DTO.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CommandEntity

        public CommandEntity()
        Default Constructor.
    • Method Detail

      • setExecutable

        public void setExecutable​(@NotEmpty
                                  @NotEmpty java.util.List<@NotBlank @Size(max=1024) java.lang.String> executable)
        Set the executable and any default arguments for this command.
        Parameters:
        executable - The executable and default arguments which can't be blank and there must be at least one
      • setConfigs

        public void setConfigs​(@Nullable
                               java.util.Set<FileEntity> configs)
        Set all the files associated as configuration files for this cluster.
        Parameters:
        configs - The configuration files to set
      • setDependencies

        public void setDependencies​(@Nullable
                                    java.util.Set<FileEntity> dependencies)
        Set all the files associated as dependency files for this cluster.
        Parameters:
        dependencies - The dependency files to set
      • setTags

        public void setTags​(@Nullable
                            java.util.Set<TagEntity> tags)
        Set all the tags associated to this cluster.
        Parameters:
        tags - The dependency tags to set
      • getMemory

        public java.util.Optional<java.lang.Integer> getMemory()
        Get the default memory for a job using this command.
        Returns:
        Optional of Integer as it could be null
      • getLauncherExt

        public java.util.Optional<com.fasterxml.jackson.databind.JsonNode> getLauncherExt()
        Get any metadata associated with this command pertaining to specifying details for various agent launchers.
        Returns:
        The metadata or Optional.empty() if there isn't any
      • setLauncherExt

        public void setLauncherExt​(@Nullable
                                   com.fasterxml.jackson.databind.JsonNode launcherExt)
        Set any metadata pertaining to additional instructions for various launchers if this command is used.
        Parameters:
        launcherExt - The metadata
      • addApplication

        public void addApplication​(@NotNull
                                   @NotNull ApplicationEntity application)
                            throws PreconditionFailedException
        Append an application to the list of applications this command uses.
        Parameters:
        application - The application to add. Not null.
        Throws:
        PreconditionFailedException - If the application is a duplicate of an existing application
      • removeApplication

        public void removeApplication​(@NotNull
                                      @NotNull ApplicationEntity application)
        Remove an application from this command. Manages both sides of relationship.
        Parameters:
        application - The application to remove. Not null.
      • setClusterCriteria

        public void setClusterCriteria​(@Nullable
                                       java.util.List<CriterionEntity> clusterCriteria)
        Set the criteria, in priority order, that this command has for determining which available clusters to use for a job.
        Parameters:
        clusterCriteria - The cluster criteria
      • addClusterCriterion

        public void addClusterCriterion​(CriterionEntity criterion)
        Add a new cluster criterion as the lowest priority criterion to evaluate for this command.
        Parameters:
        criterion - The CriterionEntity to add
      • addClusterCriterion

        public void addClusterCriterion​(CriterionEntity criterion,
                                        int priority)
        Add a new cluster criterion with the given priority.
        Parameters:
        criterion - The new criterion to add
        priority - The priority with which this criterion should be considered. 0 would be the highest priority and anything greater than the current size of the existing criteria will just be added to the end of the list. If a priority of < 0 is passed in the criterion is added as the highest priority (0).
      • removeClusterCriterion

        public CriterionEntity removeClusterCriterion​(int priority)
                                               throws java.lang.IllegalArgumentException
        Remove the criterion with the given priority from the list of available criterion for this command.
        Parameters:
        priority - The priority of the criterion to remove.
        Returns:
        The CriterionEntity which was removed by this operation
        Throws:
        java.lang.IllegalArgumentException - If this value is < 0 or > {@link List#size()} as it becomes unclear what the user wants to do
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class BaseEntity