Class AasRegistryUtils

java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.AasRegistryUtils

public class AasRegistryUtils extends Object
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 Classes
    Modifier and Type
    Class
    Description
    private static class 
    Specialized ApiClient to prevent unneeded instances of Http client.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final de.iip_ecosphere.platform.support.aas.basyx2.common.Tools.ClientSupplier<org.eclipse.digitaltwin.basyx.aasregistry.client.ApiClient>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) 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 for sm.
    (package private) static org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApi
    createRegistryApi(de.iip_ecosphere.platform.support.aas.SetupSpec spec, String uri)
    Creates an API instance.
    (package private) static org.eclipse.digitaltwin.basyx.aasregistry.client.model.Endpoint
    getFirstEndpoint(org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor desc)
    Returns the first endpoint from desc.
    (package private) static String
    getFirstEndpointUrl(org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor desc)
    Returns the first endpoint URL from desc.
    (package private) static boolean
    hasEndpointUrl(org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor desc, String epUrl)
    Returns whether one of the endpoints in the given descriptor desc has the specified href/URL epUrl.
    (package private) 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 given aas.
    (package private) static List<org.eclipse.digitaltwin.basyx.aasregistry.client.model.Endpoint>
    Turns given URLs into endpoint instances.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 from desc.
      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 descriptor desc has the specified href/URL epUrl.
      Parameters:
      desc - the descriptor to examine
      epUrl - 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 from desc.
      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 for sm.
      Parameters:
      aas - the AAS
      baseUrl - the target repository URL
      fullUrl - 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 given aas.
      Parameters:
      aas - the AAS
      reg - the AAS registry
      repo - 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 descriptor
      uri - specific URI, may be null for endpoint
      Returns:
      the API instance