Package org.eclipse.hono.util
Class IdentityTemplate
java.lang.Object
org.eclipse.hono.util.IdentityTemplate
A utility class for handling template used for generating device and authentication identifiers during
auto-provisioning.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
IdentityTemplate
Creates a new identity template.The validity of the template is verified using
checkValidity(String)
.- Parameters:
template
- The identity template.- Throws:
NullPointerException
- if template isnull
.IllegalArgumentException
- if the template is not valid.
-
-
Method Details
-
apply
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 arenull
.
-
checkValidity
Checks if the template is valid.The following placeholders are supported.
- "{{subject-dn}}" for Subject Distinguished Name (DN)
- "{{subject-cn}}" for Common Name (CN)
- "{{subject-ou}}" for Organizational Unit Name (OU)
- "{{subject-o}}" for Organization Name (O)
- Parameters:
template
- The identity template.- Throws:
NullPointerException
- if template isnull
.IllegalArgumentException
- if the template does not contain any placeholders or contains any unsupported placeholders.
-
toString
-