be.ac.ua.broker.input.pricing
Class EC2OnDemandPriceWatch

java.lang.Object
  extended by be.ac.ua.broker.input.pricing.EC2OnDemandPriceWatch
All Implemented Interfaces:
PriceWatch

public class EC2OnDemandPriceWatch
extends java.lang.Object
implements PriceWatch

This class provides access to the EC2 on-demand prices that are inputted through CSV files to the broker

Author:
Vermeersch Kurt

Field Summary
static java.lang.String ONDEMAND_INPUT
          Location of the input files containing the on-demand prices.
 
Constructor Summary
EC2OnDemandPriceWatch()
          Constructor for EC2OnDemandPriceWatch
EC2OnDemandPriceWatch(java.lang.String inputLocation)
          Constructor for EC2OnDemandPriceWatch
 
Method Summary
 OnDemandPrice getPrice(InstanceSpecification inst)
          Getter for the price of the given instance using the pricing model associated with the PriceWatch implementation
 Price getPrice(InstanceSpecification inst, java.util.Date timestamp)
          Getter for the price of the given instance at a certain moment in time using the pricing model associated with the PriceWatch implementation
 java.lang.String getPricingModel()
           
 void update()
          Update the prices that are returned by the PriceWatch implementation, reread prices from CSV files for example
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONDEMAND_INPUT

public static java.lang.String ONDEMAND_INPUT
Location of the input files containing the on-demand prices.

Constructor Detail

EC2OnDemandPriceWatch

public EC2OnDemandPriceWatch()
Constructor for EC2OnDemandPriceWatch


EC2OnDemandPriceWatch

public EC2OnDemandPriceWatch(java.lang.String inputLocation)
Constructor for EC2OnDemandPriceWatch

Parameters:
inputLocation - the location of the input files containing the on-demand prices.
Method Detail

getPrice

public OnDemandPrice getPrice(InstanceSpecification inst)
                       throws InstanceNotAvailableException
Description copied from interface: PriceWatch
Getter for the price of the given instance using the pricing model associated with the PriceWatch implementation

Specified by:
getPrice in interface PriceWatch
Parameters:
inst - the instance specification to get the price for
Returns:
the price for the given instance
Throws:
InstanceNotAvailableException

update

public void update()
Description copied from interface: PriceWatch
Update the prices that are returned by the PriceWatch implementation, reread prices from CSV files for example

Specified by:
update in interface PriceWatch

getPricingModel

public java.lang.String getPricingModel()
Specified by:
getPricingModel in interface PriceWatch
Returns:
name of the pricing model this access point was created for

getPrice

public Price getPrice(InstanceSpecification inst,
                      java.util.Date timestamp)
               throws InstanceNotAvailableException
Description copied from interface: PriceWatch
Getter for the price of the given instance at a certain moment in time using the pricing model associated with the PriceWatch implementation

Specified by:
getPrice in interface PriceWatch
Parameters:
inst - the instance specification to get the price for
timestamp - time to get the price for
Returns:
the price for the given instance at the given moment in time
Throws:
InstanceNotAvailableException