hudson.ivy
Class IvyBuildTrigger.DescriptorImpl

java.lang.Object
  extended by hudson.model.Descriptor<T>
      extended by hudson.tasks.BuildStepDescriptor<hudson.tasks.Publisher>
          extended by hudson.ivy.IvyBuildTrigger.DescriptorImpl
All Implemented Interfaces:
hudson.model.Saveable
Enclosing class:
IvyBuildTrigger

public static final class IvyBuildTrigger.DescriptorImpl
extends hudson.tasks.BuildStepDescriptor<hudson.tasks.Publisher>

The descriptor implementation of this trigger


Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.model.Descriptor
hudson.model.Descriptor.FormException, hudson.model.Descriptor.PropertyType
 
Field Summary
 
Fields inherited from class hudson.model.Descriptor
clazz
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Method Summary
 boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json)
          Configure the Descriptor from a GUI request.
 hudson.util.FormValidation doCheckIvyConf(java.lang.String value)
          Check that the Ivy configuration file exists.
 hudson.util.FormValidation doCheckIvyFile(java.lang.String value)
          Check that the workspace relative path to the ivy.xml file was entered and conforms to basic expectations.
 void doHandleExternalTrigger(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Simulate what would happen internally if a successful build occurred on an IvyBuildTrigger managed project.
 IvyBuildTrigger.IvyConfiguration[] getConfigurations()
           
 java.lang.String getDisplayName()
          Implement the Descritor's display name.
 boolean isApplicable(java.lang.Class<? extends hudson.model.AbstractProject> jobType)
          Check if this Descriptor is applicable to the job type.
 boolean isExtendedVersionMatching()
           
 hudson.tasks.Publisher newInstance(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json)
          Create a new instance of the trigger based on GUI request.
 
Methods inherited from class hudson.tasks.BuildStepDescriptor
filter
 
Methods inherited from class hudson.model.Descriptor
configure, configure, convert, doHelp, find, find, getCheckUrl, getConfigPage, getGlobalConfigPage, getHelpFile, getHelpFile, getJsonSafeClassName, getPropertyType, getViewPage, isInstance, load, newInstance, newInstancesFromHeteroList, save, toArray, toList, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConfigurations

public IvyBuildTrigger.IvyConfiguration[] getConfigurations()
Returns:
every existing configuration

isExtendedVersionMatching

public boolean isExtendedVersionMatching()
Returns:
true if extended version matching is being used.

getDisplayName

public java.lang.String getDisplayName()
Implement the Descritor's display name.

Specified by:
getDisplayName in class hudson.model.Descriptor<hudson.tasks.Publisher>

configure

public boolean configure(org.kohsuke.stapler.StaplerRequest req,
                         net.sf.json.JSONObject json)
Configure the Descriptor from a GUI request.

Overrides:
configure in class hudson.model.Descriptor<hudson.tasks.Publisher>

doHandleExternalTrigger

public void doHandleExternalTrigger(org.kohsuke.stapler.StaplerRequest req,
                                    org.kohsuke.stapler.StaplerResponse rsp)
                             throws java.io.IOException,
                                    javax.servlet.ServletException
Simulate what would happen internally if a successful build occurred on an IvyBuildTrigger managed project. This provides a hook to start builds on downstream projects if a triggering event outside of Hudson occurred. One such triggering event could be publish of a non-integration (milestone/release) build of the IvyBuildTrigger managed project code to the Ivy repository that is visible to your build system. The StaplerRequest parameter must include request parameters org and name which respectively represent the Ivy module descriptor attributes organisation and module. Optional request parameters that can be passed on the StaplerRequest include branch and rev which respectively represent the Ivy module descriptor attributes branch and revision. These values are used to match against the ModuleDescriptor of Hudson projects using the IvyBuildTrigger. In the case that more than one project matches, it is the first match that will win, and only that project will have its downstream dependencies scheduled for builds. Therefore the caller is wise to provide the most information in the request to ensure the best possible match. If the trigger descriptor is set to use extended version matching, then at least one of the optional rev or branch is required on the request. Note this event trigger does not actually build the matched project in Hudson. It just schedules builds on downstream dependent projects. Successfully executing this event trigger requires global Item.BUILD permission on a secured Hudson instance.

Parameters:
req - The StaplerRequest
rsp - The StaplerResponse
Throws:
java.io.IOException - IOException on the servlet call
javax.servlet.ServletException - ServletException on the servlet call
See Also:
isExtendedVersionMatching()

doCheckIvyConf

public hudson.util.FormValidation doCheckIvyConf(@QueryParameter
                                                 java.lang.String value)
Check that the Ivy configuration file exists.

Parameters:
req - the file path

doCheckIvyFile

public hudson.util.FormValidation doCheckIvyFile(@QueryParameter
                                                 java.lang.String value)
Check that the workspace relative path to the ivy.xml file was entered and conforms to basic expectations. This code cannot check for file existence since the file never exists for new projects that need to check out the ivy file from source control. Under this condition the validator would always fail for first time configuration which can be confusing. The Ivy file might also be on a remote slave making checking for existence at this level more difficult.

Parameters:
value - the relative path

newInstance

public hudson.tasks.Publisher newInstance(org.kohsuke.stapler.StaplerRequest req,
                                          net.sf.json.JSONObject json)
Create a new instance of the trigger based on GUI request.

Overrides:
newInstance in class hudson.model.Descriptor<hudson.tasks.Publisher>

isApplicable

public boolean isApplicable(java.lang.Class<? extends hudson.model.AbstractProject> jobType)
Check if this Descriptor is applicable to the job type. Currently on instances of Project are supported.

Specified by:
isApplicable in class hudson.tasks.BuildStepDescriptor<hudson.tasks.Publisher>
Parameters:
jobType - the AbstractProject type to be checked.
Returns:
true iff the project type can apply this Descriptor
See Also:
Project


Copyright © 2010. All Rights Reserved.