Class UserMetadataService
java.lang.Object
net.solarnetwork.service.support.BasicIdentifiable
net.solarnetwork.node.service.support.BaseIdentifiable
net.solarnetwork.node.service.support.HttpClientSupport
net.solarnetwork.node.service.support.JsonHttpClientSupport
net.solarnetwork.node.service.support.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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intThecacheSecondsproperty default value.static final StringThe the user metadata path.Fields inherited from class net.solarnetwork.node.service.support.JsonHttpClientSupport
JSON_MIME_TYPEFields inherited from class net.solarnetwork.node.service.support.HttpClientSupport
ACCEPT_JSON, ACCEPT_TEXT, DEFAULT_CONNECTION_TIMEOUT, HTTP_METHOD_GET, HTTP_METHOD_POST, logFields inherited from interface net.solarnetwork.service.Identifiable
GROUP_UID_PROPERTY, UID_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionUserMetadataService(net.solarnetwork.service.OptionalService<SetupService> setupService) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigurationChanged(Map<String, Object> properties) net.solarnetwork.domain.datum.GeneralDatumMetadataGet all metadata available.List<net.solarnetwork.settings.SettingSpecifier> voidsetCacheSeconds(int cacheSeconds) Set the number of seconds to cache metadata.voidSet the SolarNetwork token to use.voidsetTokenSecret(String tokenSecret) Set the SolarNetwork token secret to use.Methods inherited from class net.solarnetwork.node.service.support.JsonHttpClientSupport
doJson, doJson, extractCollectionResponseData, extractFilterResultsCollectionResponseData, extractResponseData, getObjectMapper, isCompress, jsonGET, jsonGET, jsonPOST, jsonPOST, setCompress, setObjectMapper, verifyResponseSuccessMethods inherited from class net.solarnetwork.node.service.support.HttpClientSupport
appendXWWWFormURLEncodedValue, getConnectionTimeout, getIdentityService, getInputStreamFromURLConnection, getSslService, getUnicodeReaderFromURLConnection, getURLConnection, getURLConnection, getURLConnection, postXWWWFormURLEncodedData, postXWWWFormURLEncodedDataForString, setConnectionTimeout, setIdentityService, setSslService, setupTokenAuthorization, xWWWFormURLEncodedMethods inherited from class net.solarnetwork.node.service.support.BaseIdentifiable
baseIdentifiableSettings, baseIdentifiableSettings, getExpressionServices, getPlaceholderService, populateExpressionDatumProperties, resolvePlaceholders, resolvePlaceholders, setExpressionServices, setPlaceholderServiceMethods inherited from class net.solarnetwork.service.support.BasicIdentifiable
basicIdentifiableMetadataSettings, basicIdentifiableSettings, basicIdentifiableSettings, basicIdentifiableSettings, doubleMetadataValue, getDisplayName, getGroupUid, getGroupUID, getMessageSource, getMetadata, getMetadataCount, getUid, getUID, integerMetadataValue, metadataValue, numberMetadataValue, saveMetadataValue, saveMetadataValue, setDisplayName, setGroupUid, setGroupUID, setMessageSource, setMetadata, setMetadataCount, setUid, setUID, smartMetadataValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.service.Identifiable
getDisplayName, getGroupUid, getUidMethods inherited from interface net.solarnetwork.node.service.MetadataService
metadataAtPath, metadataAtPathMethods inherited from interface net.solarnetwork.settings.SettingSpecifierProvider
getDisplayName, getMessageSource, templateSettingSpecifiers
-
Field Details
-
USER_METADATA_PATH
The the user metadata path.- See Also:
-
DEFAULT_CACHE_SECONDS
public static final int DEFAULT_CACHE_SECONDSThecacheSecondsproperty default value.- See Also:
-
-
Constructor Details
-
UserMetadataService
Constructor.- Parameters:
setupService- the setup service
-
-
Method Details
-
configurationChanged
- Specified by:
configurationChangedin interfacenet.solarnetwork.settings.SettingsChangeObserver
-
getAllMetadata
public net.solarnetwork.domain.datum.GeneralDatumMetadata getAllMetadata()Description copied from interface:MetadataServiceGet all metadata available.- Specified by:
getAllMetadatain interfaceMetadataService- Returns:
- the metadata, or null if none available
-
getSettingUid
- Specified by:
getSettingUidin interfacenet.solarnetwork.settings.SettingSpecifierProvider
-
getSettingSpecifiers
- Specified by:
getSettingSpecifiersin interfacenet.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
Set the SolarNetwork token to use.- Parameters:
token- the token to set
-
setTokenSecret
Set the SolarNetwork token secret to use.- Parameters:
tokenSecret- the token secret to set
-