Class AuthorizeProjectProperty
- java.lang.Object
-
- hudson.model.JobProperty<Job<?,?>>
-
- org.jenkinsci.plugins.authorizeproject.AuthorizeProjectProperty
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<JobProperty<?>>
,ReconfigurableDescribable<JobProperty<?>>
,BuildStep
public class AuthorizeProjectProperty extends JobProperty<Job<?,?>>
Specifies how to authorize its builds.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AuthorizeProjectProperty.AuthorizationAction
The action that allows configuring a jobs authorization.static class
AuthorizeProjectProperty.DescriptorImpl
Descriptor forAuthorizeProjectProperty
.static class
AuthorizeProjectProperty.TransientActionFactoryImpl
The action factory responsible for adding theAuthorizeProjectProperty.AuthorizationAction
.-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.JobProperty
owner
-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description AuthorizeProjectProperty(AuthorizeProjectStrategy strategy)
Create a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Authentication
authenticate(Queue.Item item)
Return the authorization for a build.AuthorizeProjectStrategy
getEnabledStrategy()
Gets the strategy if enabled ornull
if not enabled.AuthorizeProjectStrategy
getStrategy()
Gets the strategy.JobProperty<?>
reconfigure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject form)
static void
setStrategyCritical()
Ensure that deserialization failures in this field result in a failure to deserialize the job.-
Methods inherited from class hudson.model.JobProperty
getDescriptor, getJobAction, getJobActions, getJobOverrides, getProjectAction, getProjectActions, getRequiredMonitorService, getSubTasks, perform, prebuild, setOwner
-
-
-
-
Constructor Detail
-
AuthorizeProjectProperty
@DataBoundConstructor public AuthorizeProjectProperty(AuthorizeProjectStrategy strategy)
Create a new instance.- Parameters:
strategy
- the strategy
-
-
Method Detail
-
getStrategy
public AuthorizeProjectStrategy getStrategy()
Gets the strategy.- Returns:
- the strategy.
-
getEnabledStrategy
@CheckForNull public AuthorizeProjectStrategy getEnabledStrategy()
Gets the strategy if enabled ornull
if not enabled.- Returns:
- strategy only when it's enabled.
null
otherwise.
-
authenticate
public Authentication authenticate(Queue.Item item)
Return the authorization for a build.- Parameters:
item
- the item in queue, which will be a build.- Returns:
- authorization for this build.
- See Also:
AuthorizeProjectStrategy.authenticate(hudson.model.Job, hudson.model.Queue.Item)
-
setStrategyCritical
@Initializer(after=PLUGINS_STARTED) public static void setStrategyCritical()
Ensure that deserialization failures in this field result in a failure to deserialize the job. This method is responsible for ensuring that POSTing config.xml respects the defined strategy.
-
reconfigure
public JobProperty<?> reconfigure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject form) throws Descriptor.FormException
- Specified by:
reconfigure
in interfaceReconfigurableDescribable<JobProperty<?>>
- Overrides:
reconfigure
in classJobProperty<Job<?,?>>
- Throws:
Descriptor.FormException
-
-