Class CommandEndpoint

java.lang.Object
org.eclipse.hono.util.CommandEndpoint

public final class CommandEndpoint extends Object
Encapsulates the command endpoint information for a device as defined by the Device Registration API.
  • Constructor Details

    • CommandEndpoint

      public CommandEndpoint()
  • Method Details

    • getUri

      public String getUri()
      Gets the URI to be used when sending a command to this endpoint.

      Note that the URI may contain the {{deviceId}} placeholder.

      Returns:
      The URI or null if not set.
    • setUri

      public CommandEndpoint setUri(String uri)
      Sets the URI to be used when sending a command to this endpoint.

      The URI may contain the {{deviceId}} placeholder.

      Parameters:
      uri - The URI to set or null.
      Returns:
      A reference to this object for method chaining.
    • getHeaders

      public Map<String,String> getHeaders()
      Gets headers to be used when sending a command to this endpoint.
      Returns:
      An unmodifiable view on the headers.
    • setHeaders

      public CommandEndpoint setHeaders(Map<String,String> headers)
      Sets headers to be used when sending a command to this endpoint.
      Parameters:
      headers - The headers to set or null to clear all headers.
      Returns:
      A reference to this object for method chaining.
    • getPayloadProperties

      public Map<String,Object> getPayloadProperties()
      Gets payload properties to be used when sending a command to this endpoint.
      Returns:
      An unmodifiable view on the payload properties.
    • setPayloadProperties

      public CommandEndpoint setPayloadProperties(Map<String,String> payloadProperties)
      Sets payload properties to be used when sending a command to this endpoint.
      Parameters:
      payloadProperties - The payload properties to set or null to clear all payload properties.
      Returns:
      A reference to this object for method chaining.
    • isUriValid

      public boolean isUriValid()
      Checks whether the configured uri is valid.
      Returns:
      true when the uri is not null and the uri can be converted without exceptions.
    • getFormattedUri

      public String getFormattedUri(String deviceId)
      Returns the configured uri formatted with the deviceId.
      Parameters:
      deviceId - The deviceId to replace the placeholder with in the configured uri.
      Returns:
      the fully formatted uri.
      Throws:
      NullPointerException - If deviceId is null.