Package io.jenkins.plugins.explain_error
Class GlobalConfigurationImpl
java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
io.jenkins.plugins.explain_error.GlobalConfigurationImpl
- All Implemented Interfaces:
ExtensionPoint
,Describable<GlobalConfiguration>
,Saveable
,Loadable
,OnMaster
Global configuration for the plugin.
-
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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
configure
(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) Populate the provider dropdown items for the UI.doTestConfiguration
(String apiKey, String provider, String apiUrl, String model) Method to test the AI API configuration.static GlobalConfigurationImpl
get()
Get the singleton instance of GlobalConfigurationImpl.getModel()
Get all available AI providers for the dropdown.Get the raw configured API URL without defaults, used for validation.Get the raw configured model without defaults, used for validation.boolean
void
void
void
setEnableExplanation
(boolean enableExplanation) void
void
setProvider
(AIProvider provider) Methods inherited from class jenkins.model.GlobalConfiguration
all, configure, getDescriptor, getGlobalConfigPage
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
GlobalConfigurationImpl
public GlobalConfigurationImpl()
-
-
Method Details
-
get
Get the singleton instance of GlobalConfigurationImpl.- Returns:
- the GlobalConfigurationImpl instance
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) throws Descriptor.FormException - Overrides:
configure
in classGlobalConfiguration
- Throws:
Descriptor.FormException
-
getApiKey
-
setApiKey
-
getProvider
-
setProvider
-
getApiUrl
-
getRawApiUrl
Get the raw configured API URL without defaults, used for validation. -
setApiUrl
-
getModel
-
getRawModel
Get the raw configured model without defaults, used for validation. -
setModel
-
isEnableExplanation
public boolean isEnableExplanation() -
setEnableExplanation
@DataBoundSetter public void setEnableExplanation(boolean enableExplanation) -
getDisplayName
- Overrides:
getDisplayName
in classDescriptor<GlobalConfiguration>
-
getProviderValues
Get all available AI providers for the dropdown. -
doFillProviderItems
Populate the provider dropdown items for the UI. -
doTestConfiguration
public FormValidation doTestConfiguration(@QueryParameter("apiKey") String apiKey, @QueryParameter("provider") String provider, @QueryParameter("apiUrl") String apiUrl, @QueryParameter("model") String model) Method to test the AI API configuration. This is called when the "Test Configuration" button is clicked.
-