com.norbl.cbp.ppe
Class Ec2InstanceType

java.lang.Object
  extended by com.norbl.cbp.ppe.Ec2InstanceType
All Implemented Interfaces:
TableModelRowable, java.io.Serializable

public class Ec2InstanceType
extends java.lang.Object
implements TableModelRowable, java.io.Serializable

Some descriptive information about ec2 instance types. This class contains static functions for getting the list of Ec2InstanceTypes from s3 (and putting them there).

See Also:
Serialized Form

Nested Class Summary
static class Ec2InstanceType.VirtualizationType
           
 
Field Summary
 boolean clusterSupport
           
 java.lang.String description
           
 com.amazonaws.services.ec2.model.InstanceType instanceType
           
 int nCores
           
 double pricePiph
           
 double ramGB
           
 Ec2InstanceType.VirtualizationType vt
           
 
Constructor Summary
Ec2InstanceType(com.amazonaws.services.ec2.model.InstanceType instanceType, int nCores, double ramGB, boolean clusterSupport, Ec2InstanceType.VirtualizationType vt, double pricePiph, java.lang.String description)
           
 
Method Summary
 java.lang.Class getColumnClass(int colIndex)
           
 java.lang.String getColumnName(int colIndex)
           
 java.lang.Object getColumnValue(int colIndex)
           
 java.lang.String getDescription()
           
static Ec2InstanceType getEc2InstanceType(java.util.List<Ec2InstanceType> eits, com.amazonaws.services.ec2.model.InstanceType iType)
           
static com.amazonaws.services.ec2.model.InstanceType getInstanceType(java.lang.String instanceTypeName)
          NOTE/WARNING: there is a bug in the aws implementation of InstanceType.valueOf(java.lang.String).
static java.util.List<Ec2InstanceType> getInstanceTypes()
          Retrieves the instance types from s3.
 int getNColumns()
           
 boolean isFullySpecified()
           
 boolean isHvm()
           
static boolean isHvm(java.lang.String s)
           
 boolean isPv()
           
static boolean isPv(java.lang.String s)
          There may be an inconsistency in AWS's strings for virtualization type.
 void setColumnValue(int colIndex, java.lang.Object value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

instanceType

public com.amazonaws.services.ec2.model.InstanceType instanceType

vt

public Ec2InstanceType.VirtualizationType vt

nCores

public int nCores

ramGB

public double ramGB

clusterSupport

public boolean clusterSupport

pricePiph

public double pricePiph

description

public java.lang.String description
Constructor Detail

Ec2InstanceType

public Ec2InstanceType(com.amazonaws.services.ec2.model.InstanceType instanceType,
                       int nCores,
                       double ramGB,
                       boolean clusterSupport,
                       Ec2InstanceType.VirtualizationType vt,
                       double pricePiph,
                       java.lang.String description)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isPv

public boolean isPv()

isHvm

public boolean isHvm()

getDescription

public java.lang.String getDescription()

getInstanceType

public static com.amazonaws.services.ec2.model.InstanceType getInstanceType(java.lang.String instanceTypeName)
                                                                     throws java.lang.IllegalArgumentException
NOTE/WARNING: there is a bug in the aws implementation of InstanceType.valueOf(java.lang.String). It throws an exception on t1.micro even if it obtained from InstanceType.values().toString(). They've added a kluge method InstanceType.fromValue(java.lang.String) that solves the problem. That method is used in this function. All instance type translation should be done with this method only.

Parameters:
instanceTypeName -
Returns:
Throws:
java.lang.IllegalArgumentException

getEc2InstanceType

public static Ec2InstanceType getEc2InstanceType(java.util.List<Ec2InstanceType> eits,
                                                 com.amazonaws.services.ec2.model.InstanceType iType)
                                          throws java.io.FileNotFoundException,
                                                 java.io.IOException,
                                                 java.lang.NullPointerException
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.NullPointerException

isPv

public static boolean isPv(java.lang.String s)
There may be an inconsistency in AWS's strings for virtualization type. It may be that both 'pv' and 'paravitual' are used. So


isHvm

public static boolean isHvm(java.lang.String s)

getColumnClass

public java.lang.Class getColumnClass(int colIndex)
Specified by:
getColumnClass in interface TableModelRowable

getColumnName

public java.lang.String getColumnName(int colIndex)
Specified by:
getColumnName in interface TableModelRowable

getColumnValue

public java.lang.Object getColumnValue(int colIndex)
Specified by:
getColumnValue in interface TableModelRowable

getNColumns

public int getNColumns()
Specified by:
getNColumns in interface TableModelRowable

setColumnValue

public void setColumnValue(int colIndex,
                           java.lang.Object value)
Specified by:
setColumnValue in interface TableModelRowable

isFullySpecified

public boolean isFullySpecified()

getInstanceTypes

public static java.util.List<Ec2InstanceType> getInstanceTypes()
                                                        throws java.lang.Exception
Retrieves the instance types from s3.

Returns:
Throws:
java.lang.Exception