Package jenkins.install
Class SetupWizard
- java.lang.Object
-
- hudson.model.Descriptor<PageDecorator>
-
- hudson.model.PageDecorator
-
- jenkins.install.SetupWizard
-
- All Implemented Interfaces:
ExtensionPoint,Describable<PageDecorator>,Saveable,Loadable,OnMaster
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Extension public class SetupWizard extends PageDecorator
A Jenkins instance used during first-run to provide a limited set of services while initial installation is in progress- Since:
- 2.0
-
-
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 Modifier and Type Field Description static StringinitialSetupAdminUserNameThe security token parameter name-
Fields inherited from class hudson.model.PageDecorator
ALL
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Constructor Description SetupWizard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.kohsuke.stapler.HttpResponsedoCompleteInstall()Remove the setupWizard filter, ensure all updates are written to disk, etcorg.kohsuke.stapler.HttpResponsedoConfigureInstance(org.kohsuke.stapler.StaplerRequest req, String rootUrl)org.kohsuke.stapler.HttpResponsedoCreateAdminUser(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Called during the initial setup to create an admin userorg.kohsuke.stapler.HttpResponsedoPlatformPluginList()Returns the initial plugin list in JSON formatorg.kohsuke.stapler.HttpResponsedoRestartStatus()Returns whether the system needs a restart, and if it is supported e.g.VersionNumbergetCurrentLevel()What is the version the upgrade wizard has run the last time and upgraded to?.StringgetDisplayName()Human readable name of this kind of configurable object.FilePathgetInitialAdminApiTokenFile()Gets the file used to store the initial admin API Token, in case the system propertyADMIN_INITIAL_API_TOKENis set to "true" (and only in this case).FilePathgetInitialAdminPasswordFile()Gets the file used to store the initial admin passwordInstallStategetInstallState(String name)Returns an installState by nameList<InstallState>getInstallStates()Gets all the install statesnet.sf.json.JSONArraygetPlatformPluginUpdates()Provides the list of platform plugin updates from the last time the upgrade was run.booleanhasSetupWizardFilter()Returns whether the setup wizard filter is currently registered.booleanisUsingSecurityToken()Indicates a generated password should be used - e.g.voidonInstallStateUpdate(InstallState state)Called upon install state update.-
Methods inherited from class hudson.model.PageDecorator
all, getDescriptor, getUrl
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Field Detail
-
initialSetupAdminUserName
public static String initialSetupAdminUserName
The security token parameter name
-
-
Method Detail
-
getDisplayName
@NonNull public String getDisplayName()
Description copied from class:DescriptorHuman readable name of this kind of configurable object. Should be overridden for most descriptors, if the display name is visible somehow. As a fallback it usesClass.getSimpleName()onDescriptor.clazz, so for exampleMyThingfromsome.pkg.MyThing.DescriptorImpl. Historically some implementations returned null as a way of hiding the descriptor from the UI, but this is generally managed by an explicit method such asisEnabledorisApplicable.- Overrides:
getDisplayNamein classDescriptor<PageDecorator>
-
isUsingSecurityToken
public boolean isUsingSecurityToken()
Indicates a generated password should be used - e.g. this is a new install, no security realm set up
-
doCreateAdminUser
@POST @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.kohsuke.stapler.HttpResponse doCreateAdminUser(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOExceptionCalled during the initial setup to create an admin user- Throws:
IOException
-
doConfigureInstance
@POST @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.kohsuke.stapler.HttpResponse doConfigureInstance(org.kohsuke.stapler.StaplerRequest req, @QueryParameter String rootUrl)
-
getCurrentLevel
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @CheckForNull public VersionNumber getCurrentLevel()
What is the version the upgrade wizard has run the last time and upgraded to?. IfgetUpdateStateFile()is missing, presumes the baseline is 1.0- Returns:
- Current baseline.
nullif it cannot be retrieved.
-
doPlatformPluginList
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public org.kohsuke.stapler.HttpResponse doPlatformPluginList() throws IOExceptionReturns the initial plugin list in JSON format- Throws:
IOException
-
doRestartStatus
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public org.kohsuke.stapler.HttpResponse doRestartStatus() throws IOExceptionReturns whether the system needs a restart, and if it is supported e.g. { restartRequired: true, restartSupported: false }- Throws:
IOException
-
getPlatformPluginUpdates
@CheckForNull public net.sf.json.JSONArray getPlatformPluginUpdates()
Provides the list of platform plugin updates from the last time the upgrade was run.- Returns:
nullif the version range cannot be retrieved.
-
getInitialAdminPasswordFile
public FilePath getInitialAdminPasswordFile()
Gets the file used to store the initial admin password
-
getInitialAdminApiTokenFile
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public FilePath getInitialAdminApiTokenFile()
Gets the file used to store the initial admin API Token, in case the system propertyADMIN_INITIAL_API_TOKENis set to "true" (and only in this case).
-
doCompleteInstall
public org.kohsuke.stapler.HttpResponse doCompleteInstall() throws IOException, javax.servlet.ServletExceptionRemove the setupWizard filter, ensure all updates are written to disk, etc- Throws:
IOExceptionjavax.servlet.ServletException
-
getInstallStates
public List<InstallState> getInstallStates()
Gets all the install states
-
getInstallState
public InstallState getInstallState(String name)
Returns an installState by name
-
onInstallStateUpdate
public void onInstallStateUpdate(InstallState state)
Called upon install state update.- Parameters:
state- the new install state.- Since:
- 2.94
-
hasSetupWizardFilter
public boolean hasSetupWizardFilter()
Returns whether the setup wizard filter is currently registered.- Since:
- 2.94
-
-