Package jenkins.model
Interface IComputer
- All Superinterfaces:
- AccessControlled,- IconSpec,- ModelObject,- Named
- All Known Implementing Classes:
- AbstractCloudComputer,- Computer,- Hudson.MasterComputer,- Jenkins.MasterComputer,- SlaveComputer
@Restricted(org.kohsuke.accmod.restrictions.Beta.class)
public interface IComputer
extends AccessControlled, IconSpec, ModelObject, Named
Interface for computer-like objects meant to be passed to 
t:executors tag.- Since:
- 2.480
- 
Method SummaryModifier and TypeMethodDescriptionFuture<?> connect(boolean forceReconnect) Attempts to connect this computer.intReturns the number ofIExecutors that are doing some work right now.intReturns the current size of the executor pool for this computer.intdefault ACLgetACL()Obtains the ACL associated with this object.List<? extends IDisplayExecutor> Used to render the list of executors.default StringgetIcon()Returns the icon for this computer.default StringReturns the alternative text for the computer icon.default StringReturns the class name that will be used to look up the icon.default StringIf the computer was offline (either temporarily or not), this method will return the cause as a string (without user info).default StringgetUrl()default booleanbooleanReturnstrueif the computer is accepting tasks.default booleanIndicates whether the agent is actually connected to the controller.booleanbooleanbooleanReturns whether the agent is offline for scheduling new tasks.booleanisOnline()Indicates whether the agent can accept a new task when it becomes idle.Methods inherited from interface hudson.security.AccessControlledcheckAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.model.ModelObjectgetDisplayName
- 
Method Details- 
getDisplayExecutorsUsed to render the list of executors.- Returns:
- a snapshot of the executor display information
 
- 
isOfflineboolean isOffline()Returns whether the agent is offline for scheduling new tasks. Even iftrue, the agent may still be connected to the controller and executing a task, but is considered offline for scheduling.- Returns:
- trueif the agent is offline;- falseif online.
- See Also:
 
- 
isAcceptingTasksboolean isAcceptingTasks()Returnstrueif the computer is accepting tasks. Needed to allow agents programmatic suspension of task scheduling that does not overlap with being offline.- Returns:
- trueif the computer is accepting tasks
- See Also:
 
- 
getUrl- Returns:
- the URL where to reach specifically this computer, relative to Jenkins URL.
 
- 
hasOfflineCausedefault boolean hasOfflineCause()- Returns:
- trueif this computer has a defined offline cause, @{code false} otherwise.
 
- 
getOfflineCauseIOfflineCause getOfflineCause()- Returns:
- the offline cause if the computer is offline.
- Since:
- 2.483
 
- 
getOfflineCauseReasonIf the computer was offline (either temporarily or not), this method will return the cause as a string (without user info).hasOfflineCause() == trueimplies this must be nonempty.- Returns:
- empty string if the system was put offline without given a cause.
 
- 
isConnectingboolean isConnecting()- Returns:
- true if the node is currently connecting to the Jenkins controller.
 
- 
getIconReturns the icon for this computer.It is both the recommended and default implementation to serve different icons based on isOffline()- See Also:
 
- 
getIconAltTextReturns the alternative text for the computer icon.
- 
getTooltip
- 
getIconClassNameReturns the class name that will be used to look up the icon.This class name will be added as a class tag to the html img tags where the icon should show up followed by a size specifier given by Icon.toNormalizedIconSizeClass(String)The conversion of class tag to src tag is registered throughIconSet.addIcon(Icon)- Specified by:
- getIconClassNamein interface- IconSpec
- Returns:
- The Icon class specification e.g. 'icon-notepad'.
- See Also:
 
- 
countBusyint countBusy()Returns the number ofIExecutors that are doing some work right now.
- 
countExecutorsint countExecutors()Returns the current size of the executor pool for this computer.
- 
isOnlineboolean isOnline()Indicates whether the agent can accept a new task when it becomes idle.falsedoes not necessarily mean the agent is disconnected.- Returns:
- trueif the agent is online.
- See Also:
 
- 
isConnecteddefault boolean isConnected()Indicates whether the agent is actually connected to the controller.- Returns:
- trueif the agent is connected to the controller.
 
- 
countIdleint countIdle()- Returns:
- the number of IExecutors that are idle right now.
 
- 
isLaunchSupportedboolean isLaunchSupported()- Returns:
- true if this computer can be launched by Jenkins proactively and automatically.
 For example, inbound agents return falsefrom this, because the launch process needs to be initiated from the agent side.
 
- 
connectAttempts to connect this 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 Futurerepresenting 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 asIComputeris connected it can be disconnected by some other threads.)
 
- 
getACLDescription copied from interface:AccessControlledObtains the ACL associated with this object.- Specified by:
- getACLin interface- AccessControlled
- Returns:
- never null.
 
 
-