org.jenkinsci.lib.xtrigger
Class AbstractTriggerByFullContext<C extends XTriggerContext>

java.lang.Object
  extended by hudson.triggers.Trigger<hudson.model.BuildableItem>
      extended by org.jenkinsci.lib.xtrigger.AbstractTrigger
          extended by org.jenkinsci.lib.xtrigger.AbstractTriggerByFullContext<C>
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.triggers.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
hudson.triggers.Trigger.Cron
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class org.jenkinsci.lib.xtrigger.AbstractTrigger
LOGGER, offlineSlaveOnStartup
 
Fields inherited from class hudson.triggers.Trigger
job, spec, tabs, timer
 
Constructor Summary
  AbstractTriggerByFullContext(String cronTabSpec)
          Builds a trigger object Calls an implementation trigger
protected AbstractTriggerByFullContext(String cronTabSpec, boolean unblockConcurrentBuild)
           
protected AbstractTriggerByFullContext(String cronTabSpec, String triggerLabel)
           
protected AbstractTriggerByFullContext(String cronTabSpec, String triggerLabel, boolean unblockConcurrentBuild)
           
 
Method Summary
protected abstract  boolean checkIfModified(C oldContext, C newContext, XTriggerLog log)
          Checks if there are modifications in the environment between last poll
protected  boolean checkIfModified(hudson.model.Node pollingNode, XTriggerLog log)
          Checks if there are modifications in the environment between last poll
protected  boolean checkIfModified(XTriggerLog log)
           
protected  C getContext(hudson.model.Node pollingNode, XTriggerLog log)
          Captures the context This method is alternative to getContext(XTriggerLog log) It must be overridden from 0.26
protected  C getContext(XTriggerLog log)
          Captures the context This method is alternative to getContext(Node pollingNode, XTriggerLog log) It must be overridden from 0.26
abstract  boolean isContextOnStartupFetched()
           
protected  void start(hudson.model.Node pollingNode, hudson.model.BuildableItem project, boolean newInstance, XTriggerLog log)
          Can be overridden if needed
 
Methods inherited from class org.jenkinsci.lib.xtrigger.AbstractTrigger
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, init, readResolve, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTriggerByFullContext

public AbstractTriggerByFullContext(String cronTabSpec)
                             throws antlr.ANTLRException
Builds a trigger object Calls an implementation trigger

Parameters:
cronTabSpec - the scheduler value
Throws:
antlr.ANTLRException

AbstractTriggerByFullContext

protected AbstractTriggerByFullContext(String cronTabSpec,
                                       boolean unblockConcurrentBuild)
                                throws antlr.ANTLRException
Throws:
antlr.ANTLRException

AbstractTriggerByFullContext

protected AbstractTriggerByFullContext(String cronTabSpec,
                                       String triggerLabel)
                                throws antlr.ANTLRException
Throws:
antlr.ANTLRException

AbstractTriggerByFullContext

protected AbstractTriggerByFullContext(String cronTabSpec,
                                       String triggerLabel,
                                       boolean unblockConcurrentBuild)
                                throws antlr.ANTLRException
Throws:
antlr.ANTLRException
Method Detail

start

protected void start(hudson.model.Node pollingNode,
                     hudson.model.BuildableItem project,
                     boolean newInstance,
                     XTriggerLog log)
              throws XTriggerException
Can be overridden if needed

Overrides:
start in class AbstractTrigger
Throws:
XTriggerException

isContextOnStartupFetched

public abstract boolean isContextOnStartupFetched()

checkIfModified

protected boolean checkIfModified(hudson.model.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 class AbstractTrigger
Returns:
true if there are modifications
Throws:
XTriggerException

checkIfModified

protected boolean checkIfModified(XTriggerLog log)
                           throws XTriggerException
Overrides:
checkIfModified in class AbstractTrigger
Throws:
XTriggerException

getContext

protected C getContext(hudson.model.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


Copyright © 2004-2013. All Rights Reserved.