public abstract class Slave extends Node implements Serializable
Ideally this would have been in the hudson.slaves package, but for compatibility reasons, it can't.
TODO: move out more stuff to DumbSlave.
| Modifier and Type | Class and Description |
|---|---|
static class |
Slave.JnlpJar
Web-bound object used to serve jar files for JNLP.
|
static class |
Slave.SlaveDescriptor |
Node.InternalComputerListener, Node.ModeExtensionPoint.LegacyInstancesAreScopedToHudson| Modifier and Type | Field and Description |
|---|---|
protected String |
name
Name of this slave node.
|
protected String |
remoteFS
Path to the root of the workspace from the view point of this node, such as "/hudson", this need not
be absolute provided that the launcher establishes a consistent working directory, such as "./.jenkins-slave"
when used with an SSH launcher.
|
holdOffLaunchUntilSave| Constructor and Description |
|---|
Slave(String name,
String nodeDescription,
String remoteFS,
int numExecutors,
Node.Mode mode,
String labelString,
ComputerLauncher launcher,
RetentionStrategy retentionStrategy)
Deprecated.
since 2009-02-20.
|
Slave(String name,
String nodeDescription,
String remoteFS,
int numExecutors,
Node.Mode mode,
String labelString,
ComputerLauncher launcher,
RetentionStrategy retentionStrategy,
List<? extends NodeProperty<?>> nodeProperties) |
Slave(String name,
String nodeDescription,
String remoteFS,
String numExecutors,
Node.Mode mode,
String labelString,
ComputerLauncher launcher,
RetentionStrategy retentionStrategy,
List<? extends NodeProperty<?>> nodeProperties) |
| Modifier and Type | Method and Description |
|---|---|
Computer |
createComputer()
|
Launcher |
createLauncher(TaskListener listener)
Creates a launcher for the slave.
|
boolean |
equals(Object o) |
hudson.remoting.Callable<ClockDifference,IOException> |
getClockDifferenceCallable()
Returns a
Callable that when run on the channel, estimates the clock difference. |
SlaveComputer |
getComputer()
Gets the corresponding computer object.
|
Slave.SlaveDescriptor |
getDescriptor()
Gets the descriptor for this instance.
|
String |
getLabelString()
Returns the manually configured label for a node.
|
ComputerLauncher |
getLauncher() |
Node.Mode |
getMode()
Returns
Node.Mode.EXCLUSIVE if this node is only available
for those jobs that exclusively specifies this node
as the assigned node. |
String |
getNodeDescription()
Human-readable description of this node.
|
String |
getNodeName()
Name of this node.
|
DescribableList<NodeProperty<?>,NodePropertyDescriptor> |
getNodeProperties()
Gets the
NodeProperty instances configured for this Node. |
int |
getNumExecutors()
Returns the number of
Executors. |
String |
getRemoteFS() |
RetentionStrategy |
getRetentionStrategy() |
FilePath |
getRootPath()
Gets the root directory of this node.
|
String |
getUserId()
Return id of user which created this slave
|
FilePath |
getWorkspaceFor(TopLevelItem item)
Returns a "workspace" directory for the given
TopLevelItem. |
FilePath |
getWorkspaceRoot()
Root directory on this slave where all the job workspaces are laid out.
|
int |
hashCode() |
protected Object |
readResolve()
Invoked by XStream when this object is read into memory.
|
void |
setLabelString(String labelString)
Sets the label string for a node.
|
void |
setLauncher(ComputerLauncher launcher) |
void |
setMode(Node.Mode mode) |
void |
setNodeName(String name)
|
void |
setRetentionStrategy(RetentionStrategy availabilityStrategy) |
void |
setUserId(String userId) |
String |
toString() |
canTake, canTake, checkPermission, createPath, getACL, getAssignedLabels, getChannel, getClockDifference, getDisplayName, getFileSystemProvisioner, getLabelCloud, getNodePropertyDescriptors, getSearchUrl, getSelfLabel, hasPermission, isAcceptingTasks, isHoldOffLaunchUntilSave, reconfigure, save, toComputergetSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendErrorprotected String name
protected final String remoteFS
public Slave(String name, String nodeDescription, String remoteFS, String numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws Descriptor.FormException, IOException
Descriptor.FormExceptionIOException@Deprecated public Slave(String name, String nodeDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy) throws Descriptor.FormException, IOException
Descriptor.FormExceptionIOExceptionpublic Slave(@Nonnull String name, String nodeDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws Descriptor.FormException, IOException
Descriptor.FormExceptionIOExceptionpublic String getUserId()
public void setUserId(String userId)
public ComputerLauncher getLauncher()
public void setLauncher(ComputerLauncher launcher)
public String getRemoteFS()
public String getNodeName()
NodegetNodeName in class Nodepublic void setNodeName(String name)
NodeNode, Hudson uses this method to change the node name right after
the cloned Node object is instantiated.
This method is never used for any other purpose, and as such for all practical intents and purposes, the node name should be treated like immutable.
setNodeName in class Nodepublic String getNodeDescription()
NodegetNodeDescription in class Nodepublic int getNumExecutors()
NodeExecutors.
This may be different from getExecutors().size()
because it takes time to adjust the number of executors.getNumExecutors in class Nodepublic Node.Mode getMode()
NodeNode.Mode.EXCLUSIVE if this node is only available
for those jobs that exclusively specifies this node
as the assigned node.public void setMode(Node.Mode mode)
public DescribableList<NodeProperty<?>,NodePropertyDescriptor> getNodeProperties()
NodeNodeProperty instances configured for this Node.getNodeProperties in class Nodepublic RetentionStrategy getRetentionStrategy()
public void setRetentionStrategy(RetentionStrategy availabilityStrategy)
public String getLabelString()
NodeNode.getAssignedLabels() and includes all labels that have been
manually configured.
Mainly for form binding.getLabelString in class Nodepublic void setLabelString(String labelString) throws IOException
NodeNode.getLabelString().setLabelString in class NodelabelString - The new label string to use.IOExceptionpublic hudson.remoting.Callable<ClockDifference,IOException> getClockDifferenceCallable()
NodeCallable that when run on the channel, estimates the clock difference.getClockDifferenceCallable in class Nodepublic Computer createComputer()
NodeComputer object that acts as the UI peer of this Node.
Nobody but Jenkins.updateComputerList() should call this method.createComputer in class Nodepublic FilePath getWorkspaceFor(TopLevelItem item)
NodeTopLevelItem.
Workspace directory is usually used for keeping out the checked out source code, but it can be used for anything.
getWorkspaceFor in class Node@CheckForNull public FilePath getRootPath()
NodeHudson always owns a directory on every node. This method returns that.
getRootPath in class NodeFilePath
object is not available.@CheckForNull public FilePath getWorkspaceRoot()
public Launcher createLauncher(TaskListener listener)
createLauncher in class NodeLauncher.DummyLauncher, otherwise it
will return a Launcher.RemoteLauncher instead.public SlaveComputer getComputer()
protected Object readResolve()
public Slave.SlaveDescriptor getDescriptor()
Describable
Descriptor is a singleton for every concrete Describable
implementation, so if a.getClass() == b.getClass() then by default
a.getDescriptor() == b.getDescriptor() as well.
(In rare cases a single implementation class may be used for instances with distinct descriptors.)
getDescriptor in interface Describable<Node>getDescriptor in class NodeCopyright © 2019. All rights reserved.