jenkins.plugins.svnmerge
Class IntegrateAction

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.TaskAction
          extended by jenkins.plugins.svnmerge.AbstractSvnmergeTaskAction<IntegrateSetting>
              extended by jenkins.plugins.svnmerge.IntegrateAction
All Implemented Interfaces:
hudson.model.Action, hudson.model.BuildBadgeAction, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem

public class IntegrateAction
extends AbstractSvnmergeTaskAction<IntegrateSetting>
implements hudson.model.BuildBadgeAction

AbstractBuild-level action to integrate the build to upstream branch.

Author:
Kohsuke Kawaguchi

Nested Class Summary
 
Nested classes/interfaces inherited from class jenkins.plugins.svnmerge.AbstractSvnmergeTaskAction
AbstractSvnmergeTaskAction.TaskImpl, AbstractSvnmergeTaskAction.WorkerThread
 
Field Summary
 hudson.model.AbstractBuild<?,?> build
           
 
Fields inherited from class hudson.model.TaskAction
log, workerThread
 
Constructor Summary
IntegrateAction(hudson.model.AbstractBuild<?,?> build)
           
 
Method Summary
protected  IntegrateSetting createParams(org.kohsuke.stapler.StaplerRequest req)
           
protected  AbstractSvnmergeTaskAction.TaskImpl createTask(IntegrateSetting s)
           
protected  java.lang.String decidePage()
          Which page to render?
 void doCancelQueue(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Cancels an integration task in the queue, if any.
protected  hudson.security.ACL getACL()
           
 java.lang.String getDisplayName()
           
 java.lang.String getFingerprintKey()
          This is the md5 hash to keep track of where this change is integrated.
 java.lang.String getIconFileName()
           
 java.lang.Long getIntegratedRevision()
           
static hudson.model.Fingerprint getIntegrationFingerprint(hudson.scm.ChangeLogSet.Entry changeEntry)
          Checks if the given ChangeLogSet.Entry represents a commit from integration.
 java.io.File getLogFile()
           
 hudson.model.AbstractProject<?,?> getProject()
           
 hudson.scm.SubversionSCM.SvnInfo getSvnInfo()
          URL and revision to be integrated from this action.
 int getUpstreamBuildNumber()
          Gets the build number of the upstream where this integration is built.
 java.lang.String getUrlName()
           
 boolean isIntegrated()
           
 boolean isIntegrationAttempted()
           
 long perform(hudson.model.TaskListener listener, hudson.scm.SubversionSCM.SvnInfo src)
           
 
Methods inherited from class jenkins.plugins.svnmerge.AbstractSvnmergeTaskAction
doIndex, doPerform, getLog, getPermission, getProperty, performAsync
 
Methods inherited from class hudson.model.TaskAction
doClearError, doProgressiveHtml, doProgressiveLog, getSearchUrl, getWorkerThread, obtainLog
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

build

public final hudson.model.AbstractBuild<?,?> build
Constructor Detail

IntegrateAction

public IntegrateAction(hudson.model.AbstractBuild<?,?> build)
Method Detail

getIconFileName

public java.lang.String getIconFileName()
Specified by:
getIconFileName in interface hudson.model.Action

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject

getUrlName

public java.lang.String getUrlName()
Specified by:
getUrlName in interface hudson.model.Action

getProject

public hudson.model.AbstractProject<?,?> getProject()
Specified by:
getProject in class AbstractSvnmergeTaskAction<IntegrateSetting>

getACL

protected hudson.security.ACL getACL()
Specified by:
getACL in class hudson.model.TaskAction

isIntegrated

public boolean isIntegrated()

isIntegrationAttempted

public boolean isIntegrationAttempted()

getIntegratedRevision

public java.lang.Long getIntegratedRevision()

getLogFile

public java.io.File getLogFile()
Specified by:
getLogFile in class AbstractSvnmergeTaskAction<IntegrateSetting>

createTask

protected AbstractSvnmergeTaskAction.TaskImpl createTask(IntegrateSetting s)
                                                  throws java.io.IOException
Specified by:
createTask in class AbstractSvnmergeTaskAction<IntegrateSetting>
Throws:
java.io.IOException

createParams

protected IntegrateSetting createParams(org.kohsuke.stapler.StaplerRequest req)
                                 throws java.io.IOException
Specified by:
createParams in class AbstractSvnmergeTaskAction<IntegrateSetting>
Throws:
java.io.IOException

getSvnInfo

public hudson.scm.SubversionSCM.SvnInfo getSvnInfo()
URL and revision to be integrated from this action.


perform

public long perform(hudson.model.TaskListener listener,
                    hudson.scm.SubversionSCM.SvnInfo src)
             throws java.io.IOException,
                    java.lang.InterruptedException
Parameters:
src - We are taking this revision and merge it into the upstream.
Throws:
java.io.IOException
java.lang.InterruptedException

getUpstreamBuildNumber

public int getUpstreamBuildNumber()
                           throws java.io.IOException
Gets the build number of the upstream where this integration is built.

Since the relevant information might be already lost when this method is called, this code needs to be defensive.

Returns:
-1 if not integrated yet or this information is lost.
Throws:
java.io.IOException

getFingerprintKey

public java.lang.String getFingerprintKey()
This is the md5 hash to keep track of where this change is integrated.


doCancelQueue

public void doCancelQueue(org.kohsuke.stapler.StaplerRequest req,
                          org.kohsuke.stapler.StaplerResponse rsp)
                   throws java.io.IOException,
                          javax.servlet.ServletException
Cancels an integration task in the queue, if any.

Throws:
java.io.IOException
javax.servlet.ServletException

decidePage

protected java.lang.String decidePage()
Which page to render?

Specified by:
decidePage in class AbstractSvnmergeTaskAction<IntegrateSetting>

getIntegrationFingerprint

public static hudson.model.Fingerprint getIntegrationFingerprint(hudson.scm.ChangeLogSet.Entry changeEntry)
                                                          throws java.io.IOException
Checks if the given ChangeLogSet.Entry represents a commit from integration. If so, return its fingerprint. Otherwise null.

Throws:
java.io.IOException


Copyright © 2004-2011. All Rights Reserved.