Class BasicJobDescriptor

java.lang.Object
com.polarion.platform.jobs.spi.BasicJobDescriptor
All Implemented Interfaces:
IJobDescriptor

public class BasicJobDescriptor extends Object implements IJobDescriptor
IJobDescriptor implementation which is not hidden and presents only one (root) group.

Methods addParameter(com.polarion.platform.jobs.IJobDescriptor.IJobParameter) and setDescription(String) must not be called after the descriptor is returned to the user (because these values are protected from dynamic change).

Version:
$Revision$ $Date$
Author:
Stepan Roh, Polarion Software
  • Constructor Details

    • BasicJobDescriptor

      public BasicJobDescriptor(String label, IJobUnit jobUnit)
      Constructor.
      Parameters:
      label - job label
      jobUnit - job unit (may be null)
      Throws:
      IllegalArgumentException - if label is null
  • Method Details

    • getDescription

      public String getDescription()
      Description copied from interface: IJobDescriptor
      Human-readable job description (if any).

      Protected from dynamic change.

      Specified by:
      getDescription in interface IJobDescriptor
      Returns:
      description or null
    • setDescription

      public void setDescription(String description)
      Set description.
      Parameters:
      description - description or null
    • getJobUnit

      public IJobUnit getJobUnit()
      Description copied from interface: IJobDescriptor
      Job unit used by dynamic descriptor.

      Descriptor will not make any changes in this unit, it is fully under caller's control.

      Protected from dynamic change.

      Specified by:
      getJobUnit in interface IJobDescriptor
      Returns:
      associated job unit or null
    • getLabel

      public String getLabel()
      Description copied from interface: IJobDescriptor
      Human-readable job label.

      Protected from dynamic change.

      Specified by:
      getLabel in interface IJobDescriptor
      Returns:
      label (not null)
    • getParameter

      public IJobDescriptor.IJobParameter getParameter(String name)
      Description copied from interface: IJobDescriptor
      Return parameter description of given name (if known).

      Protected from dynamic change.

      Specified by:
      getParameter in interface IJobDescriptor
      Parameters:
      name - parameter name
      Returns:
      parameter or null if unknown
    • getParameterGroup

      public IJobDescriptor.IJobParameterGroup getParameterGroup(String name)
      Description copied from interface: IJobDescriptor
      Return parameter group of given name (if known).

      Protected from dynamic change.

      Specified by:
      getParameterGroup in interface IJobDescriptor
      Parameters:
      name - group name
      Returns:
      group or null if unknown
    • getRootParameterGroup

      public IJobDescriptor.IJobParameterGroup getRootParameterGroup()
      Description copied from interface: IJobDescriptor
      Root parameter group.

      null is returned only if there are no user-visible parameters.

      Although root group must have label, UI may choose to ignore it and skip this level.

      Protected from dynamic change.

      Specified by:
      getRootParameterGroup in interface IJobDescriptor
      Returns:
      root parameter group or null
    • isHidden

      public boolean isHidden()
      Description copied from interface: IJobDescriptor
      Whether this job is hidden from user (not shown in UI).

      UI may decide to show hidden jobs for administration purposes.

      Protected from dynamic change.

      Specified by:
      isHidden in interface IJobDescriptor
      Returns:
      true if this job is hidden, false otherwise
    • addParameter

      public void addParameter(IJobDescriptor.IJobParameter param)
      Add new parameter.

      Parameters are presented in the order in which they were added.

      Parameters:
      param - parameter
      Throws:
      IllegalArgumentException - if param is null