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
Constructors Modifier Constructor Description 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.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
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DescriptorExtensionList<EmailTrigger,EmailTriggerDescriptor>
all()
static List<EmailTriggerDescriptor>
allWatchable()
boolean
configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
protected EmailType
createMailType(net.sf.json.JSONObject formData)
Deprecated.protected EmailType
createMailType(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
EmailTriggerDescriptor
getDescriptor()
EmailType
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
isPreBuild()
Should this trigger run before the build? Defaults to false.void
setEmail(EmailType email)
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 Detail
-
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
protected EmailTrigger(List<RecipientProvider> recipientProviders, String recipientList, String replyTo, String subject, String body, String attachmentsPattern, int attachBuildLog, String contentType)
-
EmailTrigger
protected EmailTrigger(net.sf.json.JSONObject formData)
-
-
Method Detail
-
all
public static DescriptorExtensionList<EmailTrigger,EmailTriggerDescriptor> all()
-
allWatchable
public static List<EmailTriggerDescriptor> allWatchable()
-
trigger
public 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.- 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
public EmailType getEmail()
Get the email that is with this trigger.- Returns:
- the email
-
setEmail
public void setEmail(EmailType email)
-
getDescriptor
public EmailTriggerDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<EmailTrigger>
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
-
createMailType
@Deprecated protected EmailType createMailType(net.sf.json.JSONObject formData)
Deprecated.
-
createMailType
protected EmailType createMailType(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
-
getNumFailures
protected int getNumFailures(Run<?,?> build)
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.
-
-