Package com.dubture.jenkins.digitalocean
Class Slave
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Node
hudson.model.Slave
hudson.slaves.AbstractCloudSlave
com.dubture.jenkins.digitalocean.Slave
- All Implemented Interfaces:
ExtensionPoint
,Describable<Node>
,ModelObject
,PersistenceRoot
,ReconfigurableDescribable<Node>
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Serializable
,OnMaster
,org.jenkinsci.plugins.cloudstats.TrackedItem
public class Slave
extends AbstractCloudSlave
implements org.jenkinsci.plugins.cloudstats.TrackedItem
The
Slave
is responsible for
- Creating a DigitalOcean
DigitalOceanComputer
- Destroying the
Droplet
if it's not needed anymore.
- Author:
- robert.gruendler@dubture.com
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.model.Slave
Slave.JnlpJar, Slave.SlaveDescriptor
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.model.Node
holdOffLaunchUntilSave, SKIP_BUILD_CHECK_ON_FLYWEIGHTS
-
Constructor Summary
ConstructorsConstructorDescriptionSlave
(org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id provisioningId, String cloudName, String name, String nodeDescription, Integer dropletId, String privateKey, String remoteAdmin, String remoteFS, int sshPort, int numExecutors, int idleTerminationTime, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties, String initScript) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_terminate
(TaskListener listener) Deletes theDroplet
when not needed anymore.Override to create a DigitalOceanDigitalOceanComputer
getCloud()
Retrieve a handle to the associatedDigitalOceanCloud
org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id
getId()
int
Get the name of the remote admin userint
long
Methods inherited from class hudson.slaves.AbstractCloudSlave
terminate
Methods inherited from class hudson.model.Slave
createLauncher, equals, getClockDifferenceCallable, getComputer, getDescriptor, getLabelAtomSet, getLabelString, getLauncher, getMode, getNodeDescription, getNodeName, getNodeProperties, getNumExecutors, getRemoteFS, getRetentionStrategy, getRootPath, getUserId, getWorkspaceFor, getWorkspaceRoot, hashCode, readResolve, setLabelString, setLauncher, setMode, setNodeDescription, setNodeName, setNodeProperties, setNumExecutors, setRetentionStrategy, setUserId, toString
Methods inherited from class hudson.model.Node
canTake, canTake, createPath, getACL, getAssignedLabels, getChannel, getClockDifference, getConfigFile, getDisplayName, getFileSystemProvisioner, getLabelCloud, getNodeProperty, getNodeProperty, getNodePropertyDescriptors, getRootDir, getSearchUrl, getSelfLabel, getTemporaryOfflineCause, isAcceptingTasks, isHoldOffLaunchUntilSave, onLoad, reconfigure, reconfigure, save, toComputer
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendError
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
Methods inherited from interface hudson.search.SearchItem
getSearchIcon
-
Constructor Details
-
Slave
public Slave(org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id provisioningId, String cloudName, String name, String nodeDescription, Integer dropletId, String privateKey, String remoteAdmin, String remoteFS, int sshPort, int numExecutors, int idleTerminationTime, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties, String initScript) throws Descriptor.FormException, IOException - Throws:
Descriptor.FormException
IOException
-
-
Method Details
-
createComputer
Override to create a DigitalOceanDigitalOceanComputer
- Specified by:
createComputer
in classAbstractCloudSlave
- Returns:
- a new DigitalOceanComputer instance, instantiated with this Slave instance.
-
getCloud
Retrieve a handle to the associatedDigitalOceanCloud
- Returns:
- the DigitalOceanCloud associated with the specified cloudName
-
getRemoteAdmin
Get the name of the remote admin user- Returns:
- the remote admin user, defaulting to "root"
-
_terminate
Deletes theDroplet
when not needed anymore.- Specified by:
_terminate
in classAbstractCloudSlave
- Parameters:
listener
- Unused- Throws:
IOException
- which is thrown in case of file system errors.InterruptedException
- in case the thread itself is interrupted.
-
getId
public org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id getId()- Specified by:
getId
in interfaceorg.jenkinsci.plugins.cloudstats.TrackedItem
-
getStartTimeMillis
public long getStartTimeMillis() -
getDropletId
-
getPrivateKey
-
getIdleTerminationTime
public int getIdleTerminationTime() -
getInitScript
-
getJvmOpts
-
getSshPort
public int getSshPort()
-