Class BuildCancellationPolicy
java.lang.Object
hudson.model.AbstractDescribableImpl<BuildCancellationPolicy>
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.BuildCancellationPolicy
- All Implemented Interfaces:
Describable<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 ClassesModifier and TypeClassDescriptionstatic classThe descriptor. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.BuildCancellationPolicy(boolean abortNewPatchsets, boolean abortManualPatchsets, boolean abortSameTopic, boolean abortAbandonedPatchsets) Default databound constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic BuildCancellationPolicycreatePolicyFromJSON(net.sf.json.JSONObject obj) Creates a new BuildCancellationPolicy object from JSON.booleanTrue if running builds should be aborted by abandoned patchsets, otherwise false.booleanStandard getter for the abortManualPatchsets value.booleanStandard getter for the abortNewPatchsets value.booleanStandard getter for the abortSameTopic value.booleanGetter for if build cancellation is turned off or on.voidsetAbortAbandonedPatchsets(boolean abortAbandonedPatchsets) Standard seter for abortAbandonedPatchsets.voidsetAbortManualPatchsets(boolean abortManualPatchsets) Standard setter for the abortManualPatchsets value.voidsetAbortNewPatchsets(boolean abortNewPatchsets) Standard setter for the abortNewPatchsets value.voidsetAbortSameTopic(boolean abortSameTopic) Standard setter for the abortSameTopic value.voidsetEnabled(boolean enabled) Turns on/off the build cancellation.Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
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 Details
-
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
Creates a new BuildCancellationPolicy object from JSON.- Parameters:
obj- the JSONObject.- Returns:
- a new BuildCancellationPolicy object.
-