Package hudson.model

Class Hudson

All Implemented Interfaces:
ExtensionPoint, Describable<Node>, DescriptorByNameOwner, ItemGroup<TopLevelItem>, ModelObject, ModifiableItemGroup<TopLevelItem>, ModifiableViewGroup, PersistenceRoot, ReconfigurableDescribable<Node>, Saveable, ViewGroup, SearchableModelObject, SearchItem, AccessControlled, DirectlyModifiableTopLevelItemGroup, Loadable, ModelObjectWithChildren, ModelObjectWithContextMenu, ModifiableTopLevelItemGroup, OnMaster, org.kohsuke.stapler.StaplerFallback, org.kohsuke.stapler.StaplerProxy

public class Hudson extends Jenkins
  • Constructor Details

  • Method Details

    • getInstance

      @Deprecated @CLIResolver @Nullable public static Hudson getInstance()
      Deprecated.
      Here only for compatibility. Use Jenkins.get() instead.
    • getJobListeners

      @Deprecated public CopyOnWriteList<ItemListener> getJobListeners()
      Deprecated.
      as of 1.286. Use ItemListener.all().
      Gets all the installed ItemListeners.
    • getComputerListeners

      @Deprecated public CopyOnWriteList<ComputerListener> getComputerListeners()
      Deprecated.
      as of 1.286. Use ComputerListener.all().
      Gets all the installed ComputerListeners.
    • getSlave

      @Deprecated public Slave getSlave(String name)
      Deprecated.
      Use Jenkins.getNode(String). Since 1.252.
      Gets the agent of the give name, hooked under this Hudson.
    • getSlaves

      @Deprecated public List<Slave> getSlaves()
      Deprecated.
      Use Jenkins.getNodes(). Since 1.252.
    • setSlaves

      @Deprecated public void setSlaves(List<Slave> slaves) throws IOException
      Deprecated.
      Use Jenkins.setNodes(List). Since 1.252.
      Updates the agent list.
      Throws:
      IOException
    • getJob

      @Deprecated public TopLevelItem getJob(String name)
      Deprecated.
      Left only for the compatibility of URLs. Should not be invoked for any other purpose.
    • getJobCaseInsensitive

      @Deprecated public TopLevelItem getJobCaseInsensitive(String name)
      Deprecated.
      Used only for mapping jobs to URL in a case-insensitive fashion.
    • doQuietDown

      @Deprecated public void doQuietDown(org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
      Deprecated.
      as of 1.317 Use Jenkins.doQuietDown() instead.
      Throws:
      IOException
      javax.servlet.ServletException
    • doLogRss

      @Deprecated public void doLogRss(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
      Deprecated.
      As on 1.267, moved to "/log/rss..."
      RSS feed for log entries.
      Throws:
      IOException
      javax.servlet.ServletException
    • doFieldCheck

      @Deprecated public void doFieldCheck(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
      Deprecated.
      as of 1.294 Define your own check method, instead of relying on this generic one.
      Throws:
      IOException
      javax.servlet.ServletException
    • doFieldCheck

      @Deprecated public FormValidation doFieldCheck(@QueryParameter(fixEmpty=true) String value, @QueryParameter(fixEmpty=true) String type, @QueryParameter(fixEmpty=true) String errorText, @QueryParameter(fixEmpty=true) String warningText)
      Deprecated.
      as of 1.324 Either use client-side validation (e.g. class="required number") or define your own check method, instead of relying on this generic one.
      Checks if the value for a field is set; if not an error or warning text is displayed. If the parameter "value" is not set then the parameter "errorText" is displayed as an error text. If the parameter "errorText" is not set, then the parameter "warningText" is displayed as a warning text.

      If the text is set and the parameter "type" is set, it will validate that the value is of the correct type. Supported types are "number, "number-positive" and "number-negative".

    • isWindows

      @Deprecated public static boolean isWindows()
      Deprecated.
    • isDarwin

      @Deprecated public static boolean isDarwin()
      Deprecated.
    • adminCheck

      @Deprecated public static boolean adminCheck() throws IOException
      Throws:
      IOException
    • adminCheck

      @Deprecated public static boolean adminCheck(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
      Throws:
      IOException
    • isAdmin

      @Deprecated public static boolean isAdmin()
      Deprecated.
      since 2007-12-18. This method is deprecated when Hudson moved from simple Unix root-like model of "admin gets to do everything, and others don't have any privilege" to more complex ACL and Permission based scheme.

      For a quick migration, use Hudson.getInstance().getACL().hasPermission(Hudson.ADMINISTER) To check if the user has the 'administer' role in Hudson.

      But ideally, your plugin should first identify a suitable Permission (or create one, if appropriate), then identify a suitable AccessControlled object to check its permission against.

      Checks if the current user (for which we are processing the current request) has the admin access.
    • isAdmin

      @Deprecated public static boolean isAdmin(org.kohsuke.stapler.StaplerRequest req)
      Deprecated.
      since 2007-12-18. Define a custom Permission and check against ACL. See isAdmin() for more instructions.