Class SubmodelRegistryUtils
java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.SubmodelRegistryUtils
Supporting methods for submodel registries. An own class is more convenient to separate the imports for descriptor,
endpoint etc. as some between submodels and aas have the same simple names.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classSpecializedApiClientto prevent unneeded instances of Http client. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static org.eclipse.digitaltwin.basyx.submodelregistry.client.model.SubmodelDescriptorcreateDescriptor(de.iip_ecosphere.platform.support.aas.Submodel sm, String baseUrl) Creates a submodel descriptor forsm.(package private) static org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApicreateRegistryApi(de.iip_ecosphere.platform.support.aas.SetupSpec spec, String uri) Creates an API instance.(package private) static org.eclipse.digitaltwin.basyx.submodelregistry.client.model.EndpointgetFirstEndpoint(org.eclipse.digitaltwin.basyx.submodelregistry.client.model.SubmodelDescriptor desc) Returns the first endpoint fromdesc.(package private) static StringgetFirstEndpointUrl(org.eclipse.digitaltwin.basyx.submodelregistry.client.model.SubmodelDescriptor desc) Returns the first endpoint URL fromdesc.(package private) static voidpostDescriptor(de.iip_ecosphere.platform.support.aas.Submodel sm, org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApi reg, org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository repo, boolean overwrite) Posts the descriptor for the given submodelsm.(package private) static List<org.eclipse.digitaltwin.basyx.submodelregistry.client.model.Endpoint> toEndpoints(String... urls) Turns given URLs into endpoint instances.
-
Constructor Details
-
SubmodelRegistryUtils
SubmodelRegistryUtils()
-
-
Method Details
-
getFirstEndpoint
static org.eclipse.digitaltwin.basyx.submodelregistry.client.model.Endpoint getFirstEndpoint(org.eclipse.digitaltwin.basyx.submodelregistry.client.model.SubmodelDescriptor desc) Returns the first endpoint fromdesc.- Parameters:
desc- the descriptor to take the endpoint from- Returns:
- the endpoint or null for none
-
getFirstEndpointUrl
static String getFirstEndpointUrl(org.eclipse.digitaltwin.basyx.submodelregistry.client.model.SubmodelDescriptor desc) Returns the first endpoint URL fromdesc.- Parameters:
desc- the descriptor to take the endpoint from- Returns:
- the endpoint URL or null for none
-
toEndpoints
static List<org.eclipse.digitaltwin.basyx.submodelregistry.client.model.Endpoint> toEndpoints(String... urls) Turns given URLs into endpoint instances.- Parameters:
urls- the URLs- Returns:
- the endpoint instances
-
createDescriptor
static org.eclipse.digitaltwin.basyx.submodelregistry.client.model.SubmodelDescriptor createDescriptor(de.iip_ecosphere.platform.support.aas.Submodel sm, String baseUrl) Creates a submodel descriptor forsm.- Parameters:
sm- the submodelbaseUrl- the target repository URL- Returns:
- the descriptor
-
postDescriptor
static void postDescriptor(de.iip_ecosphere.platform.support.aas.Submodel sm, org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApi reg, org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository repo, boolean overwrite) Posts the descriptor for the given submodelsm.- Parameters:
sm- the submodelreg- the submodel registryrepo- the AAS repository (for URL composition)overwrite- whether existing information shall be overwritten
-
createRegistryApi
static org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApi createRegistryApi(de.iip_ecosphere.platform.support.aas.SetupSpec spec, String uri) Creates an API instance.- Parameters:
spec- the setup specification containing endpoint and keystore descriptoruri- specific URI, may be null forendpoint- Returns:
- the API instance
-