Class AbstractTriggerByFullContext<C extends XTriggerContext>
java.lang.Object
hudson.triggers.Trigger<BuildableItem>
org.jenkinsci.plugins.xtriggerapi.AbstractTrigger
org.jenkinsci.plugins.xtriggerapi.AbstractTriggerByFullContext<C>
- All Implemented Interfaces:
ExtensionPoint
,Describable<Trigger<?>>
,Serializable
public abstract class AbstractTriggerByFullContext<C extends XTriggerContext>
extends AbstractTrigger
- Author:
- Gregory Boissinot
- See Also:
-
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 inherited from class org.jenkinsci.plugins.xtriggerapi.AbstractTrigger
LOGGER, offlineSlaveOnStartup
-
Constructor Summary
ConstructorsModifierConstructorDescriptionAbstractTriggerByFullContext
(String cronTabSpec) Builds a trigger object Calls an implementation triggerprotected
AbstractTriggerByFullContext
(String cronTabSpec, boolean unblockConcurrentBuild) protected
AbstractTriggerByFullContext
(String cronTabSpec, String triggerLabel) protected
AbstractTriggerByFullContext
(String cronTabSpec, String triggerLabel, boolean unblockConcurrentBuild) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
checkIfModified
(C oldContext, C newContext, XTriggerLog log) Checks if there are modifications in the environment between last pollprotected boolean
checkIfModified
(Node pollingNode, XTriggerLog log) Checks if there are modifications in the environment between last pollprotected boolean
protected C
getContext
(Node pollingNode, XTriggerLog log) Captures the context This method is alternative to getContext(XTriggerLog log) It must be overridden from 0.26protected C
getContext
(XTriggerLog log) Captures the context This method is alternative to getContext(Node pollingNode, XTriggerLog log) It must be overridden from 0.26abstract boolean
protected void
resetOldContext
(C oldContext) Resets the current context to the old contextprotected void
setNewContext
(C context) protected void
start
(Node pollingNode, BuildableItem project, boolean newInstance, XTriggerLog log) Can be overridden if neededMethods inherited from class org.jenkinsci.plugins.xtriggerapi.AbstractTrigger
getBuildCause, getCause, getDescriptor, getLogFile, getName, getScheduledActions, getScheduledXTriggerActions, getTriggerLabel, requirePollingNode, requiresWorkspaceForPolling, resolveEnvVars, run, start
Methods inherited from class hudson.triggers.Trigger
all, checkTriggers, for_, getProjectAction, getProjectActions, getSpec, readResolve, stop, toString
-
Constructor Details
-
AbstractTriggerByFullContext
Builds a trigger object Calls an implementation trigger- Parameters:
cronTabSpec
- the scheduler value- Throws:
ANTLRException
- the expression language expression
-
AbstractTriggerByFullContext
protected AbstractTriggerByFullContext(String cronTabSpec, boolean unblockConcurrentBuild) throws ANTLRException - Throws:
ANTLRException
-
AbstractTriggerByFullContext
protected AbstractTriggerByFullContext(String cronTabSpec, String triggerLabel) throws ANTLRException - Throws:
ANTLRException
-
AbstractTriggerByFullContext
protected AbstractTriggerByFullContext(String cronTabSpec, String triggerLabel, boolean unblockConcurrentBuild) throws ANTLRException - Throws:
ANTLRException
-
-
Method Details
-
start
protected void start(Node pollingNode, BuildableItem project, boolean newInstance, XTriggerLog log) throws XTriggerException Can be overridden if needed- Overrides:
start
in classAbstractTrigger
- Throws:
XTriggerException
-
isContextOnStartupFetched
public abstract boolean isContextOnStartupFetched() -
checkIfModified
Description copied from class:AbstractTrigger
Checks if there are modifications in the environment between last poll- Specified by:
checkIfModified
in classAbstractTrigger
- Returns:
- true if there are modifications
- Throws:
XTriggerException
-
checkIfModified
- Overrides:
checkIfModified
in classAbstractTrigger
- Throws:
XTriggerException
-
setNewContext
-
resetOldContext
Resets the current context to the old context- Parameters:
oldContext
- the previous context
-
getContext
Captures the context This method is alternative to getContext(XTriggerLog log) It must be overridden from 0.26- Throws:
XTriggerException
-
getContext
Captures the context This method is alternative to getContext(Node pollingNode, XTriggerLog log) It must be overridden from 0.26- Throws:
XTriggerException
-
checkIfModified
protected abstract boolean checkIfModified(C oldContext, C newContext, XTriggerLog log) throws XTriggerException Checks if there are modifications in the environment between last poll- Returns:
- true if there are modifications
- Throws:
XTriggerException
-