Class PluginImpl
java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
com.sonymobile.jenkins.plugins.kerberossso.PluginImpl
- All Implemented Interfaces:
ExtensionPoint
,Describable<GlobalConfiguration>
,Saveable
,Loadable
,OnMaster
@Extension
@Symbol("kerberosSso")
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class PluginImpl
extends GlobalConfiguration
The core of this Plugin. Handles the configuration of the
KerberosSSOFilter
It also starts / stops the filter at the user's request and data-binds to config.groovy.- Author:
- Joakim Ahle <joakim.ahle@sonymobile.com>
-
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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
configure
(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) When submit is pressed on the global config page and any settings for this plugin are changed, this method is called.Used by groovy for data-binding.boolean
Used by groovy for data-binding.protected XmlFile
boolean
Used by groovy for data-binding.static PluginImpl
Fetches the singleton instance of this plugin.Used by groovy for data-binding.Used by groovy for data-binding.Used by groovy for data-binding.Used by groovy for data-binding.Used by groovy for data-binding.Used by groovy for data-binding.boolean
Used by groovy for data-binding.boolean
Used by groovy for data-binding.boolean
Used by groovy for data-binding.boolean
Used by groovy for data-binding.boolean
Used by groovy for data-binding.boolean
Used by groovy for data-binding.boolean
Deprecated.Unusedvoid
setAccountName
(String accountName) Set accountName config parameter.void
setAllowBasic
(boolean allowBasic) Set allowBasic config parameter.void
setAllowDelegation
(boolean allowDelegation) Set allowDelegation config parameter.void
setAllowLocalhost
(boolean allowLocalhost) Set allowLocalhost config parameter.void
setAllowUnsecureBasic
(boolean allowUnsecureBasic) Set allowUnsecureBasic config parameter.void
setAnonymousAccess
(boolean anonymousAccess) Set login all URLs.void
setEnabled
(boolean enabled) Set enabled config parameter.void
setKrb5Location
(String krb5Location) Set krb5Location config parameter.void
setLoginClientModule
(String loginClientModule) Set loginClientModule config parameter.void
setLoginLocation
(String loginLocation) Set loginLocation config parameter.void
setLoginServerModule
(String loginServerModule) Set loginServerModule config parameter.void
setPassword
(Secret password) void
setPromptNtlm
(boolean promptNtlm) Set promptNtlm config parameter.void
setRedirect
(String redirect) Set redirect config parameter.void
setRedirectEnabled
(boolean redirectEnabled) Set redirectEnabled config parameter.static void
start()
Starts the plugin.static void
stop()
Stops this plugin and removes the filter from Jenkins.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, getCheckMethod, getCheckUrl, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, 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
-
Field Details
-
JCASC_NAME
- See Also:
-
-
Constructor Details
-
PluginImpl
public PluginImpl()
-
-
Method Details
-
getInstance
Fetches the singleton instance of this plugin.- Returns:
- the instance.
-
getCategory
- Overrides:
getCategory
in classDescriptor<GlobalConfiguration>
-
start
@Initializer(after=PLUGINS_STARTED) @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public static void start()Starts the plugin. Loads previous configuration if such exists. -
stop
@Terminator(after=COMPLETED) @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public static void stop()Stops this plugin and removes the filter from Jenkins. -
getConfigFile
- Overrides:
getConfigFile
in classDescriptor<GlobalConfiguration>
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) throws Descriptor.FormException When submit is pressed on the global config page and any settings for this plugin are changed, this method is called. It updates all the fields, restarts or stops the filter depending on configuration and saves the configuration to disk.- Overrides:
configure
in classGlobalConfiguration
- Parameters:
req
- the Stapler Request to serve.formData
- the JSON data containing the new configuration.- Throws:
Descriptor.FormException
- if any data in the form is wrong.
-
setEnabled
public void setEnabled(boolean enabled) Set enabled config parameter.- Parameters:
enabled
- value of enabled
-
setAccountName
Set accountName config parameter.- Parameters:
accountName
- value of accountName
-
setPassword
-
setRedirectEnabled
public void setRedirectEnabled(boolean redirectEnabled) Set redirectEnabled config parameter.- Parameters:
redirectEnabled
- value of redirectEnabled
-
setRedirect
Set redirect config parameter.- Parameters:
redirect
- value of redirect
-
setKrb5Location
Set krb5Location config parameter.- Parameters:
krb5Location
- value of krb5Location
-
setLoginLocation
Set loginLocation config parameter.- Parameters:
loginLocation
- value of loginLocation
-
setLoginServerModule
Set loginServerModule config parameter.- Parameters:
loginServerModule
- value of loginServerModule
-
setLoginClientModule
Set loginClientModule config parameter.- Parameters:
loginClientModule
- value of loginClientModule
-
setAllowLocalhost
public void setAllowLocalhost(boolean allowLocalhost) Set allowLocalhost config parameter.- Parameters:
allowLocalhost
- value of allowLocalhost
-
setAllowBasic
public void setAllowBasic(boolean allowBasic) Set allowBasic config parameter.- Parameters:
allowBasic
- value of allowBasic
-
setAllowDelegation
public void setAllowDelegation(boolean allowDelegation) Set allowDelegation config parameter.- Parameters:
allowDelegation
- value of allowDelegation
-
setAllowUnsecureBasic
public void setAllowUnsecureBasic(boolean allowUnsecureBasic) Set allowUnsecureBasic config parameter.- Parameters:
allowUnsecureBasic
- value of allowUnsecureBasic
-
setPromptNtlm
public void setPromptNtlm(boolean promptNtlm) Set promptNtlm config parameter.- Parameters:
promptNtlm
- value of promptNtlm
-
getEnabled
public boolean getEnabled()Used by groovy for data-binding.- Returns:
- whether the Filter is currently enabled or not.
-
getAccountName
Used by groovy for data-binding.- Returns:
- the current service / pre-auth account.
-
getPassword
Used by groovy for data-binding.- Returns:
- the current service / pre-auth password as a secret.
-
isRedirectEnabled
public boolean isRedirectEnabled()Used by groovy for data-binding.- Returns:
- whether the user has checked domain redirection or not.
-
getRedirect
Used by groovy for data-binding.- Returns:
- the current domain to redirect to, if redirect is enabled.
-
getKrb5Location
Used by groovy for data-binding.- Returns:
- the current location of the krb5.conf file.
-
getLoginLocation
Used by groovy for data-binding.- Returns:
- the current location of the login.conf file.
-
getLoginServerModule
Used by groovy for data-binding.- Returns:
- the current Login-server module.
-
getLoginClientModule
Used by groovy for data-binding.- Returns:
- the current Login-client module.
-
getAnonymousAccess
public boolean getAnonymousAccess()Used by groovy for data-binding.- Returns:
- whether the user needs to authenticate on non-login URLs.
-
setAnonymousAccess
public void setAnonymousAccess(boolean anonymousAccess) Set login all URLs.- Parameters:
anonymousAccess
- Permit anonymous access.
-
isAllowLocalhost
public boolean isAllowLocalhost()Used by groovy for data-binding.- Returns:
- whether Localhost should be allowed without authentication or not.
-
isAllowUnsecureBasic
public boolean isAllowUnsecureBasic()Used by groovy for data-binding.- Returns:
- whether unsecure basic should be used if Kerberos fails.
-
isPromptNtlm
public boolean isPromptNtlm()Used by groovy for data-binding.- Returns:
- whether NTLM users should be prompted to use basic authentication.
-
isAllowDelegation
public boolean isAllowDelegation()Used by groovy for data-binding.- Returns:
- whether servlet delegation should be used.
-
isAllowBasic
public boolean isAllowBasic()Used by groovy for data-binding.- Returns:
- whether Basic authentication should be used if Kerberos fails.
-
isRestartNeeded
Deprecated.UnusedUsed to determine if Jenkins have to be restarted for the config changes to take place.- Returns:
- whether Jenkins has to be restarted.
-