org.jenkinsci.lib.xtrigger
Class AbstractTrigger

java.lang.Object
  extended by hudson.triggers.Trigger<hudson.model.BuildableItem>
      extended by org.jenkinsci.lib.xtrigger.AbstractTrigger
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.triggers.Trigger<?>>, Serializable
Direct Known Subclasses:
AbstractTriggerByFullContext

public abstract class AbstractTrigger
extends hudson.triggers.Trigger<hudson.model.BuildableItem>
implements Serializable

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
protected static Logger LOGGER
           
protected  boolean offlineSlaveOnStartup
           
 
Fields inherited from class hudson.triggers.Trigger
job, spec, tabs, timer
 
Constructor Summary
AbstractTrigger(String cronTabSpec)
          Builds a trigger object Calls an implementation trigger
AbstractTrigger(String cronTabSpec, String triggerLabel)
          Builds a trigger object Calls an implementation trigger
 
Method Summary
protected abstract  boolean checkIfModified(hudson.model.Node pollingNode, XTriggerLog log)
          Checks if there are modifications in the environment between last poll
protected abstract  String getCause()
          Gets the trigger cause
 XTriggerDescriptor getDescriptor()
           
protected abstract  File getLogFile()
          Gets the triggering log file
protected abstract  String getName()
           
protected abstract  hudson.model.Action[] getScheduledActions(hudson.model.Node pollingNode, XTriggerLog log)
           
protected  hudson.model.Action[] getScheduledXTriggerActions(hudson.model.Node pollingNode, XTriggerLog log)
           
 String getTriggerLabel()
           
protected abstract  boolean requiresWorkspaceForPolling()
          Checks if a consistency workspace is required for the polling
protected  String resolveEnvVars(String value, hudson.model.AbstractProject project, hudson.model.Node node)
           
 void run()
           
 void start(hudson.model.BuildableItem project, boolean newInstance)
           
protected  void start(hudson.model.Node pollingNode, hudson.model.BuildableItem project, boolean newInstance, XTriggerLog log)
          Can be overridden if needed
 
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
 

Field Detail

LOGGER

protected static Logger LOGGER

offlineSlaveOnStartup

protected transient boolean offlineSlaveOnStartup
Constructor Detail

AbstractTrigger

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

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

AbstractTrigger

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

Parameters:
cronTabSpec - the scheduler value
triggerLabel - the trigger label to restrictbox where the poll to run
Throws:
antlr.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(hudson.model.BuildableItem project,
                  boolean newInstance)
Overrides:
start in class hudson.triggers.Trigger<hudson.model.BuildableItem>

start

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

Throws:
XTriggerException

resolveEnvVars

protected String resolveEnvVars(String value,
                                hudson.model.AbstractProject project,
                                hudson.model.Node node)
                         throws XTriggerException
Throws:
XTriggerException

run

public void run()
Overrides:
run in class hudson.triggers.Trigger<hudson.model.BuildableItem>

getName

protected abstract String getName()

getDescriptor

public XTriggerDescriptor getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<hudson.triggers.Trigger<?>>
Overrides:
getDescriptor in class hudson.triggers.Trigger<hudson.model.BuildableItem>

getScheduledXTriggerActions

protected hudson.model.Action[] getScheduledXTriggerActions(hudson.model.Node pollingNode,
                                                            XTriggerLog log)
                                                     throws XTriggerException
Throws:
XTriggerException

getScheduledActions

protected abstract hudson.model.Action[] getScheduledActions(hudson.model.Node pollingNode,
                                                             XTriggerLog log)

checkIfModified

protected abstract boolean checkIfModified(hudson.model.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

getCause

protected abstract String getCause()
Gets the trigger cause

Returns:
the trigger cause


Copyright © 2004-2012. All Rights Reserved.