|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.soton.itinnovation.grid.service.sla.bizfacade.UsageSummaryFacadeImpl
public class UsageSummaryFacadeImpl
| Field Summary |
|---|
| Fields inherited from interface uk.ac.soton.itinnovation.grid.service.sla.bizfacade.UsageSummaryFacade |
|---|
USAGE_SUMMARY_CREATION_LOCK |
| Constructor Summary | |
|---|---|
UsageSummaryFacadeImpl()
|
|
| Method Summary | |
|---|---|
protected void |
addActivityCumulativeUsageReport(UsageSummary usageSummary,
UsageReport report)
|
protected void |
addActivityInstantUsageReport(UsageSummary usageSummary,
UsageReport report)
|
protected void |
addActivityRateReport(UsageSummary usageSummary,
UsageReport report)
|
void |
addActivityUsageReport(Long usageSummaryId,
UsageReport report)
Add a UsageReport to a usage summary uniquely identified by usageSummaryId. |
protected UsageSummaryElement |
addElementForInstantUsageReport(UsageSummary usageSummary,
long instant,
double usageDelta)
|
UsageSummaryElement |
addElementForRateReport(UsageSummaryElement element,
UsageSummaryElement prevEl,
double prevRate,
UsageSummary usageSummary,
double rateDelta)
|
protected void |
addInstantUsageToElementAndLaterElements(UsageSummaryElement element,
double deltaUsage)
|
void |
addRate(Long usageSummaryId,
long instant,
double rateDelta)
This can be used to add a rate directly to a UsageSummary
at a particular instant. |
protected Long |
createUsageSummary(ResourceWithUsageByMetric res,
Long parentUsageSummaryId,
Metric metric)
|
Map<ResourceAndMetric,Long> |
getOrCreateUsageSummaries(Set<ResourceAndMetric> resourceAndMetrics,
Map<ResourceAndMetric,Throwable> errors)
Get or create a UsageSummary instance, as required, for each of the
ResourceWithMetric pairs in the resourceAndMetrics set. |
Long |
getOrCreateUsageSummary(Long resourceEntityId,
Metric metric)
Get or create a UsageSummary instance, as required. |
ResourceWithUsageByMetricDAO |
getResDao()
|
UsageSummaryDAO |
getUsDao()
|
UsageSummaryElementDAO |
getUseDao()
|
void |
setResDao(ResourceWithUsageByMetricDAO resDao)
|
void |
setUsDao(UsageSummaryDAO usDao)
|
void |
setUseDao(UsageSummaryElementDAO useDao)
|
protected void |
updateRateDependentUsageOnLaterElements(UsageSummaryElement prevElement,
UsageSummaryElement currentElement,
double prevElRate)
This method updates rate-dependent usage on later elements. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UsageSummaryFacadeImpl()
| Method Detail |
|---|
public UsageSummaryDAO getUsDao()
public void setUsDao(UsageSummaryDAO usDao)
public UsageSummaryElementDAO getUseDao()
public void setUseDao(UsageSummaryElementDAO useDao)
public ResourceWithUsageByMetricDAO getResDao()
public void setResDao(ResourceWithUsageByMetricDAO resDao)
public Long getOrCreateUsageSummary(Long resourceEntityId,
Metric metric)
UsageSummaryFacadeUsageSummary instance, as required.
Note that this method understands the ResourcePool-SLA-Activity hierarchy and will
create a UsageSummary for each ancestor resource where appropriate.
getOrCreateUsageSummary in interface UsageSummaryFacaderesourceEntityId - the entity ID for the resourcemetric - the metric
UsageSummary
public Map<ResourceAndMetric,Long> getOrCreateUsageSummaries(Set<ResourceAndMetric> resourceAndMetrics,
Map<ResourceAndMetric,Throwable> errors)
UsageSummaryFacadeUsageSummary instance, as required, for each of the
ResourceWithMetric pairs in the resourceAndMetrics set.
Note that this method understands the ResourcePool-SLA-Activity hierarchy and gets
or creates a UsageSummary for each ancestor resource also.
Therefore, if an Activity and a Metric are passed as a
ResourceAndMetric, three UsageSummarys will be retrieved
or created: one each for the Activity, its parent SLA, and the SLAs
parent ResourcePool's usagePool.
This method does not throw an exception if there is a ResourceAndMetric
passed in the resourceAndMetrics argument for which there is no corresponding
resource in the database. In this case, there will be no corresponding value in the
returned Map.
getOrCreateUsageSummaries in interface UsageSummaryFacaderesourceAndMetrics - the list of ResourceWithMetric pairs.errors - Map of ResourceAndMetric to Throwable. If errors are generated when
getting or retrieving a UsageSummary and entry is added to the map. This allows
processing of other elements in the list to continue.
protected Long createUsageSummary(ResourceWithUsageByMetric res,
Long parentUsageSummaryId,
Metric metric)
public void addActivityUsageReport(Long usageSummaryId,
UsageReport report)
UsageSummaryFacadeUsageReport to a usage summary uniquely identified by usageSummaryId.
Note that this method understands the ResourcePool-SLA-Activity hierarchy and
adds the UsageReport for each ancestor resource also.
addActivityUsageReport in interface UsageSummaryFacadeusageSummaryId - the ID for the UsageSummaryreport - the usage report to add
public void addRate(Long usageSummaryId,
long instant,
double rateDelta)
UsageSummaryFacadeUsageSummary
at a particular instant. The rate delta will also be added to parent
UsageSummarys.
Currently, this is used when creating an SLA and associating it with a ResourcePool's allocation pool only.
addRate in interface UsageSummaryFacade
protected void addActivityRateReport(UsageSummary usageSummary,
UsageReport report)
protected void addActivityInstantUsageReport(UsageSummary usageSummary,
UsageReport report)
protected UsageSummaryElement addElementForInstantUsageReport(UsageSummary usageSummary,
long instant,
double usageDelta)
protected void addInstantUsageToElementAndLaterElements(UsageSummaryElement element,
double deltaUsage)
protected void addActivityCumulativeUsageReport(UsageSummary usageSummary,
UsageReport report)
public UsageSummaryElement addElementForRateReport(UsageSummaryElement element,
UsageSummaryElement prevEl,
double prevRate,
UsageSummary usageSummary,
double rateDelta)
protected void updateRateDependentUsageOnLaterElements(UsageSummaryElement prevElement,
UsageSummaryElement currentElement,
double prevElRate)
prevElement - the previous element. This is the newly inserted element on the first roundcurrentElement - the next element (this can be null). If null it will be discovered.prevElRate - the absolute rate at prevElement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||