Class ScanOnDemandBaseAction
java.lang.Object
com.sonyericsson.jenkins.plugins.bfa.sod.ScanOnDemandBaseAction
- All Implemented Interfaces:
Action
,ModelObject
Action class for scanning non scanned build.
- Author:
- Shemeer Sulaiman <shemeer.x.sulaiman@sonymobile.com>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ScanMode that re-scans all builds regardless if they have been scanned before or not.static class
ScanMode that scans only previously non scanned builds.static class
Represents the different scan modes that can be used to re-scan the builds of a Job. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks if the current user hasItem.CONFIGURE
orItem.BUILD
permission.void
doPerformScan
(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) Shortcut method togetDefault()
.ScanOnDemandBaseAction.ScanMode.doPerformScan(ScanOnDemandBaseAction, StaplerRequest, StaplerResponse)
If the user clicks on scan on the default scanmode page.Finds the user's defaultScanOnDemandBaseAction.ScanMode
.getDynamic
(String url) Stapler function to enable 'scan-on-demand/all' etc.Finds the mode with the provided url as returned byScanOnDemandBaseAction.ScanMode.getUrlName()
.final Job<?,
?> Returns the project.boolean
Checks if the current user hasItem.CONFIGURE
orItem.BUILD
permission.void
removeRunActions
(hudson.matrix.MatrixBuild build) Method for remove matrix run actions.
-
Constructor Details
-
ScanOnDemandBaseAction
SODBaseAction constructor.- Parameters:
project
- current project.
-
-
Method Details
-
getIconFileName
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
- Specified by:
getUrlName
in interfaceAction
-
hasPermission
public boolean hasPermission()Checks if the current user hasItem.CONFIGURE
orItem.BUILD
permission.- Returns:
- true if so.
-
checkPermission
public void checkPermission()Checks if the current user hasItem.CONFIGURE
orItem.BUILD
permission. -
getProject
Returns the project.- Returns:
- project
-
removeRunActions
public void removeRunActions(hudson.matrix.MatrixBuild build) Method for remove matrix run actions.- Parameters:
build
- the MatrixBuild.
-
doPerformScan
public void doPerformScan(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws javax.servlet.ServletException, InterruptedException, IOException Shortcut method togetDefault()
.ScanOnDemandBaseAction.ScanMode.doPerformScan(ScanOnDemandBaseAction, StaplerRequest, StaplerResponse)
If the user clicks on scan on the default scanmode page.- Parameters:
request
- the requestresponse
- the response- Throws:
javax.servlet.ServletException
- if soInterruptedException
- if soIOException
- if so
-
getDefault
Finds the user's defaultScanOnDemandBaseAction.ScanMode
. If no selection is found in the session, or not in the request scope thenScanOnDemandBaseAction.NonScanned
is returned.- Returns:
- the default mode.
-
getDynamic
Stapler function to enable 'scan-on-demand/all' etc.- Parameters:
url
- the scan mode- Returns:
- most likely a
ScanOnDemandBaseAction.ScanMode
-
getMode
Finds the mode with the provided url as returned byScanOnDemandBaseAction.ScanMode.getUrlName()
.- Parameters:
url
- the url to match- Returns:
- the scan mode or null if no matching scan mode is found.
-