Class BuildCancellationPolicy
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<BuildCancellationPolicy>
-
- com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.BuildCancellationPolicy
-
- All Implemented Interfaces:
Describable<BuildCancellationPolicy>
public class BuildCancellationPolicy extends AbstractDescribableImpl<BuildCancellationPolicy>
Rules regarding cancellation of builds for when patchsets of the same change comes in.- Author:
- Tomas Westling <tomas.westling@sonymobile.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BuildCancellationPolicy.DescriptorImpl
The descriptor.
-
Constructor Summary
Constructors Constructor Description BuildCancellationPolicy()
Default constructor.BuildCancellationPolicy(boolean abortNewPatchsets, boolean abortManualPatchsets, boolean abortSameTopic, boolean abortAbandonedPatchsets)
Default databound constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BuildCancellationPolicy
createPolicyFromJSON(net.sf.json.JSONObject obj)
Creates a new BuildCancellationPolicy object from JSON.boolean
isAbortAbandonedPatchsets()
True if running builds should be aborted by abandoned patchsets, otherwise false.boolean
isAbortManualPatchsets()
Standard getter for the abortManualPatchsets value.boolean
isAbortNewPatchsets()
Standard getter for the abortNewPatchsets value.boolean
isAbortSameTopic()
Standard getter for the abortSameTopic value.boolean
isEnabled()
Getter for if build cancellation is turned off or on.void
setAbortAbandonedPatchsets(boolean abortAbandonedPatchsets)
Standard seter for abortAbandonedPatchsets.void
setAbortManualPatchsets(boolean abortManualPatchsets)
Standard setter for the abortManualPatchsets value.void
setAbortNewPatchsets(boolean abortNewPatchsets)
Standard setter for the abortNewPatchsets value.void
setAbortSameTopic(boolean abortSameTopic)
Standard setter for the abortSameTopic value.void
setEnabled(boolean enabled)
Turns on/off the build cancellation.-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Constructor Detail
-
BuildCancellationPolicy
@DataBoundConstructor public BuildCancellationPolicy(boolean abortNewPatchsets, boolean abortManualPatchsets, boolean abortSameTopic, boolean abortAbandonedPatchsets)
Default databound constructor.- Parameters:
abortNewPatchsets
- abort new patch setsabortManualPatchsets
- abort manual patch setsabortSameTopic
- abort same topicabortAbandonedPatchsets
- abort abandoned patchsets
-
BuildCancellationPolicy
public BuildCancellationPolicy()
Default constructor.
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Getter for if build cancellation is turned off or on.- Returns:
- whether build cancellation is turned off or on.
-
setEnabled
public void setEnabled(boolean enabled)
Turns on/off the build cancellation.- Parameters:
enabled
- whether build cancellation should be turned off or on.
-
isAbortNewPatchsets
public boolean isAbortNewPatchsets()
Standard getter for the abortNewPatchsets value.- Returns:
- the abortNewPatchsets value.
-
setAbortNewPatchsets
public void setAbortNewPatchsets(boolean abortNewPatchsets)
Standard setter for the abortNewPatchsets value.- Parameters:
abortNewPatchsets
- true if new patchsets should be cancelled by older.
-
isAbortManualPatchsets
public boolean isAbortManualPatchsets()
Standard getter for the abortManualPatchsets value.- Returns:
- the abortManualPatchsets value.
-
setAbortManualPatchsets
public void setAbortManualPatchsets(boolean abortManualPatchsets)
Standard setter for the abortManualPatchsets value.- Parameters:
abortManualPatchsets
- true if manual patchsets should be cancelled.
-
isAbortSameTopic
public boolean isAbortSameTopic()
Standard getter for the abortSameTopic value.- Returns:
- the abortSameTopic value.
-
setAbortSameTopic
public void setAbortSameTopic(boolean abortSameTopic)
Standard setter for the abortSameTopic value.- Parameters:
abortSameTopic
- true if patchsets with same topic should be cancelled.
-
isAbortAbandonedPatchsets
public boolean isAbortAbandonedPatchsets()
True if running builds should be aborted by abandoned patchsets, otherwise false.- Returns:
- abortAbandonedPatchsets
-
setAbortAbandonedPatchsets
public void setAbortAbandonedPatchsets(boolean abortAbandonedPatchsets)
Standard seter for abortAbandonedPatchsets.- Parameters:
abortAbandonedPatchsets
- true if abandoned patchsets should abort build.
-
createPolicyFromJSON
public static BuildCancellationPolicy createPolicyFromJSON(net.sf.json.JSONObject obj)
Creates a new BuildCancellationPolicy object from JSON.- Parameters:
obj
- the JSONObject.- Returns:
- a new BuildCancellationPolicy object.
-
-