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:
- 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 inherited from class org.jenkinsci.plugins.xtriggerapi.AbstractTrigger
LOGGER, offlineSlaveOnStartup
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractTriggerByFullContext(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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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
checkIfModified(XTriggerLog log)
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
isContextOnStartupFetched()
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 needed-
Methods 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
-
-
-
-
Constructor Detail
-
AbstractTriggerByFullContext
public AbstractTriggerByFullContext(String cronTabSpec) throws ANTLRException
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 Detail
-
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
protected boolean checkIfModified(Node pollingNode, XTriggerLog log) throws XTriggerException
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
protected boolean checkIfModified(XTriggerLog log) throws XTriggerException
- Overrides:
checkIfModified
in classAbstractTrigger
- Throws:
XTriggerException
-
setNewContext
protected void setNewContext(C context)
-
resetOldContext
protected void resetOldContext(C oldContext)
Resets the current context to the old context- Parameters:
oldContext
- the previous context
-
getContext
protected C getContext(Node pollingNode, XTriggerLog log) throws XTriggerException
Captures the context This method is alternative to getContext(XTriggerLog log) It must be overridden from 0.26- Throws:
XTriggerException
-
getContext
protected C getContext(XTriggerLog log) throws XTriggerException
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
-
-