Class RemoteElasticInstanceImpl
java.lang.Object
com.atlassian.bamboo.agent.elastic.server.RemoteElasticInstanceImpl
- All Implemented Interfaces:
RemoteElasticInstance
-
Constructor Summary
ConstructorDescriptionRemoteElasticInstanceImpl
(ElasticInstanceManager manager, ElasticAgentTunnelManager tunnelManager, ErrorHandler errorHandler, com.atlassian.aws.AWSAccount awsAccount, URL baseURL, int startupTimeoutSeconds, RemoteElasticInstanceListener listener, ScheduledExecutorService executor, KeyStore keyStore, ElasticConfiguration elasticConfiguration, @NotNull AgentManager agentManager, @NotNull ElasticImageConfiguration elasticImageConfiguration, @NotNull com.atlassian.aws.ec2.InstanceLaunchConfigurationBuilder instanceLaunchConfigurationBuilder, @NotNull SpotInstanceConfig spotInstanceConfig, @NotNull ServerFingerprint fingerprint, @NotNull com.atlassian.event.api.EventPublisher eventPublisher, @NotNull SecretEncryptionService secretEncryptionService) -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<com.atlassian.aws.ec2.EBSVolume>
@NotNull ElasticImageConfiguration
com.atlassian.aws.ec2.RemoteEC2Instance
long
getState()
void
Interrupts delayed termination process.boolean
boolean
boolean
Returns true if the instance is in a state that allows shutdown.void
restoreInstance
(ElasticAgentDefinition elasticAgentDefinition, com.amazonaws.services.ec2.model.Instance instance) Restore elastic agent's state after server restartvoid
setAgentLoading
(boolean agentLoading) void
setRemoteAgent
(long agentId) void
setTunnelTimeoutMinutes
(int tunnelTimeoutMinutes) void
start()
void
void
triggerDelayedTermination
(long delaySeconds) Triggers delayed termination of elastic instance.
-
Constructor Details
-
RemoteElasticInstanceImpl
public RemoteElasticInstanceImpl(ElasticInstanceManager manager, ElasticAgentTunnelManager tunnelManager, ErrorHandler errorHandler, com.atlassian.aws.AWSAccount awsAccount, URL baseURL, int startupTimeoutSeconds, RemoteElasticInstanceListener listener, ScheduledExecutorService executor, KeyStore keyStore, ElasticConfiguration elasticConfiguration, @NotNull @NotNull AgentManager agentManager, @NotNull @NotNull ElasticImageConfiguration elasticImageConfiguration, @NotNull @NotNull com.atlassian.aws.ec2.InstanceLaunchConfigurationBuilder instanceLaunchConfigurationBuilder, @NotNull @NotNull SpotInstanceConfig spotInstanceConfig, @NotNull @NotNull ServerFingerprint fingerprint, @NotNull @NotNull com.atlassian.event.api.EventPublisher eventPublisher, @NotNull @NotNull SecretEncryptionService secretEncryptionService)
-
-
Method Details
-
getRemoteAgent
public long getRemoteAgent()- Specified by:
getRemoteAgent
in interfaceRemoteElasticInstance
-
setRemoteAgent
public void setRemoteAgent(long agentId) - Specified by:
setRemoteAgent
in interfaceRemoteElasticInstance
- Parameters:
agentId
- id of correspondingElasticAgentDefinition
.
-
isShutdownable
public boolean isShutdownable()Description copied from interface:RemoteElasticInstance
Returns true if the instance is in a state that allows shutdown. It may return true for instances that are already being shutdown in AWS.- Specified by:
isShutdownable
in interfaceRemoteElasticInstance
-
isBeingTerminated
public boolean isBeingTerminated()- Specified by:
isBeingTerminated
in interfaceRemoteElasticInstance
-
isAgentLoading
public boolean isAgentLoading()- Specified by:
isAgentLoading
in interfaceRemoteElasticInstance
-
setAgentLoading
public void setAgentLoading(boolean agentLoading) - Specified by:
setAgentLoading
in interfaceRemoteElasticInstance
-
start
public void start()- Specified by:
start
in interfaceRemoteElasticInstance
-
terminate
public void terminate()- Specified by:
terminate
in interfaceRemoteElasticInstance
-
getState
- Specified by:
getState
in interfaceRemoteElasticInstance
-
getInstance
public com.atlassian.aws.ec2.RemoteEC2Instance getInstance()- Specified by:
getInstance
in interfaceRemoteElasticInstance
-
getAttachedVolumes
- Specified by:
getAttachedVolumes
in interfaceRemoteElasticInstance
-
getConfiguration
- Specified by:
getConfiguration
in interfaceRemoteElasticInstance
-
triggerDelayedTermination
public void triggerDelayedTermination(long delaySeconds) Description copied from interface:RemoteElasticInstance
Triggers delayed termination of elastic instance. Termination is performed asynchronously.- Specified by:
triggerDelayedTermination
in interfaceRemoteElasticInstance
- Parameters:
delaySeconds
- Number of secods to wait before terminating instance.
-
interruptDelayedTermination
public void interruptDelayedTermination()Description copied from interface:RemoteElasticInstance
Interrupts delayed termination process.- Specified by:
interruptDelayedTermination
in interfaceRemoteElasticInstance
-
setTunnelTimeoutMinutes
public void setTunnelTimeoutMinutes(int tunnelTimeoutMinutes) -
restoreInstance
public void restoreInstance(ElasticAgentDefinition elasticAgentDefinition, com.amazonaws.services.ec2.model.Instance instance) throws Exception Description copied from interface:RemoteElasticInstance
Restore elastic agent's state after server restart- Specified by:
restoreInstance
in interfaceRemoteElasticInstance
- Throws:
Exception
-
getKeyStore
- Specified by:
getKeyStore
in interfaceRemoteElasticInstance
- Returns:
- keystore associated with the instance
-