Class GerritTriggerDescriptor
- java.lang.Object
-
- hudson.model.Descriptor<Trigger<?>>
-
- hudson.triggers.TriggerDescriptor
-
- com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerDescriptor
-
@Extension @Symbol("gerrit") public final class GerritTriggerDescriptor extends TriggerDescriptor
The Descriptor for the Trigger.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
-
Field Summary
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Constructor Description GerritTriggerDescriptor()
Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AutoCompletionCandidates
doAutoCompleteDependencyJobsNames(String value, Item self, ItemGroup container)
Provides auto-completion candidates for dependency jobs names.FormValidation
doCheckDependencyJobsNames(Item project, String value)
Validates that the dependency jobs are legitimate and do not create cycles.ListBoxModel
doFillGerritSlaveIdItems(String serverName)
Fill the Gerrit slave dropdown with the list of slaves configured with the selected server.ListBoxModel
doFillNotificationLevelItems(String serverName)
Fill the dropdown for notification levels.ListBoxModel
doFillServerNameItems(Item project)
Fill the server dropdown with the list of servers configured globally.FormValidation
doUrlCheck(String value)
Checks that the provided parameter is nonempty and a valid URL.CompareType[]
getCompareTypes()
A list of CompareTypes for the UI.String
getDisplayName()
List<PluginGerritEvent.PluginGerritEventDescriptor>
getGerritEventDescriptors()
Getter for the list of PluginGerritEventDescriptors.String
getHelpFile()
boolean
isApplicable(Item item)
boolean
isSlaveSelectionAllowedInJobs()
Whether slave selection in jobs should be allowed.boolean
isUnsuccessfulMessageFileSupported(Job job)
Checks if the provided job type can supportGerritTrigger.getBuildUnsuccessfulFilepath()
.-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Method Detail
-
isUnsuccessfulMessageFileSupported
public boolean isUnsuccessfulMessageFileSupported(Job job)
Checks if the provided job type can supportGerritTrigger.getBuildUnsuccessfulFilepath()
. I.e. if the job is anAbstractProject
.- 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 classTriggerDescriptor
-
getDisplayName
public String getDisplayName()
- Overrides:
getDisplayName
in classDescriptor<Trigger<?>>
-
getHelpFile
public String getHelpFile()
- Overrides:
getHelpFile
in classDescriptor<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.
-
-