Class HttpMillisecondStoreDataProvider

java.lang.Object
org.lukashian.store.external.ExternalResourceMillisecondStoreDataProvider
org.lukashian.store.external.http.HttpMillisecondStoreDataProvider
All Implemented Interfaces:
MillisecondStoreDataProvider
Direct Known Subclasses:
StandardEarthHttpMillisecondStoreDataProvider

public class HttpMillisecondStoreDataProvider extends ExternalResourceMillisecondStoreDataProvider
This implementation of ExternalResourceMillisecondStoreDataProvider loads binary streams of long values from an HTTP location.

Please see ExternalResourceMillisecondStoreDataProvider for more details regarding the external resource mechanism.

  • Constructor Details

    • HttpMillisecondStoreDataProvider

      public HttpMillisecondStoreDataProvider(String baseUrl, String unixEpochOffsetUrlExtension, String yearEpochMillisecondsUrlExtension, String dayEpochMillisecondsUrlExtension)
    • HttpMillisecondStoreDataProvider

      public HttpMillisecondStoreDataProvider(String baseUrl)
  • Method Details

    • loadMillisecondsByteArray

      protected byte[] loadMillisecondsByteArray(String url) throws IOException, InterruptedException
      Description copied from class: ExternalResourceMillisecondStoreDataProvider
      Loads an array of bytes from the specified location. This location is a concatenation of the base location and one of the extensions, depending on which of the values needs loading.

      This method needs to return a binary stream from the specified location. This binary stream should encode the long values that represent the milliseconds. Each consecutive 8 bytes of the stream should correspond to an individual millisecond. This binary stream is then decoded into an array of longs. For the unix epoch offset, only a single long value (i.e. 8 bytes) should be returned in the binary stream.

      Specified by:
      loadMillisecondsByteArray in class ExternalResourceMillisecondStoreDataProvider
      Throws:
      IOException
      InterruptedException