public class PersistentPackageParameterDefinition
extends hudson.model.SimpleParameterDefinition
Modifier and Type | Class and Description |
---|---|
static class |
PersistentPackageParameterDefinition.DescriptorImpl
The descriptor for outlining the behavior of the config panel.
|
Constructor and Description |
---|
PersistentPackageParameterDefinition(String name,
String description,
boolean useAwsKeys,
String awsAccessKeyId,
String awsSecretAccessKey,
String bucketName,
String repoPath,
String repositoryType)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
static boolean |
areValidChoices(String choices)
Allows us to validate the choices.
|
hudson.model.ParameterValue |
createValue(org.kohsuke.stapler.StaplerRequest req,
net.sf.json.JSONObject jo)
Create a parameter value from a form submission.
|
hudson.model.ParameterValue |
createValue(String value)
Creates a
ParameterValue from the string representation. |
String |
getAwsAccessKeyId()
Parameter for retrieving the value in the config form
|
String |
getAwsSecretAccessKey()
Parameter for retrieving the value in the config form
|
String |
getBucketName()
Parameter for retrieving the value in the config form
|
Map<String,String> |
getChoices()
Returns the choices for the drop down.
|
String |
getRepoPath()
Parameter for retrieving the value in the config form
|
boolean |
isUseAwsKeys()
Parameter for retrieving the value in the config form
|
@DataBoundConstructor public PersistentPackageParameterDefinition(String name, String description, boolean useAwsKeys, String awsAccessKeyId, String awsSecretAccessKey, String bucketName, String repoPath, String repositoryType)
name
- the name of the parameter. This will passed to the build as a variabledescription
- what is the description that the user has supplied for the parameteruseAwsKeys
- the boolean flag, that tells us if we need to supply authentication when calling S3.awsAccessKeyId
- the access key, if required.awsSecretAccessKey
- the secret access key, if required.bucketName
- the name of the S3 bucket where the repo is hosted.repoPath
- the path to target the S3 repo.repositoryType
- the type of repository that will be used to retrive the packages from. APT or Yum.public static boolean areValidChoices(String choices)
choices
- to be validatedpublic hudson.model.ParameterValue createValue(String value)
ParameterValue
from the string representation.createValue
in class hudson.model.SimpleParameterDefinition
value
- the value of the parameter to be usedpublic hudson.model.ParameterValue createValue(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject jo)
createValue
in class hudson.model.ParameterDefinition
req
- the StaplerRequest
when the user saves values for the parameterjo
- the JSONObject
containing the values for the parameter@Exported public Map<String,String> getChoices() throws JAXBException, IOException
Map
of options to be displayed to the user when building with parameters.JAXBException
- if unable to unmarshal the dataIOException
- if we're unable to open the stream for whatever reason. This could be that the AWS S3 request
failed for other reasons too.public boolean isUseAwsKeys()
public String getAwsAccessKeyId()
public String getAwsSecretAccessKey()
public String getBucketName()
public String getRepoPath()
Copyright © 2004-2015. All Rights Reserved.