|
||||||||||
| 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.UsageReportFacadeImpl
public class UsageReportFacadeImpl
| Constructor Summary | |
|---|---|
UsageReportFacadeImpl()
|
|
| Method Summary | |
|---|---|
void |
addUsageReport(UsageReport report)
Process a usage report. |
void |
addUsageReports(List<UsageReport> reports)
Process batch of usage reports. |
ActivityFacade |
getActivityFacade()
|
ReportProcessingErrorHandler |
getErrorHandler()
|
List<Metric> |
getMetricsForResource(Long entityId)
Get a list of all Metrics used by the ResourceWithUsageByMetric
identified by resourceEntityId. |
double |
getRate(Long resourceEntityId,
Metric metric,
long instant)
Calculate the rate at an instant in time for the ResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and at the given instant. |
double |
getTotalPositiveRateChange(Long resourceEntityId,
Metric metric,
long startInstant,
long endInstant)
Aggregate all positive rate changes between startInstant and endInstant
for the ResourceWithUsageByMetric entity identified by resourceEntityId
and for a particular metric. |
double |
getUsage(Long resourceEntityId,
Metric metric,
long instant)
Calculate the usage at an instant in time for the ResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and at the given instant. |
List<UsageSummaryElement> |
getUsageElements(Long resourceEntityId,
Metric metric,
long start,
long end)
Get a list of UsageSummaryElements that represent a summary of usage for
a metric on a particular resource. |
double |
getUsageInPeriod(Long resourceEntityId,
Metric metric,
long startInstant,
long endInstant)
Calculate the usage that accumulated for the ResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and between the time period bounded by startInstant and
endInstant. |
int |
getUsageReportBatchSize()
|
UsageSummaryFacade |
getUsageSummaryFacade()
|
UsageSummaryDAO |
getUsDao()
|
UsageSummaryElementDAO |
getUseDao()
|
void |
setActivityFacade(ActivityFacade activityFacade)
|
void |
setErrorHandler(ReportProcessingErrorHandler errorHandler)
|
void |
setUsageReportBatchSize(int usageReportBatchSize)
|
void |
setUsageSummaryFacade(UsageSummaryFacade usageMethods)
|
void |
setUsDao(UsageSummaryDAO usDao)
|
void |
setUseDao(UsageSummaryElementDAO useDao)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UsageReportFacadeImpl()
| Method Detail |
|---|
public UsageSummaryFacade getUsageSummaryFacade()
public void setUsageSummaryFacade(UsageSummaryFacade usageMethods)
public ActivityFacade getActivityFacade()
public void setActivityFacade(ActivityFacade activityFacade)
public int getUsageReportBatchSize()
public void setUsageReportBatchSize(int usageReportBatchSize)
public UsageSummaryDAO getUsDao()
public void setUsDao(UsageSummaryDAO usDao)
public UsageSummaryElementDAO getUseDao()
public void setUseDao(UsageSummaryElementDAO useDao)
public ReportProcessingErrorHandler getErrorHandler()
public void setErrorHandler(ReportProcessingErrorHandler errorHandler)
public void addUsageReport(UsageReport report)
UsageReportFacade
addUsageReport in interface UsageReportFacadereport - the report to porcesspublic void addUsageReports(List<UsageReport> reports)
UsageReportFacade
addUsageReports in interface UsageReportFacadereports - the list of usage reports to process
public double getRate(Long resourceEntityId,
Metric metric,
long instant)
UsageReportFacadeResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and at the given instant.
getRate in interface UsageReportFacaderesourceEntityId - the entity id of the ResourceWithUsageByMetricmetric - the Metric of interestinstant - the time instant in milliseconds
public double getTotalPositiveRateChange(Long resourceEntityId,
Metric metric,
long startInstant,
long endInstant)
UsageReportFacadestartInstant and endInstant
for the ResourceWithUsageByMetric entity identified by resourceEntityId
and for a particular metric.
Note that only positive rate changes are included in the result. Also, a rate change at
startInstant is excluded whereas a rate change at endInstant is
included.
getTotalPositiveRateChange in interface UsageReportFacaderesourceEntityId - the entity id of the ResourceWithUsageByMetricmetric - the Metric of intereststartInstant - the time instant in milliseconds at the start of the periodendInstant - the time instant in milliseconds at the end of the period
public double getUsage(Long resourceEntityId,
Metric metric,
long instant)
UsageReportFacadeResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and at the given instant.
getUsage in interface UsageReportFacaderesourceEntityId - the entity id of the ResourceWithUsageByMetricmetric - the Metric of interestinstant - the time instant in milliseconds
public double getUsageInPeriod(Long resourceEntityId,
Metric metric,
long startInstant,
long endInstant)
UsageReportFacadeResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and between the time period bounded by startInstant and
endInstant.
getUsageInPeriod in interface UsageReportFacaderesourceEntityId - the entity id of the ResourceWithUsageByMetricmetric - the Metric of intereststartInstant - the time instant in milliseconds at the start of the periodendInstant - the time instant in milliseconds at the end of the period
public List<UsageSummaryElement> getUsageElements(Long resourceEntityId,
Metric metric,
long start,
long end)
UsageReportFacadeUsageSummaryElements that represent a summary of usage for
a metric on a particular resource. start and end
are both optional and can be used to constrain by time, the range of elements returned.
Note that each UsageSummaryElement returned will have absolute rate and
usage set correctly. This may be different from the representation in the database.
getUsageElements in interface UsageReportFacaderesourceEntityId - the entity id of the ResourceWithUsageByMetricmetric - the Metric of intereststart - the time at which to start the summary or -1 if the summary should
start from the beginningend - the time at which to end the summary or -1 if all elements from start
onwards should be retrieved.
public List<Metric> getMetricsForResource(Long entityId)
UsageReportFacadeMetrics used by the ResourceWithUsageByMetric
identified by resourceEntityId.
getMetricsForResource in interface UsageReportFacadeentityId - the resource id for the owning ResourceWithUsageByMetric
List of Metrics associated with the resource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||