uk.ac.soton.itinnovation.grid.service.sla.upgrade.v5_1_x.model
Class UsageSummary5_1alpha

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.service.sla.upgrade.v5_1_x.model.UsageSummary5_1alpha

public class UsageSummary5_1alpha
extends Object


Constructor Summary
UsageSummary5_1alpha()
           
UsageSummary5_1alpha(Metric metric)
           
 
Method Summary
 void add(CumulativeUsageReport report)
           
 void add(InstantaneousRateReport report)
           
 void add(InstantaneousUsageReport report)
           
 void add(Usage report)
           
 Long getId()
           
 double getMaxRate(Calendar start, Calendar end)
          Get the maximum rate between two times.
 Metric getMetric()
           
 double getRate(Calendar start)
          Get the rate at a time.
 double getRateIncrease(Calendar start, Calendar end)
          Return the gross rate increase over a time period.
 double getUsage(Calendar start)
          Get the usage at a time.
 double getUsage(Calendar start, Calendar end)
          Get the difference between getUsage(end) and getUsage(start).
 List<UsageSummaryElement5_1alpha> getUsageEvents()
           
 List<UsageSummaryElement5_1alpha> getUsageEvents(Calendar since)
           
 List<UsageSummaryElement5_1alpha> getUsageEvents(Calendar start, Calendar end)
          Get a list of UsageSummaryElements (time, usage, rate) for the time period start to end.
 void setId(Long argId)
           
 void setMetric(Metric argMetric)
           
 void setUsageEvents(List<UsageSummaryElement5_1alpha> argUsageEvents)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsageSummary5_1alpha

public UsageSummary5_1alpha()

UsageSummary5_1alpha

public UsageSummary5_1alpha(Metric metric)
Method Detail

getId

public Long getId()

setId

public void setId(Long argId)

getMetric

public Metric getMetric()

setMetric

public void setMetric(Metric argMetric)

getUsageEvents

public List<UsageSummaryElement5_1alpha> getUsageEvents()

setUsageEvents

public void setUsageEvents(List<UsageSummaryElement5_1alpha> argUsageEvents)

getUsageEvents

public List<UsageSummaryElement5_1alpha> getUsageEvents(Calendar since)

getUsageEvents

public List<UsageSummaryElement5_1alpha> getUsageEvents(Calendar start,
                                                        Calendar end)
Get a list of UsageSummaryElements (time, usage, rate) for the time period start to end. An element will be included for the start time and the end time (whether or not there were actual events at those times). If start is null then it is taken to be -infinity. If end is null then it is taken to be +infinity. No events are included for +/- infinity.


add

public void add(Usage report)

add

public void add(InstantaneousRateReport report)

add

public void add(InstantaneousUsageReport report)

add

public void add(CumulativeUsageReport report)

getUsage

public double getUsage(Calendar start)
Get the usage at a time. The method will extrapolate using the recorded rate. Any time is safe, 0 is returned for times before any recorded usage.


getUsage

public double getUsage(Calendar start,
                       Calendar end)
Get the difference between getUsage(end) and getUsage(start). This is slightly more efficient than two calls to the getUsage(Calendar) method as it assumes that the end is not before the start and starts the search for the end interval at the start interval.


getRate

public double getRate(Calendar start)
Get the rate at a time. Any time is safe. 0 is returned for times before recorded usage.


getMaxRate

public double getMaxRate(Calendar start,
                         Calendar end)
Get the maximum rate between two times. If the second argument is null then it is taken to be +infinity.


getRateIncrease

public double getRateIncrease(Calendar start,
                              Calendar end)
Return the gross rate increase over a time period. Add up all the rate increases, ignore rate decreases.



Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.