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.CronNested 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 triggerprotectedAbstractTriggerByFullContext(String cronTabSpec, boolean unblockConcurrentBuild) protectedAbstractTriggerByFullContext(String cronTabSpec, String triggerLabel) protectedAbstractTriggerByFullContext(String cronTabSpec, String triggerLabel, boolean unblockConcurrentBuild) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleancheckIfModified(C oldContext, C newContext, XTriggerLog log) Checks if there are modifications in the environment between last pollprotected booleancheckIfModified(Node pollingNode, XTriggerLog log) Checks if there are modifications in the environment between last pollprotected booleanprotected CgetContext(Node pollingNode, XTriggerLog log) Captures the context This method is alternative to getContext(XTriggerLog log) It must be overridden from 0.26protected CgetContext(XTriggerLog log) Captures the context This method is alternative to getContext(Node pollingNode, XTriggerLog log) It must be overridden from 0.26abstract booleanprotected voidresetOldContext(C oldContext) Resets the current context to the old contextprotected voidsetNewContext(C context) protected voidstart(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, startMethods 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:
startin classAbstractTrigger- Throws:
XTriggerException
-
isContextOnStartupFetched
public abstract boolean isContextOnStartupFetched() -
checkIfModified
Description copied from class:AbstractTriggerChecks if there are modifications in the environment between last poll- Specified by:
checkIfModifiedin classAbstractTrigger- Returns:
- true if there are modifications
- Throws:
XTriggerException
-
checkIfModified
- Overrides:
checkIfModifiedin 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
-