Class ScanOnDemandBaseAction
- java.lang.Object
-
- com.sonyericsson.jenkins.plugins.bfa.sod.ScanOnDemandBaseAction
-
- All Implemented Interfaces:
Action
,ModelObject
public class ScanOnDemandBaseAction extends Object implements Action
Action class for scanning non scanned build.- Author:
- Shemeer Sulaiman <shemeer.x.sulaiman@sonymobile.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ScanOnDemandBaseAction.AllBuilds
ScanMode that re-scans all builds regardless if they have been scanned before or not.static class
ScanOnDemandBaseAction.NonScanned
ScanMode that scans only previously non scanned builds.static class
ScanOnDemandBaseAction.ScanMode
Represents the different scan modes that can be used to re-scan the builds of a Job.
-
Constructor Summary
Constructors Constructor Description ScanOnDemandBaseAction(Job project)
SODBaseAction constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkPermission()
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.ScanOnDemandBaseAction.ScanMode
getDefault()
Finds the user's defaultScanOnDemandBaseAction.ScanMode
.String
getDisplayName()
Object
getDynamic(String url)
Stapler function to enable 'scan-on-demand/all' etc.String
getIconFileName()
ScanOnDemandBaseAction.ScanMode
getMode(String url)
Finds the mode with the provided url as returned byScanOnDemandBaseAction.ScanMode.getUrlName()
.Job<?,?>
getProject()
Returns the project.String
getUrlName()
boolean
hasPermission()
Checks if the current user hasItem.CONFIGURE
orItem.BUILD
permission.void
removeRunActions(hudson.matrix.MatrixBuild build)
Method for remove matrix run actions.
-
-
-
Constructor Detail
-
ScanOnDemandBaseAction
public ScanOnDemandBaseAction(Job project)
SODBaseAction constructor.- Parameters:
project
- current project.
-
-
Method Detail
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
public String 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
public final Job<?,?> 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
public ScanOnDemandBaseAction.ScanMode 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
public Object getDynamic(String url)
Stapler function to enable 'scan-on-demand/all' etc.- Parameters:
url
- the scan mode- Returns:
- most likely a
ScanOnDemandBaseAction.ScanMode
-
getMode
public ScanOnDemandBaseAction.ScanMode getMode(String url)
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.
-
-