Package com.azure.iot.modelsrepository
Class DtmiConventions
java.lang.Object
com.azure.iot.modelsrepository.DtmiConventions
DtmiConventions implements the core aspects of the IoT model repo conventions which includes DTMI validation and
calculating a URI path from a DTMI.
-
Method Summary
Modifier and TypeMethodDescriptionstatic URI
getMetadataUri
(URI repositoryUri) Generates the model repository's metadata URI.static String
getModelPath
(String dtmi, boolean expanded) Generates the model path.static URI
getModelUri
(String dtmi, URI repositoryUri, boolean expanded) Generates the model URI.static boolean
isValidDtmi
(String dtmi) Indicates whether a given string DTMI value is well-formed.
-
Method Details
-
isValidDtmi
Indicates whether a given string DTMI value is well-formed.- Parameters:
dtmi
- DigitalTwin Model Id- Returns:
- True if dtmi has a valid format. False otherwise.
-
getModelUri
Generates the model URI.- Parameters:
dtmi
- DigitalTwin Model Id.repositoryUri
- The repository uriexpanded
- Is model from precomputed values- Returns:
- The model uri.
- Throws:
IllegalArgumentException
- if the provided dtmi is not valid.
-
getModelPath
Generates the model path.- Parameters:
dtmi
- DigitalTwin Model Id.expanded
- Is model from precomputed values- Returns:
- The model path.
-
getMetadataUri
Generates the model repository's metadata URI.- Parameters:
repositoryUri
- The repository uri- Returns:
- The repository metadata uri.
- Throws:
IllegalArgumentException
- if the provided repository URI is not valid
-