Package hudson.plugins.emailext.plugins
Class EmailTrigger
java.lang.Object
hudson.plugins.emailext.plugins.EmailTrigger
- All Implemented Interfaces:
ExtensionPoint
,Describable<EmailTrigger>
- Direct Known Subclasses:
AbortedTrigger
,AbstractScriptTrigger
,AlwaysTrigger
,BuildingTrigger
,FailureTrigger
,FirstUnstableTrigger
,FixedTrigger
,FixedUnhealthyTrigger
,ImprovementTrigger
,NotBuiltTrigger
,NthFailureTrigger
,PreBuildTrigger
,RegressionTrigger
,StatusChangedTrigger
,StillFailingTrigger
,StillUnstableTrigger
,SuccessTrigger
,UnstableTrigger
public abstract class EmailTrigger
extends Object
implements Describable<EmailTrigger>, ExtensionPoint
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
ModifierConstructorDescriptionprotected
EmailTrigger
(boolean sendToList, boolean sendToDevs, boolean sendToRequestor, boolean sendToCulprits, String recipientList, String replyTo, String subject, String body, String attachmentsPattern, int attachBuildLog, String contentType) Deprecated.protected
EmailTrigger
(List<RecipientProvider> recipientProviders, String recipientList, String replyTo, String subject, String body, String attachmentsPattern, int attachBuildLog, String contentType) protected
EmailTrigger
(net.sf.json.JSONObject formData) -
Method Summary
Modifier and TypeMethodDescriptionall()
static List<EmailTriggerDescriptor>
boolean
configure
(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) protected EmailType
createMailType
(net.sf.json.JSONObject formData) Deprecated.protected EmailType
createMailType
(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) getEmail()
Get the email that is with this trigger.protected int
getNumFailures
(Run<?, ?> build) Determine the number of direct failures in the given build.boolean
Should this trigger run before the build? Defaults to false.void
boolean
Should this trigger bypass the email throttling? Defaults to false.abstract boolean
trigger
(AbstractBuild<?, ?> build, TaskListener listener) Implementors of this method need to return true if the conditions to trigger an email have been met.
-
Constructor Details
-
EmailTrigger
@Deprecated protected EmailTrigger(boolean sendToList, boolean sendToDevs, boolean sendToRequestor, boolean sendToCulprits, String recipientList, String replyTo, String subject, String body, String attachmentsPattern, int attachBuildLog, String contentType) Deprecated. -
EmailTrigger
-
EmailTrigger
protected EmailTrigger(net.sf.json.JSONObject formData)
-
-
Method Details
-
all
-
allWatchable
-
trigger
Implementors of this method need to return true if the conditions to trigger an email have been met.- Parameters:
build
- The Build object after the project has been builtlistener
- Used for logging to the build log- Returns:
- true if the conditions have been met to trigger a build of this type
-
getEmail
Get the email that is with this trigger.- Returns:
- the email
-
setEmail
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<EmailTrigger>
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) -
createMailType
Deprecated. -
createMailType
protected EmailType createMailType(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) -
getNumFailures
Determine the number of direct failures in the given build. If it aggregates downstream results, ignore contributed failures. This is because at the time this trigger runs, the current build's aggregated results aren't available yet, but those of the previous build may be.- Parameters:
build
- The project run to get the number of test failures for.- Returns:
- The number of test failures for the Run
-
isPreBuild
public boolean isPreBuild()Should this trigger run before the build? Defaults to false.- Returns:
- true if the trigger should be checked before the build.
-
shouldBypassThrottling
public boolean shouldBypassThrottling()Should this trigger bypass the email throttling? Defaults to false. Critical triggers like build failures override this to true.- Returns:
- true if the trigger should bypass the email throttling.
-