Interface StatisticLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session is used to retrieve statistics from a meter.
This lookup session defines several views:
- comparative view: elements may be silently omitted or re-ordered
- plenary view: provides a complete result set or is an error condition
- federated utility view: includes meters in utilities which are children of this utility in the utility hierarchy
- isolated utility view: restricts lookups to this utility only
- bounded metered view: limits the statistics to the lifetime of the metered object
- unbounded metered view: readings factored into statistics outside the lifetime of the metered object are zero
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can retrieve meter statistics.getAvailableDateRange(Id meterId, Id meteredObjectId) Gets the date range of the available statistics for a metered object.getStatistic(Id meterId, Id meteredObjectId) Gets a statistic for theMeterand metered object for all available data.getStatisticByDate(Id meterId, Id meteredObjectId, DateTime from, DateTime to) Gets a statistic within a period of time of theMeterand metered object specified by itsId.getStatistics(Id meterId, IdList meteredObjectIds) Gets the statistics for the given metered objectIdListfor all available data.getStatisticsAtInterval(Id meterId, Id meteredObjectId, DateTime from, DateTime to, DateTimeResolution interval) Gets the statistics for a metered object within a period of time at consecutive specified intervals.getStatisticsByDate(Id meterId, IdList meteredObjectIds, DateTime from, DateTime to) Gets the statistics within a period of time corresponding to the given metered objectIdList.In plenary mode, the returned list contains all of the statistics specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible.Gets theUtilityassociated with this session.Gets theUtilityIdassociated with this session.voidIf the supplied dates are beyond the lifetime of the metered object, bound the statistics to the dates of the lifetime.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of the returns is desired.voidIf the supplied dates are beyond the lifetime of the metered object, the readings that do not exist are zero.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getUtilityId
Id getUtilityId()Gets theUtilityIdassociated with this session.- Returns:
- the
Utility Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getUtility
Gets theUtilityassociated with this session.- Returns:
- the utility
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canGetMeterStatistics
boolean canGetMeterStatistics()Tests if this user can retrieve meter statistics. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer metering operations.- Returns:
falseif metering methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeMeterView
void useComparativeMeterView()The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.- Compliance:
mandatory- This method is must be implemented.
-
usePlenaryMeterView
void usePlenaryMeterView()A complete view of the returns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.- Compliance:
mandatory- This method is must be implemented.
-
useFederatedUtilityView
void useFederatedUtilityView()Federates the view for methods in this session. A federated view will include meters in utilities which are children of this utility in the utility hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedUtilityView
void useIsolatedUtilityView()Isolates the view for methods in this session. An isolated view restricts retrievals to this utility only.- Compliance:
mandatory- This method is must be implemented.
-
useBoundedMeteredView
void useBoundedMeteredView()If the supplied dates are beyond the lifetime of the metered object, bound the statistics to the dates of the lifetime.- Compliance:
mandatory- This method is must be implemented.
-
useUnboundedMeteredView
void useUnboundedMeteredView()If the supplied dates are beyond the lifetime of the metered object, the readings that do not exist are zero.- Compliance:
mandatory- This method is must be implemented.
-
getAvailableDateRange
DateTimeInterval getAvailableDateRange(Id meterId, Id meteredObjectId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the date range of the available statistics for a metered object.- Parameters:
meterId- theIdof theMetermeteredObjectId- theIdof the metered object- Returns:
- the date range of the available statistics
- Throws:
NotFoundException- noMeteror metered object found with the givenIdor no data availableNullArgumentException-meterIdormeteredObjectIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStatistic
Statistic getStatistic(Id meterId, Id meteredObjectId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a statistic for theMeterand metered object for all available data.- Parameters:
meterId- theIdof theMetermeteredObjectId- theIdof the metered object- Returns:
- the meter stat
- Throws:
NotFoundException- noMeteror metered object found with the givenIdNullArgumentException-meterIdormeteredObjectIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStatisticByDate
Statistic getStatisticByDate(Id meterId, Id meteredObjectId, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a statistic within a period of time of theMeterand metered object specified by itsId.- Parameters:
meterId- theIdof theMetermeteredObjectId- theIdof the metered objectfrom- the start timeto- the end time- Returns:
- the meter stat
- Throws:
InvalidArgumentException-tois less thanfromNotFoundException- noMeteror metered object found with the givenIdor no data available within the given date rangeNullArgumentException-meterId, meteredObjectId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStatistics
StatisticList getStatistics(Id meterId, IdList meteredObjectIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the statistics for the given metered objectIdListfor all available data. In plenary mode, the returned list contains all of the readings specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible statistics may be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
meterId- theIdof theMetermeteredObjectIds- theIdof the metered object- Returns:
- the returned
Statisticlist - Throws:
NotFoundException-meterIdor anId wasnot foundNullArgumentException-meterIdormeteredObjectsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStatisticsByDate
StatisticList getStatisticsByDate(Id meterId, IdList meteredObjectIds, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the statistics within a period of time corresponding to the given metered objectIdList.In plenary mode, the returned list contains all of the statistics specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible statistics or statistics not contained within the given date range may be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
meterId- theIdof theMetermeteredObjectIds- theIdof the metered objectfrom- the start timeto- the end time- Returns:
- the returned
Statisticlist - Throws:
InvalidArgumentException-tois less thanfromNotFoundException-meterIdor anId wasnot found or no data available within the given date rangeNullArgumentException-meterId, meteredObjects, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStatisticsAtInterval
StatisticList getStatisticsAtInterval(Id meterId, Id meteredObjectId, DateTime from, DateTime to, DateTimeResolution interval) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the statistics for a metered object within a period of time at consecutive specified intervals. In plenary mode, the returned list contains all of the statistics requested or an error results data in the supplied date range is not found or inaccessible. Otherwise, inaccessible statistics or statistics not contained within the given date range may be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
meterId- theIdof theMetermeteredObjectId- theIdof the metered objectfrom- the start timeto- the end timeinterval- the interval- Returns:
- the returned
Statisticlist - Throws:
InvalidArgumentException-tois less thanfromNotFoundException-meterIdor anId wasnot found or no data available within the given date rangeNullArgumentException-meterId, meteredObjectId, from, toorintervalisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-