Class AbstractTrigger
- java.lang.Object
-
- hudson.triggers.Trigger<BuildableItem>
-
- org.jenkinsci.plugins.xtriggerapi.AbstractTrigger
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Trigger<?>>
,Serializable
- Direct Known Subclasses:
AbstractTriggerByFullContext
public abstract class AbstractTrigger extends Trigger<BuildableItem> implements Serializable
- Author:
- Gregory Boissinot
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.triggers.Trigger
Trigger.Cron
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger
LOGGER
protected boolean
offlineSlaveOnStartup
-
Constructor Summary
Constructors Modifier Constructor Description AbstractTrigger(String cronTabSpec)
protected
AbstractTrigger(String cronTabSpec, boolean unblockConcurrentBuild)
protected
AbstractTrigger(String cronTabSpec, String triggerLabel)
protected
AbstractTrigger(String cronTabSpec, String triggerLabel, boolean unblockConcurrentBuild)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract boolean
checkIfModified(Node pollingNode, XTriggerLog log)
Checks if there are modifications in the environment between last pollprotected boolean
checkIfModified(XTriggerLog log)
protected XTriggerCause
getBuildCause()
Get the build cause instance to set This method may be overridden by subclasses in order to add additional information to the causeprotected abstract String
getCause()
Gets the trigger causeXTriggerDescriptor
getDescriptor()
protected abstract File
getLogFile()
Gets the triggering log fileprotected abstract String
getName()
protected abstract Action[]
getScheduledActions(Node pollingNode, XTriggerLog log)
protected Action[]
getScheduledXTriggerActions(Node pollingNode, XTriggerLog log)
String
getTriggerLabel()
protected boolean
requirePollingNode()
protected abstract boolean
requiresWorkspaceForPolling()
Checks if a consistency workspace is required for the pollingprotected String
resolveEnvVars(String value, AbstractProject<?,?> project, Node node)
Deprecated.void
run()
void
start(BuildableItem project, boolean newInstance)
protected void
start(Node pollingNode, BuildableItem project, boolean newInstance, XTriggerLog log)
Can be overridden if needed-
Methods inherited from class hudson.triggers.Trigger
all, checkTriggers, for_, getProjectAction, getProjectActions, getSpec, readResolve, stop
-
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
-
offlineSlaveOnStartup
protected transient boolean offlineSlaveOnStartup
-
-
Constructor Detail
-
AbstractTrigger
public AbstractTrigger(String cronTabSpec) throws ANTLRException
- Throws:
ANTLRException
-
AbstractTrigger
protected AbstractTrigger(String cronTabSpec, boolean unblockConcurrentBuild) throws ANTLRException
- Throws:
ANTLRException
-
AbstractTrigger
protected AbstractTrigger(String cronTabSpec, String triggerLabel) throws ANTLRException
- Throws:
ANTLRException
-
AbstractTrigger
protected AbstractTrigger(String cronTabSpec, String triggerLabel, boolean unblockConcurrentBuild) throws ANTLRException
- Throws:
ANTLRException
-
-
Method Detail
-
getTriggerLabel
public String getTriggerLabel()
-
getLogFile
protected abstract File getLogFile()
Gets the triggering log file- Returns:
- the trigger log
-
requiresWorkspaceForPolling
protected abstract boolean requiresWorkspaceForPolling()
Checks if a consistency workspace is required for the polling- Returns:
- true if a workspace is required for the job, false otherwise
-
start
public void start(BuildableItem project, boolean newInstance)
- Overrides:
start
in classTrigger<BuildableItem>
-
start
protected void start(Node pollingNode, BuildableItem project, boolean newInstance, XTriggerLog log) throws XTriggerException
Can be overridden if needed- Throws:
XTriggerException
-
resolveEnvVars
@Deprecated protected String resolveEnvVars(String value, AbstractProject<?,?> project, Node node) throws XTriggerException
Deprecated.- Throws:
XTriggerException
-
run
public void run()
- Overrides:
run
in classTrigger<BuildableItem>
-
getName
protected abstract String getName()
-
getDescriptor
public XTriggerDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<Trigger<?>>
- Overrides:
getDescriptor
in classTrigger<BuildableItem>
-
getScheduledXTriggerActions
protected Action[] getScheduledXTriggerActions(Node pollingNode, XTriggerLog log) throws XTriggerException
- Throws:
XTriggerException
-
getScheduledActions
protected abstract Action[] getScheduledActions(Node pollingNode, XTriggerLog log)
-
checkIfModified
protected abstract boolean checkIfModified(Node pollingNode, XTriggerLog log) throws XTriggerException
Checks if there are modifications in the environment between last poll- Returns:
- true if there are modifications
- Throws:
XTriggerException
-
requirePollingNode
protected boolean requirePollingNode()
-
checkIfModified
protected boolean checkIfModified(XTriggerLog log) throws XTriggerException
- Throws:
XTriggerException
-
getCause
protected abstract String getCause()
Gets the trigger cause- Returns:
- the trigger cause text
-
getBuildCause
protected XTriggerCause getBuildCause()
Get the build cause instance to set This method may be overridden by subclasses in order to add additional information to the cause
-
-