Class GerritTriggerDescriptor

java.lang.Object
hudson.model.Descriptor<Trigger<?>>
hudson.triggers.TriggerDescriptor
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerDescriptor
All Implemented Interfaces:
Saveable, OnMaster

@Extension @Symbol("gerrit") public final class GerritTriggerDescriptor extends TriggerDescriptor
The Descriptor for the Trigger.
  • Constructor Details

    • GerritTriggerDescriptor

      public GerritTriggerDescriptor()
      Default Constructor.
  • Method Details

    • isUnsuccessfulMessageFileSupported

      public boolean isUnsuccessfulMessageFileSupported(Job job)
      Checks if the provided job type can support GerritTrigger.getBuildUnsuccessfulFilepath(). I.e. if the job is an AbstractProject.
      Parameters:
      job - the job to check.
      Returns:
      true if so.
    • doAutoCompleteDependencyJobsNames

      public AutoCompletionCandidates doAutoCompleteDependencyJobsNames(@QueryParameter String value, @AncestorInPath Item self, @AncestorInPath ItemGroup container)
      Provides auto-completion candidates for dependency jobs names.
      Parameters:
      value - the value.
      self - the current instance.
      container - the container.
      Returns:
      AutoCompletionCandidates
    • doCheckDependencyJobsNames

      public FormValidation doCheckDependencyJobsNames(@AncestorInPath Item project, @QueryParameter String value)
      Validates that the dependency jobs are legitimate and do not create cycles.
      Parameters:
      value - the string value.
      project - the current project.
      Returns:
      FormValidation
    • doFillServerNameItems

      public ListBoxModel doFillServerNameItems(@AncestorInPath Item project)
      Fill the server dropdown with the list of servers configured globally.
      Parameters:
      project - the current project.
      Returns:
      list of servers.
    • isSlaveSelectionAllowedInJobs

      public boolean isSlaveSelectionAllowedInJobs()
      Whether slave selection in jobs should be allowed. If so, the user will see one more dropdown on the job config page, right under server selection dropdown.
      Returns:
      true if so.
    • doFillGerritSlaveIdItems

      public ListBoxModel doFillGerritSlaveIdItems(@QueryParameter("serverName") String serverName)
      Fill the Gerrit slave dropdown with the list of slaves configured with the selected server. Expected to be called only when slave config is enabled at job level.
      Parameters:
      serverName - the name of the selected server.
      Returns:
      list of slaves.
    • doUrlCheck

      public FormValidation doUrlCheck(@QueryParameter("value") String value)
      Checks that the provided parameter is nonempty and a valid URL.
      Parameters:
      value - the value.
      Returns:
      FormValidation.ok()
    • doFillNotificationLevelItems

      public ListBoxModel doFillNotificationLevelItems(@QueryParameter("serverName") String serverName)
      Fill the dropdown for notification levels.
      Parameters:
      serverName - the server name.
      Returns:
      the values.
    • isApplicable

      public boolean isApplicable(Item item)
      Specified by:
      isApplicable in class TriggerDescriptor
    • getDisplayName

      public String getDisplayName()
      Overrides:
      getDisplayName in class Descriptor<Trigger<?>>
    • getHelpFile

      public String getHelpFile()
      Overrides:
      getHelpFile in class Descriptor<Trigger<?>>
    • getCompareTypes

      public CompareType[] getCompareTypes()
      A list of CompareTypes for the UI.
      Returns:
      A list of CompareTypes
    • getGerritEventDescriptors

      public List<PluginGerritEvent.PluginGerritEventDescriptor> getGerritEventDescriptors()
      Getter for the list of PluginGerritEventDescriptors.
      Returns:
      the list.