Class AasRegistryUtils
java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.AasRegistryUtils
Supporting methods for AAS 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. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final de.iip_ecosphere.platform.support.aas.basyx2.common.Tools.ClientSupplier<org.eclipse.digitaltwin.basyx.aasregistry.client.ApiClient> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptorcreateDescriptor(de.iip_ecosphere.platform.support.aas.Aas aas, String baseUrl, boolean fullUrl) Creates an AAS descriptor forsm.(package private) static org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApicreateRegistryApi(de.iip_ecosphere.platform.support.aas.SetupSpec spec, String uri) Creates an API instance.(package private) static org.eclipse.digitaltwin.basyx.aasregistry.client.model.EndpointgetFirstEndpoint(org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor desc) Returns the first endpoint fromdesc.(package private) static StringgetFirstEndpointUrl(org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor desc) Returns the first endpoint URL fromdesc.(package private) static booleanhasEndpointUrl(org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor desc, String epUrl) Returns whether one of the endpoints in the given descriptordeschas the specified href/URLepUrl.(package private) static voidpostDescriptor(de.iip_ecosphere.platform.support.aas.Aas aas, org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApi reg, org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository repo, boolean overwrite) Posts the descriptor for the givenaas.(package private) static List<org.eclipse.digitaltwin.basyx.aasregistry.client.model.Endpoint> toEndpoints(String... urls) Turns given URLs into endpoint instances.
-
Field Details
-
CLIENT_SUPPLIER
private static final de.iip_ecosphere.platform.support.aas.basyx2.common.Tools.ClientSupplier<org.eclipse.digitaltwin.basyx.aasregistry.client.ApiClient> CLIENT_SUPPLIER
-
-
Constructor Details
-
AasRegistryUtils
public AasRegistryUtils()
-
-
Method Details
-
getFirstEndpoint
static org.eclipse.digitaltwin.basyx.aasregistry.client.model.Endpoint getFirstEndpoint(org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor desc) Returns the first endpoint fromdesc.- Parameters:
desc- the descriptor to take the endpoint from- Returns:
- the endpoint or null for none
-
hasEndpointUrl
static boolean hasEndpointUrl(org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor desc, String epUrl) Returns whether one of the endpoints in the given descriptordeschas the specified href/URLepUrl.- Parameters:
desc- the descriptor to examineepUrl- the URL/href to look for- Returns:
- whether there is such an endpoint
-
getFirstEndpointUrl
static String getFirstEndpointUrl(org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor 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.aasregistry.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.aasregistry.client.model.AssetAdministrationShellDescriptor createDescriptor(de.iip_ecosphere.platform.support.aas.Aas aas, String baseUrl, boolean fullUrl) Creates an AAS descriptor forsm.- Parameters:
aas- the AASbaseUrl- the target repository URLfullUrl- whether the given URL is a base or a full URL- Returns:
- the descriptor
-
postDescriptor
static void postDescriptor(de.iip_ecosphere.platform.support.aas.Aas aas, org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApi reg, org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository repo, boolean overwrite) Posts the descriptor for the givenaas.- Parameters:
aas- the AASreg- the AAS registryrepo- the AAS repository (for URL composition)overwrite- whether existing information shall be overwritten
-
createRegistryApi
static org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApi 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
-