com.sonyericsson.jenkins.plugins.bfa.sod
Class ScanOnDemandBaseAction

java.lang.Object
  extended by com.sonyericsson.jenkins.plugins.bfa.sod.ScanOnDemandBaseAction
All Implemented Interfaces:
hudson.model.Action, hudson.model.ModelObject

public class ScanOnDemandBaseAction
extends Object
implements hudson.model.Action

Action class for scanning non scanned build.

Author:
Shemeer Sulaiman <shemeer.x.sulaiman@sonymobile.com>

Field Summary
static String NON_SCANNED
          nonscanned build constant.
static String PLUGIN_JS_URL
          javascript file location.
 
Constructor Summary
ScanOnDemandBaseAction(hudson.model.AbstractProject project)
          SODBaseAction constructor.
 
Method Summary
 void checkPermission()
          Checks if the current user has Item.CONFIGURE or Item.BUILD permission.
 void doPerformScan(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Submit method for running build scan.
 void doSelectBuildType(String scanTarget, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Select buildType.
 List<hudson.model.AbstractBuild> getAllBuilds()
          Method for finding all failed builds.
 List<hudson.model.AbstractBuild> getBuilds()
          Method for returning builds as per buildtype.
 List<hudson.model.AbstractBuild> getBuilds(String scanTarget)
          This method will set the buildType while calling getBuilds from index.jelly.
 String getBuildType()
          Returns the buildType.
 String getDisplayName()
           
 String getIconFileName()
           
 String getJsUrl(String jsName)
          Gets the full path to the provided javascript file.
 List<hudson.model.AbstractBuild> getNotScannedBuilds()
          Method for finding sodbuilds.
 hudson.model.AbstractProject<?,?> getProject()
          Returns the project.
 String getUrlName()
           
 boolean hasPermission()
          Checks if the current user has Item.CONFIGURE or Item.BUILD permission.
 void removeRunActions(hudson.matrix.MatrixBuild build)
          Method for remove matrix run actions.
 void setBuildType(String buildType)
          Set buildType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLUGIN_JS_URL

public static final String PLUGIN_JS_URL
javascript file location.

See Also:
Constant Field Values

NON_SCANNED

public static final String NON_SCANNED
nonscanned build constant.

See Also:
Constant Field Values
Constructor Detail

ScanOnDemandBaseAction

public ScanOnDemandBaseAction(hudson.model.AbstractProject project)
SODBaseAction constructor.

Parameters:
project - current project.
Method Detail

getJsUrl

public String getJsUrl(String jsName)
Gets the full path to the provided javascript file. For use by jelly files to give to the client browser.

Parameters:
jsName - the javascript filename.
Returns:
the full path from the web-context root.

getIconFileName

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

getDisplayName

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

getUrlName

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

hasPermission

public boolean hasPermission()
Checks if the current user has Item.CONFIGURE or Item.BUILD permission.

Returns:
true if so.

checkPermission

public void checkPermission()
Checks if the current user has Item.CONFIGURE or Item.BUILD permission.

See Also:
hasPermission(), ACL.checkPermission(hudson.security.Permission)

getProject

public final hudson.model.AbstractProject<?,?> getProject()
Returns the project.

Returns:
project

getAllBuilds

public List<hudson.model.AbstractBuild> getAllBuilds()
Method for finding all failed builds.

Returns:
sodbuilds.

getBuilds

public List<hudson.model.AbstractBuild> getBuilds(String scanTarget)
This method will set the buildType while calling getBuilds from index.jelly.

Parameters:
scanTarget - String.
Returns:
builds.

getBuilds

public List<hudson.model.AbstractBuild> getBuilds()
Method for returning builds as per buildtype.

Returns:
builds.

getNotScannedBuilds

public List<hudson.model.AbstractBuild> getNotScannedBuilds()
Method for finding sodbuilds.

Returns:
sodbuilds.

removeRunActions

public void removeRunActions(hudson.matrix.MatrixBuild build)
Method for remove matrix run actions.

Parameters:
build - AbstractBuild.

doPerformScan

public void doPerformScan(org.kohsuke.stapler.StaplerRequest request,
                          org.kohsuke.stapler.StaplerResponse response)
                   throws javax.servlet.ServletException,
                          IOException,
                          InterruptedException
Submit method for running build scan.

Parameters:
request - StaplerRequest
response - StaplerResponse
Throws:
javax.servlet.ServletException - if something unfortunate happens.
IOException - if something unfortunate happens.
InterruptedException - if something unfortunate happens.

getBuildType

public String getBuildType()
Returns the buildType.

Returns:
buildType String.

setBuildType

public void setBuildType(String buildType)
Set buildType.

Parameters:
buildType - String.

doSelectBuildType

public void doSelectBuildType(@QueryParameter(value="build")
                              String scanTarget,
                              org.kohsuke.stapler.StaplerRequest req,
                              org.kohsuke.stapler.StaplerResponse rsp)
                       throws javax.servlet.ServletException,
                              IOException,
                              InterruptedException
Select buildType.

Parameters:
scanTarget - QueryParameter.
req - StaplerRequest.
rsp - StaplerResponse.
Throws:
javax.servlet.ServletException - if something unfortunate happens.
IOException - if something unfortunate happens.
InterruptedException - if something unfortunate happens.


Copyright © 2004-2014. All Rights Reserved.