com.atlassian.bamboo.agent.elastic.server
Class RemoteElasticInstanceImpl

java.lang.Object
  extended by com.atlassian.bamboo.agent.elastic.server.RemoteElasticInstanceImpl
All Implemented Interfaces:
RemoteElasticInstance

public class RemoteElasticInstanceImpl
extends java.lang.Object
implements RemoteElasticInstance


Constructor Summary
RemoteElasticInstanceImpl(ElasticInstanceManager manager, ElasticAgentTunnelManager tunnelManager, ErrorHandler errorHandler, com.atlassian.aws.AWSAccount awsAccount, java.net.URL baseURL, int startupTimeoutSeconds, RemoteElasticInstanceListener listener, java.util.concurrent.Executor executor, java.security.KeyStore keyStore, ElasticConfiguration elasticConfiguration, com.atlassian.bamboo.agent.elastic.server.EBSVolumeSupervisorFactory ebsVolumeSupervisorFactory, LocalAgentManager localAgentManager, ElasticImageConfiguration elasticImageConfiguration)
           
 
Method Summary
 java.util.Collection<com.atlassian.aws.ec2.EBSVolume> getAttachedVolumes()
           
 ElasticImageConfiguration getConfiguration()
           
 com.atlassian.aws.ec2.RemoteEC2Instance getInstance()
           
 long getRemoteAgent()
           
 RemoteElasticInstanceState getState()
           
 void interruptDelayedTermination()
          Interrupts delayed termination process.
 boolean isAgentLoading()
           
 boolean isShutdownable()
           
 void setAgentLoading(boolean agentLoading)
           
 void setRemoteAgent(long agentId)
           
 void start()
           
 void terminate()
           
 void triggerDelayedTermination(long delaySeconds)
          Triggers delayed termination of elastic instance.
 boolean waitToLeaveState(RemoteElasticInstanceState state, long timeout, java.util.concurrent.TimeUnit timeUnit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteElasticInstanceImpl

public RemoteElasticInstanceImpl(ElasticInstanceManager manager,
                                 ElasticAgentTunnelManager tunnelManager,
                                 ErrorHandler errorHandler,
                                 com.atlassian.aws.AWSAccount awsAccount,
                                 java.net.URL baseURL,
                                 int startupTimeoutSeconds,
                                 RemoteElasticInstanceListener listener,
                                 java.util.concurrent.Executor executor,
                                 java.security.KeyStore keyStore,
                                 ElasticConfiguration elasticConfiguration,
                                 com.atlassian.bamboo.agent.elastic.server.EBSVolumeSupervisorFactory ebsVolumeSupervisorFactory,
                                 @NotNull
                                 LocalAgentManager localAgentManager,
                                 @NotNull
                                 ElasticImageConfiguration elasticImageConfiguration)
                          throws java.security.NoSuchAlgorithmException,
                                 java.io.IOException,
                                 java.security.cert.CertificateException,
                                 java.security.KeyStoreException,
                                 java.security.KeyManagementException,
                                 java.security.UnrecoverableKeyException
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
java.security.cert.CertificateException
java.security.KeyStoreException
java.security.KeyManagementException
java.security.UnrecoverableKeyException
Method Detail

getRemoteAgent

public long getRemoteAgent()
Specified by:
getRemoteAgent in interface RemoteElasticInstance

setRemoteAgent

public void setRemoteAgent(long agentId)
Specified by:
setRemoteAgent in interface RemoteElasticInstance
Parameters:
agentId - id of corresponding ElasticAgentDefinition.

isShutdownable

public boolean isShutdownable()
Specified by:
isShutdownable in interface RemoteElasticInstance

isAgentLoading

public boolean isAgentLoading()
Specified by:
isAgentLoading in interface RemoteElasticInstance

setAgentLoading

public void setAgentLoading(boolean agentLoading)
Specified by:
setAgentLoading in interface RemoteElasticInstance

start

public void start()
Specified by:
start in interface RemoteElasticInstance

terminate

public void terminate()
Specified by:
terminate in interface RemoteElasticInstance

waitToLeaveState

public boolean waitToLeaveState(RemoteElasticInstanceState state,
                                long timeout,
                                java.util.concurrent.TimeUnit timeUnit)
                         throws java.lang.InterruptedException
Specified by:
waitToLeaveState in interface RemoteElasticInstance
Throws:
java.lang.InterruptedException

getState

public RemoteElasticInstanceState getState()
Specified by:
getState in interface RemoteElasticInstance

getInstance

public com.atlassian.aws.ec2.RemoteEC2Instance getInstance()
Specified by:
getInstance in interface RemoteElasticInstance

getAttachedVolumes

@Nullable
public java.util.Collection<com.atlassian.aws.ec2.EBSVolume> getAttachedVolumes()
Specified by:
getAttachedVolumes in interface RemoteElasticInstance

getConfiguration

@NotNull
public ElasticImageConfiguration getConfiguration()
Specified by:
getConfiguration in interface RemoteElasticInstance

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 interface RemoteElasticInstance
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 interface RemoteElasticInstance


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.