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
Dropletif 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.SlaveDescriptorNested 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 theDropletwhen not needed anymore.Override to create a DigitalOceanDigitalOceanComputergetCloud()Retrieve a handle to the associatedDigitalOceanCloudorg.jenkinsci.plugins.cloudstats.ProvisioningActivity.IdgetId()intGet the name of the remote admin userintlongMethods inherited from class hudson.slaves.AbstractCloudSlave
terminateMethods 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, toStringMethods 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, toComputerMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods 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.FormExceptionIOException
-
-
Method Details
-
createComputer
Override to create a DigitalOceanDigitalOceanComputer- Specified by:
createComputerin 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 theDropletwhen not needed anymore.- Specified by:
_terminatein 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:
getIdin interfaceorg.jenkinsci.plugins.cloudstats.TrackedItem
-
getStartTimeMillis
public long getStartTimeMillis() -
getDropletId
-
getPrivateKey
-
getIdleTerminationTime
public int getIdleTerminationTime() -
getInitScript
-
getJvmOpts
-
getSshPort
public int getSshPort()
-