Package hudson.lifecycle
Class WindowsInstallerLink
- java.lang.Object
-
- hudson.model.ManagementLink
-
- hudson.lifecycle.WindowsInstallerLink
-
- All Implemented Interfaces:
ExtensionPoint
,Action
,ModelObject
public class WindowsInstallerLink extends ManagementLink
ManagementLink
that allows the installation as a Windows service.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.ManagementLink
ManagementLink.Category
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.ManagementLink
LIST
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doDoInstall(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String _dir)
Performs installation.void
doRestart(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
ManagementLink.Category
getCategory()
Category for management link, usesString
so it can be done with core dependency pre-dating the version this feature was added.String
getDescription()
Returns a short description of what this link does.String
getDisplayName()
Gets the string to be displayed.String
getIconFileName()
Mostly works likeAction.getIconFileName()
, except that the expected icon format is SVG.String
getUrlName()
Gets the URL path name.boolean
isInstalled()
Is the installation successful?static WindowsInstallerLink
registerIfApplicable()
Decide ifWindowsInstallerLink
should show up in UI, and if so, register it.protected void
sendError(Exception e, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Displays the error in a page.protected void
sendError(String message, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
-
Methods inherited from class hudson.model.ManagementLink
all, getBadge, getCategoryName, getRequiredPermission, getRequiresConfirmation, getRequiresPOST
-
-
-
-
Method Detail
-
getIconFileName
public String getIconFileName()
Description copied from class:ManagementLink
Mostly works likeAction.getIconFileName()
, except that the expected icon format is SVG. So if you give just a file name, "/images/svgs" will be assumed.- Specified by:
getIconFileName
in interfaceAction
- Specified by:
getIconFileName
in classManagementLink
- Returns:
- As a special case, return null to exclude this object from the management link.
This is useful for defining
ManagementLink
that only shows up under certain circumstances. - See Also:
- Jenkins Symbols,
Functions.isAnonymous()
,Functions.getIconFilePath(Action)
-
getUrlName
public String getUrlName()
Description copied from class:ManagementLink
Gets the URL path name.For example, if this method returns "xyz", and if the parent object (that this action is associated with) is bound to /foo/bar/zot, then this action object will be exposed to /foo/bar/zot/xyz.
This method should return a string that's unique among other
Action
s.The returned string can be an absolute URL, like "http://www.sun.com/", which is useful for directly connecting to external systems.
If the returned string starts with '/', like '/foo', then it's assumed to be relative to the context path of the Jenkins webapp.
In case of
ManagementLink
, this value is put straight into the href attribute, so relative paths are interpreted against the rootJenkins
object.- Specified by:
getUrlName
in interfaceAction
- Specified by:
getUrlName
in classManagementLink
- Returns:
- null if this action object doesn't need to be bound to web
(when you do that, be sure to also return null from
Action.getIconFileName()
. - See Also:
Functions.getActionUrl(String, Action)
-
getDisplayName
public String getDisplayName()
Description copied from interface:Action
Gets the string to be displayed. The convention is to capitalize the first letter of each word, such as "Test Result".- Returns:
- Can be null in case the action is hidden.
-
getDescription
public String getDescription()
Description copied from class:ManagementLink
Returns a short description of what this link does. This text is the one that's displayed in grey. This can include HTML, although the use of block tags is highly discouraged. Optional.- Overrides:
getDescription
in classManagementLink
-
getCategory
@NonNull public ManagementLink.Category getCategory()
Description copied from class:ManagementLink
Category for management link, usesString
so it can be done with core dependency pre-dating the version this feature was added.- Overrides:
getCategory
in classManagementLink
- Returns:
- An enum value of
ManagementLink.Category
.
-
isInstalled
public boolean isInstalled()
Is the installation successful?
-
doDoInstall
public void doDoInstall(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter("dir") String _dir) throws IOException, javax.servlet.ServletException
Performs installation.- Throws:
IOException
javax.servlet.ServletException
-
doRestart
public void doRestart(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
- Throws:
IOException
javax.servlet.ServletException
-
sendError
protected final void sendError(Exception e, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException
Displays the error in a page.- Throws:
javax.servlet.ServletException
IOException
-
sendError
protected final void sendError(String message, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletException
IOException
-
registerIfApplicable
@Extension public static WindowsInstallerLink registerIfApplicable()
Decide ifWindowsInstallerLink
should show up in UI, and if so, register it.
-
-