Package jenkins.model
Interface IComputer
- All Superinterfaces:
AccessControlled
- All Known Implementing Classes:
AbstractCloudComputer
,Computer
,Hudson.MasterComputer
,Jenkins.MasterComputer
,SlaveComputer
@Restricted(org.kohsuke.accmod.restrictions.Beta.class)
public interface IComputer
extends AccessControlled
Interface for computer-like objects meant to be passed to
t:executors
tag.- Since:
- 2.480
-
Method Summary
Modifier and TypeMethodDescriptionFuture<?>
connect
(boolean forceReconnect) Attempts to connect this computer.int
Returns the number ofIExecutor
s that are doing some work right now.int
Returns the current size of the executor pool for this computer.int
default ACL
getACL()
Obtains the ACL associated with this object.List<? extends IDisplayExecutor>
Used to render the list of executors.default String
getIcon()
Returns the icon for this computer.default String
Returns the alternative text for the computer icon.default String
Returns the class name that will be used to look up the icon.getName()
Returnsthe name of the node
.default String
If the computer was offline (either temporarily or not), this method will return the cause as a string (without user info).default String
getUrl()
default boolean
boolean
Returnstrue
if the computer is accepting tasks.boolean
boolean
boolean
boolean
isOnline()
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
-
Method Details
-
getName
Returnsthe name of the node
. -
getDisplayExecutors
Used to render the list of executors.- Returns:
- a snapshot of the executor display information
-
isOffline
boolean isOffline()- Returns:
true
if the node is offline.false
if it is online.
-
getDisplayName
- Returns:
- the node name for UI purposes.
-
isAcceptingTasks
boolean isAcceptingTasks()Returnstrue
if the computer is accepting tasks. Needed to allow agents programmatic suspension of task scheduling that does not overlap with being offline.- Returns:
true
if the computer is accepting tasks- See Also:
-
getUrl
- Returns:
- the URL where to reach specifically this computer, relative to Jenkins URL.
-
hasOfflineCause
default boolean hasOfflineCause()- Returns:
true
if this computer has a defined offline cause, @{code false} otherwise.
-
getOfflineCause
IOfflineCause getOfflineCause()- Returns:
- the offline cause if the computer is offline.
- Since:
- 2.483
-
getOfflineCauseReason
If the computer was offline (either temporarily or not), this method will return the cause as a string (without user info).hasOfflineCause() == true
implies this must be nonempty.- Returns:
- empty string if the system was put offline without given a cause.
-
isConnecting
boolean isConnecting()- Returns:
- true if the node is currently connecting to the Jenkins controller.
-
getIcon
Returns the icon for this computer.It is both the recommended and default implementation to serve different icons based on
isOffline()
- See Also:
-
getIconAltText
Returns the alternative text for the computer icon. -
getTooltip
-
getIconClassName
Returns 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)
- See Also:
-
countBusy
int countBusy()Returns the number ofIExecutor
s that are doing some work right now. -
countExecutors
int countExecutors()Returns the current size of the executor pool for this computer. -
isOnline
boolean isOnline()- Returns:
- true if the computer is online.
-
countIdle
int countIdle()- Returns:
- the number of
IExecutor
s that are idle right now.
-
isLaunchSupported
boolean isLaunchSupported()- Returns:
- true if this computer can be launched by Jenkins proactively and automatically.
For example, inbound agents return
false
from this, because the launch process needs to be initiated from the agent side.
-
connect
Attempts 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
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 asIComputer
is connected it can be disconnected by some other threads.)
-
getACL
Description copied from interface:AccessControlled
Obtains the ACL associated with this object.- Specified by:
getACL
in interfaceAccessControlled
- Returns:
- never null.
-