Class ManualCondition
- java.lang.Object
-
- hudson.plugins.promoted_builds.PromotionCondition
-
- hudson.plugins.promoted_builds.conditions.ManualCondition
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<PromotionCondition>
- Direct Known Subclasses:
JobDslManualCondition
public class ManualCondition extends PromotionCondition
PromotionCondition
that requires manual promotion.- Author:
- Kohsuke Kawaguchi, Peter Hayes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ManualCondition.Badge
static class
ManualCondition.DescriptorImpl
static class
ManualCondition.ManualApproval
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static String
MISSING_USER_ID_DISPLAY_STRING
-
Constructor Summary
Constructors Constructor Description ManualCondition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Future<Promotion>
approve(AbstractBuild<?,?> build, PromotionProcess promotionProcess)
Future<Promotion>
approve(AbstractBuild<?,?> build, PromotionProcess promotionProcess, List<ParameterValue> paramValues)
boolean
canApprove(PromotionProcess promotionProcess, AbstractBuild<?,?> build)
Verifies that the currently logged in user (or anonymous) has permission to approve the promotion and that the promotion has not already been approved.List<ParameterValue>
createDefaultValues()
void
doApprove(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, PromotionProcess promotionProcess, AbstractBuild<?,?> build)
Web method to handle the approval action submitted by the user.ParameterDefinition
getParameterDefinition(String name)
Gets theParameterDefinition
of the given name, if any.List<ParameterDefinition>
getParameterDefinitions()
String
getUsers()
Set<String>
getUsersAsSet()
boolean
isInGroupList()
boolean
isInUsersList()
PromotionBadge
isMet(PromotionProcess promotionProcess, AbstractBuild<?,?> build)
Checks if the promotion criteria is met.void
setUsers(String users)
-
Methods inherited from class hudson.plugins.promoted_builds.PromotionCondition
all, getApplicableTriggers, getDescriptor, isMet
-
-
-
-
Field Detail
-
MISSING_USER_ID_DISPLAY_STRING
public static final String MISSING_USER_ID_DISPLAY_STRING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUsers
public String getUsers()
-
setUsers
public void setUsers(String users)
-
getParameterDefinitions
public List<ParameterDefinition> getParameterDefinitions()
-
getParameterDefinition
@CheckForNull public ParameterDefinition getParameterDefinition(String name)
Gets theParameterDefinition
of the given name, if any.
-
isMet
public PromotionBadge isMet(PromotionProcess promotionProcess, AbstractBuild<?,?> build)
Description copied from class:PromotionCondition
Checks if the promotion criteria is met.- Overrides:
isMet
in classPromotionCondition
- Parameters:
promotionProcess
- The promotion process being evaluated for qualificationbuild
- The build for which the promotion is considered.- Returns:
- non-null if the promotion condition is met. This object is then recorded so that we know how a build was promoted. Null if otherwise, meaning it shouldn't be promoted.
-
canApprove
public boolean canApprove(PromotionProcess promotionProcess, AbstractBuild<?,?> build)
Verifies that the currently logged in user (or anonymous) has permission to approve the promotion and that the promotion has not already been approved.
-
isInUsersList
public boolean isInUsersList()
-
isInGroupList
public boolean isInGroupList()
-
approve
@CheckForNull public Future<Promotion> approve(AbstractBuild<?,?> build, PromotionProcess promotionProcess, List<ParameterValue> paramValues) throws IOException
- Throws:
IOException
-
createDefaultValues
public List<ParameterValue> createDefaultValues()
-
approve
public Future<Promotion> approve(AbstractBuild<?,?> build, PromotionProcess promotionProcess) throws IOException
- Throws:
IOException
-
doApprove
@POST public void doApprove(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @AncestorInPath PromotionProcess promotionProcess, @AncestorInPath AbstractBuild<?,?> build) throws IOException, javax.servlet.ServletException
Web method to handle the approval action submitted by the user.- Throws:
IOException
javax.servlet.ServletException
-
-