Interface DatumService

All Known Implementing Classes:
DefaultDatumService

public interface DatumService
API for a service that supports node-wide datum information.
Since:
1.89
Version:
1.1
Author:
matt
  • Method Summary

    Modifier and Type
    Method
    Description
    net.solarnetwork.domain.datum.DatumMetadataOperations
    Get the metadata for a given datum stream.
    Collection<net.solarnetwork.domain.datum.DatumMetadataOperations>
    datumMetadata(Set<String> sourceIdFilter)
    Get the metadata for a set of datum streams matching a filter.
    <T extends NodeDatum>
    T
    latest(String sourceId, Class<T> type)
    Get the latest available datum of a given type, optionally filtered by source IDs.
    <T extends NodeDatum>
    Collection<T>
    latest(Set<String> sourceIdFilter, Class<T> type)
    Get the latest available datum of a given type, optionally filtered by source IDs.
    <T extends NodeDatum>
    T
    offset(String sourceId, int offset, Class<T> type)
    Get an offset from the latest available datum of a given type, optionally filtered by source IDs.
    <T extends NodeDatum>
    T
    offset(String sourceId, Instant timestamp, int offset, Class<T> type)
    Get a datum offset from a given timestamp.
    <T extends NodeDatum>
    Collection<T>
    offset(Set<String> sourceIdFilter, int offset, Class<T> type)
    Get an offset from the latest available datum of a given type, optionally filtered by source IDs.
    <T extends NodeDatum>
    Collection<T>
    offset(Set<String> sourceIdFilter, Instant timestamp, int offset, Class<T> type)
    Get datum offset from a given timestamp, optionally filtered by source IDs.
  • Method Details

    • latest

      <T extends NodeDatum> Collection<T> latest(Set<String> sourceIdFilter, Class<T> type)
      Get the latest available datum of a given type, optionally filtered by source IDs.

      This is equivalent to calling offset(sourceIdFilter, 0, type).

      Type Parameters:
      T - the type of datum to get
      Parameters:
      sourceIdFilter - an optional set of Ant-style source ID patterns to filter by
      type - the type of datum
      Returns:
      the matching datum, never null
      See Also:
    • latest

      <T extends NodeDatum> T latest(String sourceId, Class<T> type)
      Get the latest available datum of a given type, optionally filtered by source IDs.

      This is equivalent to calling offset(sourceIdFilter, 0, type).

      Type Parameters:
      T - the type of datum to get
      Parameters:
      sourceId - the source ID to find
      type - the type of datum
      Returns:
      the matching datum, never null
      Since:
      1.1
      See Also:
    • offset

      <T extends NodeDatum> Collection<T> offset(Set<String> sourceIdFilter, int offset, Class<T> type)
      Get an offset from the latest available datum of a given type, optionally filtered by source IDs.
      Type Parameters:
      T - the type of datum to get
      Parameters:
      sourceIdFilter - an optional set of Ant-style source ID patterns to filter by; use null or an empty set to return all available sources
      offset - the offset from the latest, 0 being the latest and 1 the next later, and so on
      type - the type of datum
      Returns:
      the matching datum, never null
      Since:
      1.1
    • offset

      <T extends NodeDatum> T offset(String sourceId, int offset, Class<T> type)
      Get an offset from the latest available datum of a given type, optionally filtered by source IDs.
      Type Parameters:
      T - the type of datum to get
      Parameters:
      sourceId - the source ID to find
      offset - the offset from the latest, 0 being the latest and 1 the next later, and so on
      type - the type of datum
      Returns:
      the matching datum, never null
      Since:
      1.1
    • offset

      <T extends NodeDatum> Collection<T> offset(Set<String> sourceIdFilter, Instant timestamp, int offset, Class<T> type)
      Get datum offset from a given timestamp, optionally filtered by source IDs.
      Type Parameters:
      T - the type of datum to get
      Parameters:
      sourceIdFilter - an optional set of Ant-style source ID patterns to filter by; use null or an empty set to return all available sources
      timestamp - the timestamp to reference
      offset - the offset from timestamp, 0 being the latest and 1 the next later, and so on
      type - the type of datum
      Returns:
      the matching datum, never null
      Since:
      1.1
    • offset

      <T extends NodeDatum> T offset(String sourceId, Instant timestamp, int offset, Class<T> type)
      Get a datum offset from a given timestamp.
      Type Parameters:
      T - the type of datum to get
      Parameters:
      sourceId - the source ID of the datum to find
      timestamp - the timestamp to reference
      offset - the offset from timestamp, 0 being the latest and 1 the next later, and so on
      type - the type of datum
      Returns:
      the datum, or null if no such datum is available
    • datumMetadata

      net.solarnetwork.domain.datum.DatumMetadataOperations datumMetadata(String sourceId)
      Get the metadata for a given datum stream.
      Parameters:
      sourceId - the source ID of the datum metadata to get
      Returns:
      the metadata, or null if no such metadata is available
      Since:
      1.1
    • datumMetadata

      Collection<net.solarnetwork.domain.datum.DatumMetadataOperations> datumMetadata(Set<String> sourceIdFilter)
      Get the metadata for a set of datum streams matching a filter.
      Parameters:
      sourceIdFilter - an optional set of Ant-style source ID patterns to filter by; use null or an empty set to return all available sources
      Returns:
      the matching metadata, never null
      Since:
      1.1