hudson.maven.reporters
Class MavenAbstractArtifactRecord<T extends AbstractBuild<?,?>>

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.TaskAction
          extended by hudson.maven.reporters.MavenAbstractArtifactRecord<T>
All Implemented Interfaces:
Action, BuildBadgeAction, ModelObject, SearchableModelObject, SearchItem
Direct Known Subclasses:
MavenAggregatedArtifactRecord, MavenArtifactRecord

public abstract class MavenAbstractArtifactRecord<T extends AbstractBuild<?,?>>
extends TaskAction
implements BuildBadgeAction

UI to redeploy artifacts after the fact.

There are two types — one for the module, the other for the whole project. The semantics specific to these cases are defined in subtypes.

Author:
Kohsuke Kawaguchi

Nested Class Summary
 class MavenAbstractArtifactRecord.Record
           
 
Field Summary
static boolean debug
          Debug probe for HUDSON-1461.
 CopyOnWriteArrayList<MavenAbstractArtifactRecord.Record> records
          Records of a deployment.
static Permission REDEPLOY
          Permission for redeploying artifacts.
 
Fields inherited from class hudson.model.TaskAction
log, workerThread
 
Constructor Summary
MavenAbstractArtifactRecord()
           
 
Method Summary
abstract  void deploy(hudson.maven.MavenEmbedder embedder, org.apache.maven.artifact.repository.ArtifactRepository deploymentRepository, TaskListener listener)
          Deploys the artifacts to the specified ArtifactRepository.
 org.kohsuke.stapler.HttpResponse doRedeploy(String id, String repositoryUrl, boolean uniqueVersion)
          Performs a redeployment.
protected  ACL getACL()
          Gets the ACL against which the permissions are checked.
 Api getApi()
           
abstract  T getBuild()
          Gets the parent build object to which this record is registered.
 String getDisplayName()
          Gets the string to be displayed.
 Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 hudson.maven.reporters.MavenAbstractArtifactRecord.HistoryWidgetImpl getHistoryWidget()
           
 String getIconFileName()
          Gets the file name of the icon.
protected  Permission getPermission()
          Gets the permission object that represents the permission to perform this task.
 String getUrlName()
          Gets the URL path name.
 boolean hasBadge()
           
 
Methods inherited from class hudson.model.TaskAction
doClearError, doProgressiveHtml, doProgressiveLog, getLog, 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

records

@Exported
public final CopyOnWriteArrayList<MavenAbstractArtifactRecord.Record> records
Records of a deployment.


REDEPLOY

public static final Permission REDEPLOY
Permission for redeploying artifacts.


debug

public static boolean debug
Debug probe for HUDSON-1461.

Constructor Detail

MavenAbstractArtifactRecord

public MavenAbstractArtifactRecord()
Method Detail

getBuild

public abstract T getBuild()
Gets the parent build object to which this record is registered.


getACL

protected ACL getACL()
Description copied from class: TaskAction
Gets the ACL against which the permissions are checked.

Specified by:
getACL in class TaskAction

getIconFileName

public final String getIconFileName()
Description copied from interface: Action
Gets the file name of the icon.

Specified by:
getIconFileName in interface Action
Returns:
If just a file name (like "abc.gif") is returned, it will be interpreted as a file name inside /images/24x24. This is useful for using one of the stock images.

If an absolute file name that starts from '/' is returned (like "/plugin/foo/abc.gif'), then it will be interpreted as a path from the context root of Jenkins. This is useful to pick up image files from a plugin.

Finally, return null to hide it from the task list. This is normally not very useful, but this can be used for actions that only contribute floatBox.jelly and no task list item. The other case where this is useful is to avoid showing links that require a privilege when the user is anonymous.

See Also:
Functions.isAnonymous(), Functions.getIconFilePath(Action)

getDisplayName

public final String getDisplayName()
Description copied from interface: Action
Gets the string to be displayed. The convention is to capitalize the first letter of each word, such as "Test Result".

Specified by:
getDisplayName in interface Action
Specified by:
getDisplayName in interface ModelObject

getUrlName

public final String getUrlName()
Description copied from interface: Action
Gets the URL path name.

tions For example, if this method returns "xyz", and if the parent object (that this action is associated with) is bound to /foo/bar/zot, then this action object will be exposed to /foo/bar/zot/xyz.

This method should return a string that's unique among other Actions.

The returned string can be an absolute URL, like "http://www.sun.com/", which is useful for directly connecting to external systems.

If the returned string starts with '/', like '/foo', then it's assumed to be relative to the context path of the Jenkins webapp.

Specified by:
getUrlName in interface Action
Returns:
null if this action object doesn't need to be bound to web (when you do that, be sure to also return null from Action.getIconFileName().
See Also:
Functions.getActionUrl(String, Action)

getPermission

protected Permission getPermission()
Description copied from class: TaskAction
Gets the permission object that represents the permission to perform this task.

Specified by:
getPermission in class TaskAction

getApi

public Api getApi()

hasBadge

public boolean hasBadge()

getHistoryWidget

public hudson.maven.reporters.MavenAbstractArtifactRecord.HistoryWidgetImpl getHistoryWidget()

getDynamic

public Object getDynamic(String token,
                         org.kohsuke.stapler.StaplerRequest req,
                         org.kohsuke.stapler.StaplerResponse rsp)

doRedeploy

public final org.kohsuke.stapler.HttpResponse doRedeploy(@QueryParameter(value="_.id")
                                                         String id,
                                                         @QueryParameter(value="_.url")
                                                         String repositoryUrl,
                                                         @QueryParameter(value="_.uniqueVersion")
                                                         boolean uniqueVersion)
                                                  throws javax.servlet.ServletException,
                                                         IOException
Performs a redeployment.

Throws:
javax.servlet.ServletException
IOException

deploy

public abstract void deploy(hudson.maven.MavenEmbedder embedder,
                            org.apache.maven.artifact.repository.ArtifactRepository deploymentRepository,
                            TaskListener listener)
                     throws hudson.maven.MavenEmbedderException,
                            IOException,
                            org.codehaus.plexus.component.repository.exception.ComponentLookupException,
                            org.apache.maven.artifact.deployer.ArtifactDeploymentException
Deploys the artifacts to the specified ArtifactRepository.

Parameters:
embedder - This component hosts all the Maven components we need to do the work.
deploymentRepository - The remote repository to deploy to.
listener - The status and error goes to this listener.
Throws:
hudson.maven.MavenEmbedderException
IOException
org.codehaus.plexus.component.repository.exception.ComponentLookupException
org.apache.maven.artifact.deployer.ArtifactDeploymentException


Copyright © 2004-2013. All Rights Reserved.