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

java.lang.Object
  extended by be.ac.ua.broker.input.pricing.PricingManager

public class PricingManager
extends java.lang.Object

This class provides static access to the on-demand, reserved and spot prices that are provided to the broker using input files. This class redirects calls to the appropriate PriceWatch implementations.

Author:
Vermeersch Kurt

Constructor Summary
PricingManager()
           
 
Method Summary
static OnDemandPrice getOnDemandPrice(InstanceSpecification inst)
          Get the on-demand price for a given instance specification
static ReservedPrice getReservedPrice(InstanceSpecification inst)
          Get the reserved price for a given instance specification
static SpotPrice getSpotPrice(InstanceSpecification inst, java.util.Date timestamp)
          Get the spot price for a given instance specification at a given moment in time.
static org.apache.commons.math.stat.descriptive.DescriptiveStatistics getStatisticsSpotPrice(InstanceSpecification inst, java.util.Date start, java.util.Date end)
          Getter for the spot price history statistics within the given time frame for the given instance specification
static SpotPrice getTippingPointSpotPrice(InstanceSpecification inst, java.util.Date start, java.util.Date end, int numberToSkip)
          Getter for the tipping spot bid price such that all task hours can be run on the cheapest spot price hours, the number of hours that can be skipped is given as well as the instance specification and time frame to determine the spot price tipping point for.
static void setup()
          Initialize/setup the price watches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PricingManager

public PricingManager()
Method Detail

setup

public static void setup()
Initialize/setup the price watches


getOnDemandPrice

public static OnDemandPrice getOnDemandPrice(InstanceSpecification inst)
                                      throws InstanceNotAvailableException
Get the on-demand price for a given instance specification

Parameters:
inst - the instance specification to get the on-demand price for
Returns:
the on-demand price for the provided instance
Throws:
InstanceNotAvailableException

getReservedPrice

public static ReservedPrice getReservedPrice(InstanceSpecification inst)
                                      throws InstanceNotAvailableException
Get the reserved price for a given instance specification

Parameters:
inst - the instance specification to get the reserved price for
Returns:
the reserved price for the provided instance
Throws:
InstanceNotAvailableException

getSpotPrice

public static SpotPrice getSpotPrice(InstanceSpecification inst,
                                     java.util.Date timestamp)
                              throws InstanceNotAvailableException
Get the spot price for a given instance specification at a given moment in time.

Parameters:
inst - the instance specification to get the spot price for
Returns:
the spot price for the provided instance and moment in time
Throws:
InstanceNotAvailableException

getStatisticsSpotPrice

public static org.apache.commons.math.stat.descriptive.DescriptiveStatistics getStatisticsSpotPrice(InstanceSpecification inst,
                                                                                                    java.util.Date start,
                                                                                                    java.util.Date end)
                                                                                             throws InstanceNotAvailableException
Getter for the spot price history statistics within the given time frame for the given instance specification

Parameters:
inst - the instance specification to get the spot price statistics for
start - the start date of the time frame to get the spot price statistics for
end - the end date of the time frame to get the spot price statistics for
Returns:
the spot price statistics that were requested for a certain instance specification and time frame
Throws:
InstanceNotAvailableException

getTippingPointSpotPrice

public static SpotPrice getTippingPointSpotPrice(InstanceSpecification inst,
                                                 java.util.Date start,
                                                 java.util.Date end,
                                                 int numberToSkip)
                                          throws InstanceNotAvailableException
Getter for the tipping spot bid price such that all task hours can be run on the cheapest spot price hours, the number of hours that can be skipped is given as well as the instance specification and time frame to determine the spot price tipping point for.

Parameters:
inst - the instance specification to get the bid spot price for
start - the start date of the time interval to get the bid spot price for
end - the end date of the time interval to get the bid spot price for
index - the number of hours that can be skipped, the spot instance does not need to be in use
Returns:
the appropriate spot bid price
Throws:
InstanceNotAvailableException