Class SubmodelRegistryUtils

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

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static org.eclipse.digitaltwin.basyx.submodelregistry.client.model.SubmodelDescriptor
    createDescriptor(de.iip_ecosphere.platform.support.aas.Submodel sm, String baseUrl)
    Creates a submodel descriptor for sm.
    (package private) static org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApi
    createRegistryApi(de.iip_ecosphere.platform.support.aas.SetupSpec spec, String uri)
    Creates an API instance.
    (package private) static org.eclipse.digitaltwin.basyx.submodelregistry.client.model.Endpoint
    getFirstEndpoint(org.eclipse.digitaltwin.basyx.submodelregistry.client.model.SubmodelDescriptor desc)
    Returns the first endpoint from desc.
    (package private) static String
    getFirstEndpointUrl(org.eclipse.digitaltwin.basyx.submodelregistry.client.model.SubmodelDescriptor desc)
    Returns the first endpoint URL from desc.
    (package private) 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 submodel sm.
    (package private) static List<org.eclipse.digitaltwin.basyx.submodelregistry.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
  • 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 from desc.
      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 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.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 for sm.
      Parameters:
      sm - the submodel
      baseUrl - 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 submodel sm.
      Parameters:
      sm - the submodel
      reg - the submodel registry
      repo - 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 descriptor
      uri - specific URI, may be null for endpoint
      Returns:
      the API instance