Interface StatisticLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface StatisticLookupSession extends 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 Details

    • getUtilityId

      Id getUtilityId()
      Gets the Utility Id associated with this session.
      Returns:
      the Utility Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getUtility

      Gets the Utility associated with this session.
      Returns:
      the utility
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer metering operations.
      Returns:
      false if metering methods are not authorized, true otherwise
      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 - the Id of the Meter
      meteredObjectId - the Id of the metered object
      Returns:
      the date range of the available statistics
      Throws:
      NotFoundException - no Meter or metered object found with the given Id or no data available
      NullArgumentException - meterId or meteredObjectId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getStatistic

      Statistic getStatistic(Id meterId, Id meteredObjectId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets a statistic for the Meter and metered object for all available data.
      Parameters:
      meterId - the Id of the Meter
      meteredObjectId - the Id of the metered object
      Returns:
      the meter stat
      Throws:
      NotFoundException - no Meter or metered object found with the given Id
      NullArgumentException - meterId or meteredObjectId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 the Meter and metered object specified by its Id .
      Parameters:
      meterId - the Id of the Meter
      meteredObjectId - the Id of the metered object
      from - the start time
      to - the end time
      Returns:
      the meter stat
      Throws:
      InvalidArgumentException - to is less than from
      NotFoundException - no Meter or metered object found with the given Id or no data available within the given date range
      NullArgumentException - meterId, meteredObjectId, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 object IdList for all available data. In plenary mode, the returned list contains all of the readings specified in the Id list, in the order of the list, including duplicates, or an error results if an Id in 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 - the Id of the Meter
      meteredObjectIds - the Id of the metered object
      Returns:
      the returned Statistic list
      Throws:
      NotFoundException - meterId or an Id was not found
      NullArgumentException - meterId or meteredObjects is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 object IdList .In plenary mode, the returned list contains all of the statistics specified in the Id list, in the order of the list, including duplicates, or an error results if an Id in 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 - the Id of the Meter
      meteredObjectIds - the Id of the metered object
      from - the start time
      to - the end time
      Returns:
      the returned Statistic list
      Throws:
      InvalidArgumentException - to is less than from
      NotFoundException - meterId or an Id was not found or no data available within the given date range
      NullArgumentException - meterId, meteredObjects, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - the Id of the Meter
      meteredObjectId - the Id of the metered object
      from - the start time
      to - the end time
      interval - the interval
      Returns:
      the returned Statistic list
      Throws:
      InvalidArgumentException - to is less than from
      NotFoundException - meterId or an Id was not found or no data available within the given date range
      NullArgumentException - meterId, meteredObjectId, from, to or interval is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.