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

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

public class EC2ReservedPriceWatch
extends java.lang.Object
implements PriceWatch

This class provides access to the EC2 reserved prices that are inputted through CSV files to the broker

Author:
Vermeersch Kurt

Field Summary
static java.lang.String RESERVED_INPUT
          Location of the input files containing the reserved prices.
 
Constructor Summary
EC2ReservedPriceWatch()
          Constructor for EC2ReservedPriceWatch
EC2ReservedPriceWatch(java.lang.String inputLocation)
          Constructor for EC2ReservedPriceWatch
 
Method Summary
 ReservedPrice 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

RESERVED_INPUT

public static java.lang.String RESERVED_INPUT
Location of the input files containing the reserved prices.

Constructor Detail

EC2ReservedPriceWatch

public EC2ReservedPriceWatch()
Constructor for EC2ReservedPriceWatch


EC2ReservedPriceWatch

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

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

getPrice

public ReservedPrice 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