Package net.solarnetwork.domain
Class BasicNetworkIdentity
java.lang.Object
net.solarnetwork.domain.BasicNetworkIdentity
- All Implemented Interfaces:
Serializable,NetworkIdentity
- Direct Known Subclasses:
NetworkAssociationDetails
Basic implementation of
NetworkIdentity.- Version:
- 1.2
- Author:
- matt
- See Also:
-
Field Summary
Fields inherited from interface net.solarnetwork.domain.NetworkIdentity
SOLARIN_MQTT_NETWORK_SERVICE_KEY, SOLARQUERY_NETWORK_SERVICE_KEY, SOLARUSER_NETWORK_SERVICE_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHost()Get the service host name.Get a universally unique key that identifies this service.Get a mapping of pre-defined network service URLs, to be used by clients to provide links to the SolarNetwork they are associated with.getPort()The host port to use.Get theNetworkIdentity.SOLARIN_MQTT_NETWORK_SERVICE_KEYnetworkServiceURLsvalue.Get theNetworkIdentity.SOLARQUERY_NETWORK_SERVICE_KEYnetworkServiceURLsvalue.Get theNetworkIdentity.SOLARUSER_NETWORK_SERVICE_KEYnetworkServiceURLsvalue.Get the terms of service for this service.booleanFlag indicating if TLS must be used.voidsetForceTLS(boolean forceTLS) Set the force TLS flag.voidSet the host.voidsetIdentityKey(String identityKey) Set the identity key.voidsetNetworkServiceURLs(Map<String, String> networkServiceURLs) Set the network service URLs.voidSet the port.voidPut anetworkServiceURLsvalue for theNetworkIdentity.SOLARIN_MQTT_NETWORK_SERVICE_KEYkey.voidPut anetworkServiceURLsvalue for theNetworkIdentity.SOLARQUERY_NETWORK_SERVICE_KEYkey.voidPut anetworkServiceURLsvalue for theNetworkIdentity.SOLARUSER_NETWORK_SERVICE_KEYkey.voidsetTermsOfService(String termsOfService) Set the terms of service.
-
Constructor Details
-
BasicNetworkIdentity
public BasicNetworkIdentity()Default constructor. -
BasicNetworkIdentity
public BasicNetworkIdentity(String identityKey, String termsOfService, String host, Integer port, Boolean forceTLS) Construct with an identity key.- Parameters:
identityKey- the identity keytermsOfService- the TOShost- the service hostport- the service portforceTLS- true if TLS should be used on a port other than 443
-
-
Method Details
-
getIdentityKey
Description copied from interface:NetworkIdentityGet a universally unique key that identifies this service.- Specified by:
getIdentityKeyin interfaceNetworkIdentity- Returns:
- unique key
-
getTermsOfService
Description copied from interface:NetworkIdentityGet the terms of service for this service.- Specified by:
getTermsOfServicein interfaceNetworkIdentity- Returns:
- the terms of service
-
getHost
Description copied from interface:NetworkIdentityGet the service host name.- Specified by:
getHostin interfaceNetworkIdentity- Returns:
- map of service host name
-
getPort
Description copied from interface:NetworkIdentityThe host port to use.- Specified by:
getPortin interfaceNetworkIdentity- Returns:
- the port
-
isForceTLS
public boolean isForceTLS()Description copied from interface:NetworkIdentityFlag indicating if TLS must be used.- Specified by:
isForceTLSin interfaceNetworkIdentity- Returns:
- boolean
-
setIdentityKey
Set the identity key.- Parameters:
identityKey- the key to set
-
setTermsOfService
Set the terms of service.- Parameters:
termsOfService- the terms to set
-
setHost
Set the host.- Parameters:
host- the host to set
-
setPort
Set the port.- Parameters:
port- the port to set
-
setForceTLS
public void setForceTLS(boolean forceTLS) Set the force TLS flag.- Parameters:
forceTLS- the flag to set
-
getNetworkServiceURLs
Description copied from interface:NetworkIdentityGet a mapping of pre-defined network service URLs, to be used by clients to provide links to the SolarNetwork they are associated with.- Specified by:
getNetworkServiceURLsin interfaceNetworkIdentity- Returns:
- a mapping of keys to string URLs
-
setNetworkServiceURLs
Set the network service URLs.- Parameters:
networkServiceURLs- the service URLs to set
-
setSolarUserServiceURL
Put anetworkServiceURLsvalue for theNetworkIdentity.SOLARUSER_NETWORK_SERVICE_KEYkey.- Parameters:
url- The URL to set, or null to remove.
-
getSolarUserServiceURL
Get theNetworkIdentity.SOLARUSER_NETWORK_SERVICE_KEYnetworkServiceURLsvalue.- Returns:
- the URL
-
setSolarQueryServiceURL
Put anetworkServiceURLsvalue for theNetworkIdentity.SOLARQUERY_NETWORK_SERVICE_KEYkey.- Parameters:
url- The URL to set, or null to remove.
-
getSolarQueryServiceURL
Get theNetworkIdentity.SOLARQUERY_NETWORK_SERVICE_KEYnetworkServiceURLsvalue.- Returns:
- the URL
-
setSolarInMqttServiceURL
Put anetworkServiceURLsvalue for theNetworkIdentity.SOLARIN_MQTT_NETWORK_SERVICE_KEYkey.- Parameters:
url- The URL to set, or null to remove.
-
getSolarInMqttServiceURL
Get theNetworkIdentity.SOLARIN_MQTT_NETWORK_SERVICE_KEYnetworkServiceURLsvalue.- Returns:
- the URL
-