Class BaSyxRegistry

java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.BaSyxRegistry
All Implemented Interfaces:
de.iip_ecosphere.platform.support.aas.Registry

public class BaSyxRegistry extends Object implements de.iip_ecosphere.platform.support.aas.Registry
Implements a registry recipe for BaSyx.
Author:
Holger Eichelberger, SSE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApi
     
    private org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository
     
    private static final Integer
     
    private org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApi
     
    private org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository
     
    private de.iip_ecosphere.platform.support.aas.SetupSpec
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BaSyxRegistry(de.iip_ecosphere.platform.support.aas.SetupSpec spec)
    Creates a registry instance from the given deployment specification.
  • Method Summary

    Modifier and Type
    Method
    Description
    private Stream<org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor>
    Returns a stream of all known.
    void
    createAas(de.iip_ecosphere.platform.support.aas.Aas aas, String endpointURL)
     
    void
    createSubmodel(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel)
     
    private org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell
    getAas(org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository aasRepo, String aasId)
    Returns an AAS from a given repository catching potential exceptions.
    (package private) org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor
    Returns the descriptor for an AAS.
     
     
    (package private) org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApi
    Returns the internal AAS registry instance.
    private org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository
    Returns the (fallback) AAS repository for the given URL.
    (package private) org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository
    Returns the default AAS repository of this registry.
    getEndpoint(de.iip_ecosphere.platform.support.aas.Aas aas)
     
    getEndpoint(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel)
     
    getEndpoint(String aasIdShort)
     
    (package private) org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApi
    Returns the internal submodel registry instance.
    private org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository
    Returns the (fallback) submodel repository for the given URL.
    (package private) org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository
    Returns the default submodel repository of this registry.
    void
    register(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel, String endpointUrl)
     
    de.iip_ecosphere.platform.support.aas.Aas
    retrieveAas(String identifier)
     
    retrieveAas(String identifier, boolean populate)
     
    private de.iip_ecosphere.platform.support.aas.Submodel
    retrieveSubmodel(BaSyxAas aas, String submodelId)
    Retrieves a submodel for aas.
    de.iip_ecosphere.platform.support.aas.Submodel
    retrieveSubmodel(String aasIdentifier, String submodelIdentifier)
     
    private String
    Cuts the path of the given URI.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PAGINATION_UNLIMITED

      private static final Integer PAGINATION_UNLIMITED
    • spec

      private de.iip_ecosphere.platform.support.aas.SetupSpec spec
    • aasRegistry

      private org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApi aasRegistry
    • smRegistry

      private org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApi smRegistry
    • aasRepo

      private org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository aasRepo
    • smRepo

      private org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository smRepo
  • Constructor Details

    • BaSyxRegistry

      BaSyxRegistry(de.iip_ecosphere.platform.support.aas.SetupSpec spec)
      Creates a registry instance from the given deployment specification.
      Parameters:
      spec - the deployment specification
  • Method Details

    • getAasRepository

      org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository getAasRepository()
      Returns the default AAS repository of this registry.
      Returns:
      the AAS repository
    • getSubmodelRepository

      org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository getSubmodelRepository()
      Returns the default submodel repository of this registry.
      Returns:
      the submodel repository
    • retrieveAas

      public de.iip_ecosphere.platform.support.aas.Aas retrieveAas(String identifier) throws IOException
      Specified by:
      retrieveAas in interface de.iip_ecosphere.platform.support.aas.Registry
      Throws:
      IOException
    • getAasDescriptor

      org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor getAasDescriptor(String identifier)
      Returns the descriptor for an AAS.
      Parameters:
      identifier - the identifier of the AAS (may be null or empty for an identification based on idShort, interpreted as an URN if this starts with urn, see IdentifierType for others, or as an endpoint if it starts with http:// or https://)
      Returns:
      the descriptor or null if the AAS cannot be found
    • retrieveAas

      public BaSyxAas retrieveAas(String identifier, boolean populate) throws IOException
      Specified by:
      retrieveAas in interface de.iip_ecosphere.platform.support.aas.Registry
      Throws:
      IOException
    • getAas

      private org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell getAas(org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository aasRepo, String aasId) throws IOException
      Returns an AAS from a given repository catching potential exceptions.
      Parameters:
      aasRepo - the AAS repository
      aasId - the AAS identifier, may be null or empty
      Returns:
      the AAS or null for none
      Throws:
      IOException - if the AAS cannot be accessed, e.g., as not permitted
    • getAasRepo

      private org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository getAasRepo(String epUrl)
      Returns the (fallback) AAS repository for the given URL.
      Parameters:
      epUrl - the repo URL
      Returns:
      the repository or the fallback repository
    • allAas

      private Stream<org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor> allAas()
      Returns a stream of all known.
      Returns:
      the known AAS
    • getAasIdShorts

      public List<String> getAasIdShorts()
      Specified by:
      getAasIdShorts in interface de.iip_ecosphere.platform.support.aas.Registry
    • getAasIdentifiers

      public List<String> getAasIdentifiers()
      Specified by:
      getAasIdentifiers in interface de.iip_ecosphere.platform.support.aas.Registry
    • retrieveSubmodel

      public de.iip_ecosphere.platform.support.aas.Submodel retrieveSubmodel(String aasIdentifier, String submodelIdentifier) throws IOException
      Specified by:
      retrieveSubmodel in interface de.iip_ecosphere.platform.support.aas.Registry
      Throws:
      IOException
    • retrieveSubmodel

      private de.iip_ecosphere.platform.support.aas.Submodel retrieveSubmodel(BaSyxAas aas, String submodelId) throws IOException
      Retrieves a submodel for aas.
      Parameters:
      aas - the AAS
      submodelId - the submodelId
      Returns:
      the submodel or null if not found
      Throws:
      IOException - if failed
    • getSubmodelRepo

      private org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository getSubmodelRepo(String epUrl)
      Returns the (fallback) submodel repository for the given URL.
      Parameters:
      epUrl - the repo URL
      Returns:
      the repository or the fallback repository
    • toUriWithoutPath

      private String toUriWithoutPath(String uri)
      Cuts the path of the given URI.
      Parameters:
      uri - the URI
      Returns:
      the URI scheme, host, port without path
    • createAas

      public void createAas(de.iip_ecosphere.platform.support.aas.Aas aas, String endpointURL) throws IOException
      Specified by:
      createAas in interface de.iip_ecosphere.platform.support.aas.Registry
      Throws:
      IOException
    • createSubmodel

      public void createSubmodel(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel) throws IOException
      Specified by:
      createSubmodel in interface de.iip_ecosphere.platform.support.aas.Registry
      Throws:
      IOException
    • register

      public void register(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel, String endpointUrl)
      Specified by:
      register in interface de.iip_ecosphere.platform.support.aas.Registry
    • getEndpoint

      public String getEndpoint(String aasIdShort)
      Specified by:
      getEndpoint in interface de.iip_ecosphere.platform.support.aas.Registry
    • getEndpoint

      public String getEndpoint(de.iip_ecosphere.platform.support.aas.Aas aas)
      Specified by:
      getEndpoint in interface de.iip_ecosphere.platform.support.aas.Registry
    • getEndpoint

      public String getEndpoint(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel)
      Specified by:
      getEndpoint in interface de.iip_ecosphere.platform.support.aas.Registry
    • getAasRegistry

      org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApi getAasRegistry()
      Returns the internal AAS registry instance.
      Returns:
      the internal AAS registry instance
    • getSubmodelRegistry

      org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApi getSubmodelRegistry()
      Returns the internal submodel registry instance.
      Returns:
      the internal submodel registry instance