Class IdentityTemplate

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

public final class IdentityTemplate extends Object
A utility class for handling template used for generating device and authentication identifiers during auto-provisioning.
  • Constructor Details

  • Method Details

    • apply

      public String apply(String subjectDN)
      Applies attribute values from the given subject DN to the template.
      Parameters:
      subjectDN - The subject DN.
      Returns:
      The filled template.
      Throws:
      IllegalArgumentException - if the subject DN is not valid or any of the attributes configured in the template are not present in the subject DN.
      NullPointerException - if any of the parameters are null.
    • checkValidity

      public static void checkValidity(String template)
      Checks if the template is valid.

      The following placeholders are supported.

      Parameters:
      template - The identity template.
      Throws:
      NullPointerException - if template is null.
      IllegalArgumentException - if the template does not contain any placeholders or contains any unsupported placeholders.
    • toString

      public String toString()
      Overrides:
      toString in class Object