|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UsageSummaryFacade
Facade for methods related to usage report processing and querying usage.
| Field Summary | |
|---|---|
static Object |
USAGE_SUMMARY_CREATION_LOCK
Lock to use when creating usage summaries. |
| Method Summary | |
|---|---|
void |
addActivityUsageReport(Long usageSummaryId,
UsageReport report)
Add a UsageReport to a usage summary uniquely identified by usageSummaryId. |
void |
addRate(Long usageSummaryId,
long instant,
double rateDelta)
This can be used to add a rate directly to a UsageSummary
at a particular instant. |
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. |
| Field Detail |
|---|
static final Object USAGE_SUMMARY_CREATION_LOCK
| Method Detail |
|---|
Long getOrCreateUsageSummary(Long resourceEntityId,
Metric metric)
UsageSummary instance, as required.
Note that this method understands the ResourcePool-SLA-Activity hierarchy and will
create a UsageSummary for each ancestor resource where appropriate.
resourceEntityId - the entity ID for the resourcemetric - the metric
UsageSummary
RuntimeException - if there is no such entity with id resourceEntityId
Map<ResourceAndMetric,Long> getOrCreateUsageSummaries(Set<ResourceAndMetric> resourceAndMetrics,
Map<ResourceAndMetric,Throwable> errors)
UsageSummary 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.
resourceAndMetrics - 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.
void addActivityUsageReport(Long usageSummaryId,
UsageReport report)
UsageReport 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.
usageSummaryId - the ID for the UsageSummaryreport - the usage report to add
void addRate(Long usageSummaryId,
long instant,
double rateDelta)
UsageSummary
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||