Class XygeniConfiguration
- java.lang.Object
-
- hudson.model.Descriptor<GlobalConfiguration>
-
- jenkins.model.GlobalConfiguration
-
- io.jenkins.plugins.xygeni.configuration.XygeniConfiguration
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<GlobalConfiguration>
,Saveable
,OnMaster
@Extension public class XygeniConfiguration extends GlobalConfiguration
Global configuration of Xygeni Plugin.Xygeni Plugin require Xygeni Api url (use cloud production by default), and a Xygeni Api Token generate by customer administrator to connect to Xygeni api.
Xygeni Api Token should be saved as credential secret at Jenkins instance and pass here as secret-id.
- Author:
- Victor de la Rosa
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Constructor Description XygeniConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json)
FormValidation
doCheckXygeniToken(String value)
Check if field is not emptyFormValidation
doCheckXygeniUrl(String value)
Check if field is not emptyFormValidation
doTestXygeniConnection(String xygeniTokenSecretIdField, String xygeniUrlField)
Check if current configuration allow to connect to Xygeni platform.static XygeniConfiguration
get()
String
getVersion()
Secret
getXygeniToken()
Read token from credential and return aSecret
String
getXygeniTokenSecretId()
String
getXygeniUrl()
boolean
isEmitBuildEvents()
boolean
isEmitComputerEvents()
boolean
isEmitConfigEvents()
boolean
isEmitItemEvents()
boolean
isEmitScmEvents()
void
save()
void
setXygeniTokenSecretId(String xygeniTokenSecret)
Together withgetXygeniTokenSecretId()
, binds to entry inconfig.jelly
.void
setXygeniUrl(String xygeniUrl)
Together withgetXygeniUrl()
, binds to entry inconfig.jelly
.-
Methods inherited from class jenkins.model.GlobalConfiguration
all, getDescriptor, getGlobalConfigPage
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, self, toArray, toList, toMap
-
-
-
-
Method Detail
-
get
public static XygeniConfiguration get()
- Returns:
- the singleton instance
-
getVersion
public String getVersion()
-
getXygeniTokenSecretId
public String getXygeniTokenSecretId()
- Returns:
- the currently field value, if any
-
setXygeniTokenSecretId
@DataBoundSetter public void setXygeniTokenSecretId(String xygeniTokenSecret)
Together withgetXygeniTokenSecretId()
, binds to entry inconfig.jelly
.- Parameters:
xygeniTokenSecret
- the new value of this field
-
getXygeniUrl
public String getXygeniUrl()
- Returns:
- the currently configured label, if any
-
setXygeniUrl
@DataBoundSetter public void setXygeniUrl(String xygeniUrl)
Together withgetXygeniUrl()
, binds to entry inconfig.jelly
.- Parameters:
xygeniUrl
- the new value of this field
-
doCheckXygeniToken
public FormValidation doCheckXygeniToken(@QueryParameter String value)
Check if field is not empty- Parameters:
value
- form field value- Returns:
- FormValidation ok if not empty or warning message
-
doCheckXygeniUrl
public FormValidation doCheckXygeniUrl(@QueryParameter String value)
Check if field is not empty- Parameters:
value
- form field value- Returns:
- FormValidation ok if not empty or warning message
-
doTestXygeniConnection
public FormValidation doTestXygeniConnection(@QueryParameter("xygeniTokenSecretId") String xygeniTokenSecretIdField, @QueryParameter("xygeniUrl") String xygeniUrlField)
Check if current configuration allow to connect to Xygeni platform.- Parameters:
xygeniTokenSecretIdField
- tokenSecret field valuexygeniUrlField
- xygeniurl field value- Returns:
- FormValidation ok if connect could be establish and token is valid
-
getXygeniToken
public Secret getXygeniToken()
Read token from credential and return aSecret
- Returns:
- a Secret
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) throws Descriptor.FormException
- Overrides:
configure
in classGlobalConfiguration
- Throws:
Descriptor.FormException
-
save
public void save()
- Specified by:
save
in interfaceSaveable
- Overrides:
save
in classDescriptor<GlobalConfiguration>
-
isEmitConfigEvents
public boolean isEmitConfigEvents()
-
isEmitComputerEvents
public boolean isEmitComputerEvents()
-
isEmitItemEvents
public boolean isEmitItemEvents()
-
isEmitBuildEvents
public boolean isEmitBuildEvents()
-
isEmitScmEvents
public boolean isEmitScmEvents()
-
-