Class RemoteElasticInstanceImpl
- java.lang.Object
-
- com.atlassian.bamboo.agent.elastic.server.RemoteElasticInstanceImpl
-
- All Implemented Interfaces:
RemoteElasticInstance
public class RemoteElasticInstanceImpl extends Object implements RemoteElasticInstance
-
-
Constructor Summary
Constructors Constructor Description 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 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Collection<com.atlassian.aws.ec2.EBSVolume>
getAttachedVolumes()
@NotNull ElasticImageConfiguration
getConfiguration()
com.atlassian.aws.ec2.RemoteEC2Instance
getInstance()
KeyStore
getKeyStore()
long
getRemoteAgent()
RemoteElasticInstanceState
getState()
void
interruptDelayedTermination()
Interrupts delayed termination process.boolean
isAgentLoading()
boolean
isBeingTerminated()
boolean
isShutdownable()
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
terminate()
void
triggerDelayedTermination(long delaySeconds)
Triggers delayed termination of elastic instance.
-
-
-
Constructor Detail
-
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 Detail
-
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
public RemoteElasticInstanceState getState()
- Specified by:
getState
in interfaceRemoteElasticInstance
-
getInstance
public com.atlassian.aws.ec2.RemoteEC2Instance getInstance()
- Specified by:
getInstance
in interfaceRemoteElasticInstance
-
getAttachedVolumes
@NotNull public @NotNull Collection<com.atlassian.aws.ec2.EBSVolume> getAttachedVolumes()
- Specified by:
getAttachedVolumes
in interfaceRemoteElasticInstance
-
getConfiguration
@NotNull public @NotNull ElasticImageConfiguration 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
public KeyStore getKeyStore()
- Specified by:
getKeyStore
in interfaceRemoteElasticInstance
- Returns:
- keystore associated with the instance
-
-