Class UserMetadataService

All Implemented Interfaces:
MetadataService, net.solarnetwork.service.Identifiable, net.solarnetwork.settings.SettingsChangeObserver, net.solarnetwork.settings.SettingSpecifierProvider

public class UserMetadataService extends JsonHttpClientSupport implements MetadataService, net.solarnetwork.settings.SettingSpecifierProvider, net.solarnetwork.settings.SettingsChangeObserver
Implementation of MetadataService that uses SolarQuery to find user-level metadata.
Version:
1.0
Author:
matt
  • Field Details

    • USER_METADATA_PATH

      public static final String USER_METADATA_PATH
      The the user metadata path.
      See Also:
    • DEFAULT_CACHE_SECONDS

      public static final int DEFAULT_CACHE_SECONDS
      The cacheSeconds property default value.
      See Also:
  • Constructor Details

    • UserMetadataService

      public UserMetadataService(net.solarnetwork.service.OptionalService<SetupService> setupService)
      Constructor.
      Parameters:
      setupService - the setup service
  • Method Details

    • configurationChanged

      public void configurationChanged(Map<String,Object> properties)
      Specified by:
      configurationChanged in interface net.solarnetwork.settings.SettingsChangeObserver
    • getAllMetadata

      public net.solarnetwork.domain.datum.GeneralDatumMetadata getAllMetadata()
      Description copied from interface: MetadataService
      Get all metadata available.
      Specified by:
      getAllMetadata in interface MetadataService
      Returns:
      the metadata, or null if none available
    • getSettingUid

      public String getSettingUid()
      Specified by:
      getSettingUid in interface net.solarnetwork.settings.SettingSpecifierProvider
    • getSettingSpecifiers

      public List<net.solarnetwork.settings.SettingSpecifier> getSettingSpecifiers()
      Specified by:
      getSettingSpecifiers in interface net.solarnetwork.settings.SettingSpecifierProvider
    • setCacheSeconds

      public void setCacheSeconds(int cacheSeconds)
      Set the number of seconds to cache metadata.
      Parameters:
      cacheSeconds - the maximum number of seconds to cache metadata for, or anything less than 1 to disable
    • setToken

      public void setToken(String token)
      Set the SolarNetwork token to use.
      Parameters:
      token - the token to set
    • setTokenSecret

      public void setTokenSecret(String tokenSecret)
      Set the SolarNetwork token secret to use.
      Parameters:
      tokenSecret - the token secret to set