Package jenkins.model

Class Jenkins.MasterComputer

All Implemented Interfaces:
ExtensionPoint, DescriptorByNameOwner, ExecutorListener, ModelObject, SearchableModelObject, SearchItem, AccessControlled, IComputer, ModelObjectWithContextMenu, HasWidgets, org.kohsuke.stapler.StaplerProxy
Direct Known Subclasses:
Hudson.MasterComputer
Enclosing class:
Jenkins

public static class Jenkins.MasterComputer extends Computer
  • Field Details

    • localChannel

      @Deprecated public static final hudson.remoting.LocalChannel localChannel
      Deprecated.
      as of 1.558 Use FilePath.localChannel
      LocalChannel instance that can be used to execute programs locally.
  • Constructor Details

    • MasterComputer

      protected MasterComputer()
  • Method Details

    • getName

      @NonNull public String getName()
      Returns "" to match with AbstractCIBase.getNodeName().
      Specified by:
      getName in interface IComputer
      Overrides:
      getName in class Computer
    • isConnecting

      public boolean isConnecting()
      Returns:
      true if the node is currently connecting to the Jenkins controller.
    • getDisplayName

      @NonNull public String getDisplayName()
      Specified by:
      getDisplayName in interface IComputer
      Specified by:
      getDisplayName in interface ModelObject
      Overrides:
      getDisplayName in class Computer
      Returns:
      the node name for UI purposes.
    • getCaption

      public String getCaption()
      Overrides:
      getCaption in class Computer
    • getUrl

      @NonNull public String getUrl()
      Specified by:
      getUrl in interface IComputer
      Overrides:
      getUrl in class Computer
      Returns:
      the URL where to reach specifically this computer, relative to Jenkins URL.
    • getRetentionStrategy

      public RetentionStrategy getRetentionStrategy()
      Description copied from class: Computer
      RetentionStrategy associated with this computer.
      Specified by:
      getRetentionStrategy in class Computer
      Returns:
      never null. This method return RetentionStrategy<? super T> where T=this.getClass().
    • isAlive

      protected boolean isAlive()
      Will always keep this guy alive so that it can function as a fallback to execute Queue.FlyweightTasks. See JENKINS-7291.
      Overrides:
      isAlive in class Computer
    • isUnix

      public Boolean isUnix()
      Description copied from class: Computer
      True if this computer is a Unix machine (as opposed to Windows machine).
      Specified by:
      isUnix in class Computer
      Returns:
      null if the computer is disconnected and therefore we don't know whether it is Unix or not.
    • doDoDelete

      public org.kohsuke.stapler.HttpResponse doDoDelete() throws IOException
      Report an error.
      Overrides:
      doDoDelete in class Computer
      Throws:
      IOException
    • doConfigSubmit

      @POST public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException
      Description copied from class: Computer
      Accepts the update to the node configuration.
      Overrides:
      doConfigSubmit in class Computer
      Throws:
      IOException
      jakarta.servlet.ServletException
      Descriptor.FormException
    • doConfigDotXml

      @WebMethod(name="config.xml") public void doConfigDotXml(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException
      Description copied from class: Computer
      Accepts config.xml submission, as well as serve it.
      Overrides:
      doConfigDotXml in class Computer
      Throws:
      IOException
      jakarta.servlet.ServletException
    • hasPermission

      public boolean hasPermission(Permission permission)
      Description copied from interface: AccessControlled
      Convenient short-cut for getACL().hasPermission(permission)
    • getChannel

      public hudson.remoting.VirtualChannel getChannel()
      Description copied from class: Computer
      Gets the channel that can be used to run a program on this computer.
      Specified by:
      getChannel in class Computer
      Returns:
      never null when Computer.isOffline()==false.
    • getDefaultCharset

      public Charset getDefaultCharset()
      Description copied from class: Computer
      Gets the default charset of this computer.
      Specified by:
      getDefaultCharset in class Computer
      Returns:
      never null when Computer.isOffline()==false.
    • getLogRecords

      public List<LogRecord> getLogRecords() throws IOException, InterruptedException
      Description copied from class: Computer
      Gets the logs recorded by this agent.
      Specified by:
      getLogRecords in class Computer
      Throws:
      IOException
      InterruptedException
    • doLaunchSlaveAgent

      public void doLaunchSlaveAgent(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException
      Description copied from class: Computer
      If Computer.getChannel()==null, attempts to relaunch the agent.
      Specified by:
      doLaunchSlaveAgent in class Computer
      Throws:
      IOException
      jakarta.servlet.ServletException
    • _connect

      protected Future<?> _connect(boolean forceReconnect)
      Description copied from class: Computer
      Allows implementing-classes to provide an implementation for the connect method.

      If already connected or if this computer doesn't support proactive launching, no-op. This method may return immediately while the launch operation happens asynchronously.

      Specified by:
      _connect in class Computer
      Parameters:
      forceReconnect - If true and a connect activity is already in progress, it will be cancelled and the new one will be started. If false, and a connect activity is already in progress, this method will do nothing and just return the pending connection operation.
      Returns:
      A Future representing pending completion of the task. The 'completion' includes both a successful completion and a non-successful completion (such distinction typically doesn't make much sense because as soon as Computer is connected it can be disconnected by some other threads.)
      See Also: