Class BasicNetworkIdentity

java.lang.Object
net.solarnetwork.domain.BasicNetworkIdentity
All Implemented Interfaces:
Serializable, NetworkIdentity
Direct Known Subclasses:
NetworkAssociationDetails

public class BasicNetworkIdentity extends Object implements NetworkIdentity, Serializable
Basic implementation of NetworkIdentity.
Version:
1.2
Author:
matt
See Also:
  • 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 key
      termsOfService - the TOS
      host - the service host
      port - the service port
      forceTLS - true if TLS should be used on a port other than 443
  • Method Details

    • getIdentityKey

      public String getIdentityKey()
      Description copied from interface: NetworkIdentity
      Get a universally unique key that identifies this service.
      Specified by:
      getIdentityKey in interface NetworkIdentity
      Returns:
      unique key
    • getTermsOfService

      public String getTermsOfService()
      Description copied from interface: NetworkIdentity
      Get the terms of service for this service.
      Specified by:
      getTermsOfService in interface NetworkIdentity
      Returns:
      the terms of service
    • getHost

      public String getHost()
      Description copied from interface: NetworkIdentity
      Get the service host name.
      Specified by:
      getHost in interface NetworkIdentity
      Returns:
      map of service host name
    • getPort

      public Integer getPort()
      Description copied from interface: NetworkIdentity
      The host port to use.
      Specified by:
      getPort in interface NetworkIdentity
      Returns:
      the port
    • isForceTLS

      public boolean isForceTLS()
      Description copied from interface: NetworkIdentity
      Flag indicating if TLS must be used.
      Specified by:
      isForceTLS in interface NetworkIdentity
      Returns:
      boolean
    • setIdentityKey

      public void setIdentityKey(String identityKey)
      Set the identity key.
      Parameters:
      identityKey - the key to set
    • setTermsOfService

      public void setTermsOfService(String termsOfService)
      Set the terms of service.
      Parameters:
      termsOfService - the terms to set
    • setHost

      public void setHost(String host)
      Set the host.
      Parameters:
      host - the host to set
    • setPort

      public void setPort(Integer port)
      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

      public Map<String,String> getNetworkServiceURLs()
      Description copied from interface: NetworkIdentity
      Get 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:
      getNetworkServiceURLs in interface NetworkIdentity
      Returns:
      a mapping of keys to string URLs
    • setNetworkServiceURLs

      public void setNetworkServiceURLs(Map<String,String> networkServiceURLs)
      Set the network service URLs.
      Parameters:
      networkServiceURLs - the service URLs to set
    • setSolarUserServiceURL

      public void setSolarUserServiceURL(String url)
      Put a networkServiceURLs value for the NetworkIdentity.SOLARUSER_NETWORK_SERVICE_KEY key.
      Parameters:
      url - The URL to set, or null to remove.
    • getSolarUserServiceURL

      public String getSolarUserServiceURL()
      Get the NetworkIdentity.SOLARUSER_NETWORK_SERVICE_KEY networkServiceURLs value.
      Returns:
      the URL
    • setSolarQueryServiceURL

      public void setSolarQueryServiceURL(String url)
      Put a networkServiceURLs value for the NetworkIdentity.SOLARQUERY_NETWORK_SERVICE_KEY key.
      Parameters:
      url - The URL to set, or null to remove.
    • getSolarQueryServiceURL

      public String getSolarQueryServiceURL()
      Get the NetworkIdentity.SOLARQUERY_NETWORK_SERVICE_KEY networkServiceURLs value.
      Returns:
      the URL
    • setSolarInMqttServiceURL

      public void setSolarInMqttServiceURL(String url)
      Put a networkServiceURLs value for the NetworkIdentity.SOLARIN_MQTT_NETWORK_SERVICE_KEY key.
      Parameters:
      url - The URL to set, or null to remove.
    • getSolarInMqttServiceURL

      public String getSolarInMqttServiceURL()
      Get the NetworkIdentity.SOLARIN_MQTT_NETWORK_SERVICE_KEY networkServiceURLs value.
      Returns:
      the URL