Package jenkins.model
Class Jenkins.MasterComputer
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.Computer
-
- jenkins.model.Jenkins.MasterComputer
-
- All Implemented Interfaces:
ExtensionPoint
,DescriptorByNameOwner
,ExecutorListener
,ModelObject
,SearchableModelObject
,SearchItem
,AccessControlled
,ModelObjectWithContextMenu
,org.kohsuke.stapler.StaplerProxy
- Direct Known Subclasses:
Hudson.MasterComputer
- Enclosing class:
- Jenkins
public static class Jenkins.MasterComputer extends Computer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Computer
Computer.DisplayExecutor, Computer.TerminationRequest
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
-
Field Summary
Fields Modifier and Type Field Description static hudson.remoting.LocalChannel
localChannel
Deprecated.as of 1.558 UseFilePath.localChannel
-
Fields inherited from class hudson.model.Computer
BUILD, CONFIGURE, CONNECT, CREATE, DELETE, DISCONNECT, EXTENDED_READ, EXTENDED_READ_AND_CONNECT, nodeName, offlineCause, PERMISSIONS, SKIP_PERMISSION_CHECK, statusChangeLock, threadPoolForRemoting, transientActions
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MasterComputer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Future<?>
_connect(boolean forceReconnect)
Allows implementing-classes to provide an implementation for the connect method.void
doConfigDotXml(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Acceptsconfig.xml
submission, as well as serve it.void
doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Accepts the update to the node configuration.org.kohsuke.stapler.HttpResponse
doDoDelete()
Report an error.void
doLaunchSlaveAgent(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
IfComputer.getChannel()
==null, attempts to relaunch the agent.String
getCaption()
hudson.remoting.VirtualChannel
getChannel()
Gets the channel that can be used to run a program on this computer.Charset
getDefaultCharset()
Gets the default charset of this computer.String
getDisplayName()
List<LogRecord>
getLogRecords()
Gets the logs recorded by this agent.String
getName()
Returns "" to match withAbstractCIBase.getNodeName()
.RetentionStrategy
getRetentionStrategy()
RetentionStrategy
associated with this computer.String
getUrl()
boolean
hasPermission(Permission permission)
Convenient short-cut forgetACL().hasPermission(permission)
protected boolean
isAlive()
Will always keep this guy alive so that it can function as a fallback to executeQueue.FlyweightTask
s.boolean
isConnecting()
Is aComputer.connect(boolean)
operation in progress?Boolean
isUnix()
True if this computer is a Unix machine (as opposed to Windows machine).-
Methods inherited from class hudson.model.Computer
_doScript, addAction, buildEnvironment, cliConnect, cliDisconnect, cliOffline, cliOnline, connect, countBusy, countExecutors, countIdle, currentComputer, disconnect, disconnect, doChangeOfflineCause, doDumpExportTable, doProgressiveLog, doRssAll, doRssFailed, doRssLatest, doScript, doScriptText, doToggleOffline, getACL, getActions, getAllExecutors, getApi, getAssignedLabels, getBuilds, getComputerPanelBoxs, getConnectTime, getDemandStartMilliseconds, getDescription, getDisplayExecutors, getEnvironment, getEnvVars, getExecutors, getHeapDump, getHostName, getIcon, getIconAltText, getIconClassName, getIdleStartMilliseconds, getLoadStatistics, getLog, getLogDir, getLogFile, getLogText, getMonitorData, getNode, getNumExecutors, getOfflineCause, getOfflineCauseReason, getOneOffExecutors, getSearchUrl, getSystemProperties, getTarget, getTerminatedBy, getThreadDump, getTiedJobs, getTimeline, getWorkspaceList, interrupt, isAcceptingTasks, isIdle, isJnlpAgent, isLaunchSupported, isManualLaunchAllowed, isOffline, isOnline, isPartiallyIdle, isTemporarilyOffline, kill, launch, onRemoved, recordTermination, relocateOldLogs, removeExecutor, resolveForCLI, setNode, setTemporarilyOffline, setTemporarilyOffline, updateByXml, waitUntilOffline, waitUntilOnline
-
Methods inherited from class hudson.model.Actionable
addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission2
-
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
-
Methods inherited from interface hudson.model.ExecutorListener
taskAccepted, taskCompleted, taskCompletedWithProblems, taskStarted
-
-
-
-
Field Detail
-
localChannel
@Deprecated public static final hudson.remoting.LocalChannel localChannel
Deprecated.as of 1.558 UseFilePath.localChannel
LocalChannel
instance that can be used to execute programs locally.
-
-
Method Detail
-
getName
public String getName()
Returns "" to match withAbstractCIBase.getNodeName()
.
-
isConnecting
public boolean isConnecting()
Description copied from class:Computer
Is aComputer.connect(boolean)
operation in progress?- Specified by:
isConnecting
in classComputer
-
getDisplayName
@NonNull public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
- Overrides:
getDisplayName
in classComputer
-
getCaption
public String getCaption()
- Overrides:
getCaption
in classComputer
-
getRetentionStrategy
public RetentionStrategy getRetentionStrategy()
Description copied from class:Computer
RetentionStrategy
associated with this computer.- Specified by:
getRetentionStrategy
in classComputer
- Returns:
- never null. This method return
RetentionStrategy<? super T>
whereT=this.getClass()
.
-
isAlive
protected boolean isAlive()
Will always keep this guy alive so that it can function as a fallback to executeQueue.FlyweightTask
s. See JENKINS-7291.
-
isUnix
public Boolean isUnix()
Description copied from class:Computer
True if this computer is a Unix machine (as opposed to Windows machine).
-
doDoDelete
public org.kohsuke.stapler.HttpResponse doDoDelete() throws IOException
Report an error.- Overrides:
doDoDelete
in classComputer
- Throws:
IOException
-
doConfigSubmit
@POST public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormException
Description copied from class:Computer
Accepts the update to the node configuration.- Overrides:
doConfigSubmit
in classComputer
- Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException
-
doConfigDotXml
@WebMethod(name="config.xml") public void doConfigDotXml(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
Description copied from class:Computer
Acceptsconfig.xml
submission, as well as serve it.- Overrides:
doConfigDotXml
in classComputer
- Throws:
IOException
javax.servlet.ServletException
-
hasPermission
public boolean hasPermission(Permission permission)
Description copied from interface:AccessControlled
Convenient short-cut forgetACL().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 classComputer
- 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 classComputer
- 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 classComputer
- Throws:
IOException
InterruptedException
-
doLaunchSlaveAgent
public void doLaunchSlaveAgent(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
Description copied from class:Computer
IfComputer.getChannel()
==null, attempts to relaunch the agent.- Specified by:
doLaunchSlaveAgent
in classComputer
- Throws:
IOException
javax.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 classComputer
- 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 asComputer
is connected it can be disconnected by some other threads.) - See Also:
Computer.disconnect()
-
-