Package com.sonyericsson.rebuild
Class RebuildAction
- java.lang.Object
-
- com.sonyericsson.rebuild.AbstractRebuildAction
-
- com.sonyericsson.rebuild.RebuildAction
-
- All Implemented Interfaces:
Action
,ModelObject
,RunAction2
public class RebuildAction extends AbstractRebuildAction implements RunAction2
Rebuild RootAction implementation class. This class will basically reschedule the build with existing parameters.- Author:
- Shemeer S;
-
-
Field Summary
Fields Modifier and Type Field Description static RebuildDescriptor
DESCRIPTOR
Rebuild Descriptor.
-
Constructor Summary
Constructors Constructor Description RebuildAction(Run<?,?> run)
RebuildAction constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Saves the form to the configuration and disk.void
doIndex(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
Handles the rebuild request and redirects to parameterized and non parameterized build when needed.String
getDisplayName()
ParameterValue
getParameterValue(ParametersDefinitionProperty paramDefProp, String parameterName, ParametersAction paramAction, org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject jo)
Method for getting the ParameterValue instance from ParameterDefinition or ParamterAction.Job<?,?>
getProject()
Method will return current project.RebuildParameterPage
getRebuildParameterPage(ParameterValue value)
Run<?,?>
getRun()
String
getTaskUrl()
DecouplegetUrlName()
from the actual URL, otherwise we cannot customize the target.String
getUrlName()
boolean
isRememberPasswordEnabled()
True if the password fields should be pre-filled.boolean
isRequiresPOST()
void
nonParameterizedRebuild(Run currentBuild, org.kohsuke.stapler.StaplerResponse response)
Call this method while rebuilding non parameterized build.void
onAttached(Run<?,?> r)
void
onLoad(Run<?,?> r)
void
parameterizedRebuild(Run currentBuild, org.kohsuke.stapler.StaplerResponse response)
Handles the rebuild request with parameter.-
Methods inherited from class com.sonyericsson.rebuild.AbstractRebuildAction
getIconFileName, isMatrixRun, isRebuildAvailable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.model.Action
getIconFileName
-
-
-
-
Field Detail
-
DESCRIPTOR
@Extension public static final RebuildDescriptor DESCRIPTOR
Rebuild Descriptor.
-
-
Constructor Detail
-
RebuildAction
public RebuildAction(Run<?,?> run)
RebuildAction constructor.
-
-
Method Detail
-
isRememberPasswordEnabled
public boolean isRememberPasswordEnabled()
True if the password fields should be pre-filled.- Returns:
- True if the password fields should be pre-filled.
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
-
getRun
public Run<?,?> getRun()
- Specified by:
getRun
in classAbstractRebuildAction
-
getTaskUrl
public String getTaskUrl()
DecouplegetUrlName()
from the actual URL, otherwise we cannot customize the target.- Specified by:
getTaskUrl
in classAbstractRebuildAction
- Returns:
-
getProject
public Job<?,?> getProject()
Description copied from class:AbstractRebuildAction
Method will return current project.- Specified by:
getProject
in classAbstractRebuildAction
- Returns:
- currentProject.
-
isRequiresPOST
public boolean isRequiresPOST()
- Specified by:
isRequiresPOST
in classAbstractRebuildAction
-
doIndex
public void doIndex(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws IOException
Handles the rebuild request and redirects to parameterized and non parameterized build when needed.- Parameters:
request
- StaplerRequest the request.response
- StaplerResponse the response handler.- Throws:
IOException
- in case of Stapler issues
-
parameterizedRebuild
public void parameterizedRebuild(Run currentBuild, org.kohsuke.stapler.StaplerResponse response) throws IOException
Handles the rebuild request with parameter.- Parameters:
currentBuild
- the build.response
- StaplerResponse the response handler.- Throws:
IOException
- in case of Stapler issues
-
nonParameterizedRebuild
public void nonParameterizedRebuild(Run currentBuild, org.kohsuke.stapler.StaplerResponse response) throws IOException
Call this method while rebuilding non parameterized build. .- Parameters:
currentBuild
- current build.response
- current response object.- Throws:
IOException
- if something unfortunate happens.
-
doConfigSubmit
public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException
Saves the form to the configuration and disk.- Parameters:
req
- StaplerRequestrsp
- StaplerResponse- Throws:
javax.servlet.ServletException
- if something unfortunate happens.IOException
- if something unfortunate happens.
-
getParameterValue
public ParameterValue getParameterValue(ParametersDefinitionProperty paramDefProp, String parameterName, ParametersAction paramAction, org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject jo)
Method for getting the ParameterValue instance from ParameterDefinition or ParamterAction.- Parameters:
paramDefProp
- ParametersDefinitionPropertyparameterName
- Name of the Parameter.paramAction
- ParametersActionreq
- StaplerRequestjo
- JSONObject- Returns:
- ParameterValue instance of subclass of ParameterValue
-
getRebuildParameterPage
public RebuildParameterPage getRebuildParameterPage(ParameterValue value)
- Parameters:
value
- the parameter value to show to rebuild.- Returns:
- page for the parameter value, or null if no suitable option found.
-
onAttached
public void onAttached(Run<?,?> r)
- Specified by:
onAttached
in interfaceRunAction2
-
onLoad
public void onLoad(Run<?,?> r)
- Specified by:
onLoad
in interfaceRunAction2
-
-