de.fzi.kadmos.cloud.aws
Class AWSWorker

java.lang.Object
  extended by de.fzi.kadmos.cloud.aws.AWSWorker
All Implemented Interfaces:
CloudWorker

public class AWSWorker
extends Object
implements CloudWorker

This class implements the CloudWorker interface in the AWS cloud. Parameters as following ( [] is the default value)

awsCredential path to a file containing the awsid and awssec separated by a breakline or whitespace
awsAMIID AMI to be used
awsKeyPair keypair to be used
awsSecurityGroup security group to be used (make sure to allow tcp on awsPort)
awsPort [6112]
awsShutDown [true]
awsServerInCloud [false] whether the server is located in the aws cloud (decides whether the public or the private dns is used)
awsInstanceType [m1.small] the amazon instance type
awsUserdata [""] userdata to be send to the aws instance
tcpHeartbeat [2000] timeout for the connection

Since:
1.1.0
Version:
1.3.0
Author:
Carsten Daenschel

Field Summary
static String AWS_DEFAULT_INSTANCE_TYPE
           
static String AWS_DEFAULT_PORT
           
static String AWS_DEFAULT_SERVER_IN_CLOUD
           
static String AWS_DEFAULT_SHUTDOWN
           
static String AWS_DEFAULT_USER_DATA
           
static String DEFAULT_TCP_HEARTBEAT_TIMEOUT
           
 
Constructor Summary
AWSWorker()
           
 
Method Summary
 Serializable receive()
          Waits for the next message from the worker.
 void send(Serializable msg)
          Sends the given object to the worker.
 void setParameter(Properties param)
          The given set of parameters will be used by this class to start and control the worker.
 void shutdown()
          Shuts down the worker.
 void startInstance()
          Starts the worker and connects to it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AWS_DEFAULT_INSTANCE_TYPE

public static final String AWS_DEFAULT_INSTANCE_TYPE
See Also:
Constant Field Values

AWS_DEFAULT_SERVER_IN_CLOUD

public static final String AWS_DEFAULT_SERVER_IN_CLOUD
See Also:
Constant Field Values

AWS_DEFAULT_PORT

public static final String AWS_DEFAULT_PORT
See Also:
Constant Field Values

AWS_DEFAULT_SHUTDOWN

public static final String AWS_DEFAULT_SHUTDOWN
See Also:
Constant Field Values

AWS_DEFAULT_USER_DATA

public static final String AWS_DEFAULT_USER_DATA
See Also:
Constant Field Values

DEFAULT_TCP_HEARTBEAT_TIMEOUT

public static final String DEFAULT_TCP_HEARTBEAT_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

AWSWorker

public AWSWorker()
Method Detail

setParameter

public void setParameter(Properties param)
Description copied from interface: CloudWorker
The given set of parameters will be used by this class to start and control the worker.

Specified by:
setParameter in interface CloudWorker
Parameters:
param - Parameters.

startInstance

public void startInstance()
                   throws CloudException
Description copied from interface: CloudWorker
Starts the worker and connects to it.

Specified by:
startInstance in interface CloudWorker
Throws:
CloudException

shutdown

public void shutdown()
              throws CloudException
Description copied from interface: CloudWorker
Shuts down the worker.

Specified by:
shutdown in interface CloudWorker
Throws:
CloudException

send

public void send(Serializable msg)
          throws CloudException
Description copied from interface: CloudWorker
Sends the given object to the worker.

Specified by:
send in interface CloudWorker
Parameters:
msg - Serializable object to be sent.
Throws:
CloudException

receive

public Serializable receive()
                     throws CloudException
Description copied from interface: CloudWorker
Waits for the next message from the worker. Blocks until a Message is received or a CloudException is thrown.

Specified by:
receive in interface CloudWorker
Throws:
CloudException


Copyright © 2012. All Rights Reserved.