Class AASServerComponent

java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx1_5.basyx.AASServerComponent
All Implemented Interfaces:
org.eclipse.basyx.components.IComponent

public class AASServerComponent extends Object implements org.eclipse.basyx.components.IComponent
Component providing an empty AAS server that is able to receive AAS/SMs from remote. It uses the Aggregator API, i.e. AAS should be pushed to ${URL}/shells Taken over from BaSyx for customization.
Author:
schnicke, espen, fried, fischer, danish, wege
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<Collection<org.eclipse.basyx.aas.bundle.AASBundle>>
     
    private org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration
     
    private List<org.eclipse.basyx.components.aas.aascomponent.IAASServerFeature>
     
    private static final String
     
    private static final String
     
    private static final String
     
    private org.eclipse.basyx.aas.aggregator.api.IAASAggregator
     
    private de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent
     
    private org.eclipse.basyx.components.configuration.BaSyxContextConfiguration
     
    private boolean
     
    private static de.iip_ecosphere.platform.support.logging.Logger
     
    private org.eclipse.basyx.components.configuration.BaSyxMongoDBConfiguration
     
    private static final String
     
    private org.eclipse.basyx.aas.registration.api.IAASRegistry
     
    private org.eclipse.basyx.components.configuration.BaSyxSecurityConfiguration
     
     
    private de.iip_ecosphere.platform.support.aas.SetupSpec
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AASServerComponent(org.eclipse.basyx.components.configuration.BaSyxContextConfiguration contextConfig, de.iip_ecosphere.platform.support.aas.SetupSpec spec, de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent component)
    Constructs an empty AAS server using the passed context.
    AASServerComponent(org.eclipse.basyx.components.configuration.BaSyxContextConfiguration contextConfig, de.iip_ecosphere.platform.support.aas.SetupSpec spec, de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent component, org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration aasConfig)
    Constructs an empty AAS server using the passed configuration.
    AASServerComponent(org.eclipse.basyx.components.configuration.BaSyxContextConfiguration contextConfig, de.iip_ecosphere.platform.support.aas.SetupSpec spec, de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent component, org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration aasConfig, org.eclipse.basyx.components.configuration.BaSyxMongoDBConfiguration mongoDBConfig)
    Constructs an empty AAS server using the passed configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAASServerFeature(org.eclipse.basyx.components.aas.aascomponent.IAASServerFeature aasServerFeature)
    Adds an AAS server feature.
    private void
    addAASServerFeaturesToContext(org.eclipse.basyx.vab.protocol.http.server.BaSyxContext context)
    Adds AAS server features to context.
    private void
    addAasxFilesResourceServlet(org.eclipse.basyx.vab.protocol.http.server.BaSyxContext context)
    Adds an AASX files resource servlet.
    private void
    Cleans up AAS server features.
    private void
    Configures the MQTT feature.
    private void
    Configures security.
    private org.eclipse.basyx.aas.aggregator.api.IAASAggregator
    Creates the AAS aggregator.
    private List<org.eclipse.basyx.components.aas.aascomponent.IAASServerDecorator>
    Creates an AAS server decorator list.
    private org.eclipse.basyx.vab.protocol.http.server.VABHTTPInterface<?>
    Creates the aggregator servlet.
    private void
    Creates a resource directory if it does not exist.
    private org.apache.catalina.Context
    createChildContextForAasxResourceFiles(String childContextPath, String childDocbasePath)
    Creates a child context for AASX resource files.
    private org.apache.catalina.servlets.DefaultServlet
    Creates the default servlet.
    private org.eclipse.basyx.components.configuration.BaSyxMongoDBConfiguration
    Creates a mongo DB configuration.
    private org.eclipse.basyx.aas.registration.api.IAASRegistry
    createRegistryFromConfig(org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration aasConfig)
    Only creates the registry, if it hasn't been set explicitly before.
    private void
    deregisterAAS(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier aasIdentifier)
    Deregisters an AAS.
    private void
    deregisterAASAndAccompanyingSM(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas)
    Deregisters AAS and SM.
    private void
    Deregisters AAS and SSM during runtime.
    private void
    deregisterSubmodel(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier aasIdentifier, org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor submodelDescriptor)
    Deregisters a submodel.
    void
    Deprecated.
    remove MQTT from the feature list instead.
    void
    Enables AASX upload functionality.
    void
    enableMQTT(org.eclipse.basyx.components.configuration.BaSyxMqttConfiguration configuration)
    Deprecated.
    Add MQTT via MqttAASServerFeature instead.
    private org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor
    findSMDescriptor(String smId, Collection<org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor> smDescriptors)
    Finds a SM descriptor.
    private String
    getAASAccessPath(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas)
    Returns the AAS access path.
    private String
    getAASIdFromSMId(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier smId)
    Returns the AAS id from a submodel.
    private String
    getAASXFileSubPath(int aasxIndex)
    Returns the AASX file sub path.
    private org.eclipse.basyx.components.aas.authorization.internal.AuthorizedDefaultServletParams<?>
    Gets authorized servlet params.
    private String
    Returns the external URL.
    private Collection<org.eclipse.basyx.aas.bundle.AASBundle>
    Returns the flat AAS bundles.
    private String
    Returns the internal URL.
    private String
    Returns the MQTT AAS client id.
    private String
    Returns the MQTT submodel client id.
    private String
    Returns the root file path with context.
    private String
    getSMEndpoint(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier smId)
    Returns the SM endpoint for the given SM id.
    private String
    getSMIdShortFromSMId(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier smId)
    Returns an SM idShort from an sm identifier.
    private org.eclipse.basyx.submodel.metamodel.api.ISubmodel
    getSubmodel(Object submodelObject)
    Casts the submodel in submodelObject.
    private List<org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor>
    getSubmodelDescriptors(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier aasIdentifier)
    Returns the submodel descriptors for the given AAS.
    private List<org.eclipse.basyx.submodel.metamodel.api.ISubmodel>
    getSubmodelFromAggregator(org.eclipse.basyx.aas.aggregator.api.IAASAggregator aggregator, org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier iIdentifier)
    Gets submodels from aggregator.
    Retrieves the URL on which the component is providing its HTTP server.
    private void
    initializeAasBundles(org.eclipse.basyx.vab.protocol.http.server.BaSyxContext context)
    Initializes the AAS bundles.
    private void
    Initializes up AAS server features.
    private boolean
    Returns whether auto register is enabled.
    private boolean
    Returns whether AAS eventing is enabled.
    private boolean
    Returns whether external path is configured.
    private boolean
    Are we running a mongo DB backend?
    private boolean
    Returns whether the registry is configured.
    private boolean
    Returns whether the registration white list is configured.
    private void
    Loads the AAS bundles.
    private List<Collection<org.eclipse.basyx.aas.bundle.AASBundle>>
    Loads AAS from source.
    private void
    Loads AAS server features from config.
    private static Set<org.eclipse.basyx.aas.bundle.AASBundle>
    loadBundleFromAASX(String aasxPath, String childFilePath)
    Loads a bundle from AASX.
    private Set<org.eclipse.basyx.aas.bundle.AASBundle>
    loadBundleFromFile(String aasSource, String childFilePath)
    Loads an AAS source as bundle from a file.
    private Set<org.eclipse.basyx.aas.bundle.AASBundle>
    Loads a bundle from JSON.
    private Set<org.eclipse.basyx.aas.bundle.AASBundle>
    Loads a bundle from XML.
    private String
    Loads a bundle as string.
    private void
    modifyFilePaths(String hostName, int port, String rootPath)
    Fixes the File submodel element value paths according to the given endpoint configuration.
    private void
    modifyFilePathsInBundleSet(Collection<org.eclipse.basyx.aas.bundle.AASBundle> bundleSet, String hostName, int port, String bundleFileRootPath)
    Modifies the file paths in bundle set.
    private void
    registerAAS(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas)
    Registers AAS.
    private void
    registerAASAndSubmodels(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas)
    Registers AAS and submodels.
    private void
    Registers pre-existing AAS and SM if possible.
    private void
    registerSubmodel(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas, org.eclipse.basyx.submodel.metamodel.api.ISubmodel submodel)
    Registers the given submodel.
    private void
    registerSubmodels(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas)
    Registers the submodels of aas.
    private void
    Registers submodels from a whitelist.
    private void
    Registers whitelisted submodels.
    void
    setAASBundle(org.eclipse.basyx.aas.bundle.AASBundle aasBundle)
    Explicitly sets an AAS bundle that should be loaded during startup.
    void
    setAASBundles(Collection<org.eclipse.basyx.aas.bundle.AASBundle> aasBundles)
    Explicitly sets AAS bundles that should be loaded during startup.
    void
    setRegistry(org.eclipse.basyx.aas.registration.api.IAASRegistry registry)
    Sets a registry service for registering AAS that are created during startup.
    void
    setSecurityConfiguration(org.eclipse.basyx.components.configuration.BaSyxSecurityConfiguration configuration)
    Sets the security configuration for this component.
    private boolean
    Returns whether it should register pre-existing AAS and SM if possible.
    private boolean
    shouldUseSecuredRegistryConnection(org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration aasConfig)
    Returns whether we should use a secured registry connection.
    void
    Starts the AASX component at http://${hostName}:${port}/${path}.
    void
     
    private void
    updateSMEndpoint(String smId, List<org.eclipse.basyx.aas.metamodel.map.descriptor.AASDescriptor> descriptors)
    Updates a SM endpoint.
    private void
    updateSMEndpoint(org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor smDescriptor)
    Updates a SM endpoint.

    Methods inherited from class java.lang.Object

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

    • PREFIX_SUBMODEL_PATH

      private static final String PREFIX_SUBMODEL_PATH
      See Also:
    • AASX_RES_FILE_CONTEXT_PATH

      private static final String AASX_RES_FILE_CONTEXT_PATH
      See Also:
    • AASX_RES_FILE_DOCBASE_PATH

      private static final String AASX_RES_FILE_DOCBASE_PATH
    • AASX_RES_FILE_SERVLET_MAPPING_PATTERN

      private static final String AASX_RES_FILE_SERVLET_MAPPING_PATTERN
      See Also:
    • logger

      private static de.iip_ecosphere.platform.support.logging.Logger logger
    • aasBundles

      protected List<Collection<org.eclipse.basyx.aas.bundle.AASBundle>> aasBundles
    • server

      private BaSyxHTTPServer server
    • registry

      private org.eclipse.basyx.aas.registration.api.IAASRegistry registry
    • contextConfig

      private org.eclipse.basyx.components.configuration.BaSyxContextConfiguration contextConfig
    • aasConfig

      private org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration aasConfig
    • mongoDBConfig

      private org.eclipse.basyx.components.configuration.BaSyxMongoDBConfiguration mongoDBConfig
    • securityConfig

      private org.eclipse.basyx.components.configuration.BaSyxSecurityConfiguration securityConfig
    • aasServerFeatureList

      private List<org.eclipse.basyx.components.aas.aascomponent.IAASServerFeature> aasServerFeatureList
    • aggregator

      private org.eclipse.basyx.aas.aggregator.api.IAASAggregator aggregator
    • isAASXUploadEnabled

      private boolean isAASXUploadEnabled
    • spec

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

      private de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent component
  • Constructor Details

    • AASServerComponent

      public AASServerComponent(org.eclipse.basyx.components.configuration.BaSyxContextConfiguration contextConfig, de.iip_ecosphere.platform.support.aas.SetupSpec spec, de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent component)
      Constructs an empty AAS server using the passed context.
      Parameters:
      contextConfig - the AAS context configuration
      spec - the setup specification
      component - the component being configured
    • AASServerComponent

      public AASServerComponent(org.eclipse.basyx.components.configuration.BaSyxContextConfiguration contextConfig, de.iip_ecosphere.platform.support.aas.SetupSpec spec, de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent component, org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration aasConfig)
      Constructs an empty AAS server using the passed configuration.
      Parameters:
      contextConfig - the AAS context configuration
      spec - the setup specification
      component - the component being configured
      aasConfig - the aAS server configuration
    • AASServerComponent

      public AASServerComponent(org.eclipse.basyx.components.configuration.BaSyxContextConfiguration contextConfig, de.iip_ecosphere.platform.support.aas.SetupSpec spec, de.iip_ecosphere.platform.support.aas.SetupSpec.AasComponent component, org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration aasConfig, org.eclipse.basyx.components.configuration.BaSyxMongoDBConfiguration mongoDBConfig)
      Constructs an empty AAS server using the passed configuration.
      Parameters:
      contextConfig - the AAS context configuration
      spec - the setup specification
      component - the component being configured
      aasConfig - the aAS server configuration
      mongoDBConfig - the mongo DB configuration
  • Method Details

    • enableMQTT

      @Deprecated public void enableMQTT(org.eclipse.basyx.components.configuration.BaSyxMqttConfiguration configuration)
      Deprecated.
      Add MQTT via MqttAASServerFeature instead.
      Sets and enables mqtt connection configuration for this component. Has to be called before the component is started. Currently only works for InMemory backend.
      Parameters:
      configuration -
    • disableMQTT

      @Deprecated public void disableMQTT()
      Deprecated.
      remove MQTT from the feature list instead.
      Disables mqtt configuration. Has to be called before the component is started.
    • enableAASXUpload

      public void enableAASXUpload()
      Enables AASX upload functionality.
    • setRegistry

      public void setRegistry(org.eclipse.basyx.aas.registration.api.IAASRegistry registry)
      Sets a registry service for registering AAS that are created during startup.
      Parameters:
      registry - the registry
    • setAASBundles

      public void setAASBundles(Collection<org.eclipse.basyx.aas.bundle.AASBundle> aasBundles)
      Explicitly sets AAS bundles that should be loaded during startup.
      Parameters:
      aasBundles - The bundles that will be loaded during startup
    • setAASBundle

      public void setAASBundle(org.eclipse.basyx.aas.bundle.AASBundle aasBundle)
      Explicitly sets an AAS bundle that should be loaded during startup.
      Parameters:
      aasBundle - The bundle that will be loaded during startup
    • setSecurityConfiguration

      public void setSecurityConfiguration(org.eclipse.basyx.components.configuration.BaSyxSecurityConfiguration configuration)
      Sets the security configuration for this component. Has to be called before the component is started.
      Parameters:
      configuration - the configuration to be set
    • startComponent

      public void startComponent()
      Starts the AASX component at http://${hostName}:${port}/${path}.
      Specified by:
      startComponent in interface org.eclipse.basyx.components.IComponent
    • getRootFilePathWithContext

      private String getRootFilePathWithContext(String contextPath)
      Returns the root file path with context.
      Parameters:
      contextPath - the context path
      Returns:
      the composed path
    • createDefaultServlet

      private org.apache.catalina.servlets.DefaultServlet createDefaultServlet()
      Creates the default servlet.
      Returns:
      the default servlet
    • getAuthorizedDefaultServletParams

      private org.eclipse.basyx.components.aas.authorization.internal.AuthorizedDefaultServletParams<?> getAuthorizedDefaultServletParams()
      Gets authorized servlet params.
      Returns:
      the params
    • registerPreexistingAASAndSMIfPossible

      private void registerPreexistingAASAndSMIfPossible()
      Registers pre-existing AAS and SM if possible.
    • shouldRegisterPreexistingAASAndSM

      private boolean shouldRegisterPreexistingAASAndSM()
      Returns whether it should register pre-existing AAS and SM if possible.
    • registerAASAndSubmodels

      private void registerAASAndSubmodels(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas)
      Registers AAS and submodels.
      Parameters:
      aas - the AAS to register
    • registerAAS

      private void registerAAS(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas)
      Registers AAS.
      Parameters:
      aas - the AAS to register
    • getAASAccessPath

      private String getAASAccessPath(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas)
      Returns the AAS access path.
      Parameters:
      aas - the AAS
      Returns:
      the access path
    • registerSubmodels

      private void registerSubmodels(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas)
      Registers the submodels of aas.
      Parameters:
      aas - the AAS
    • registerSubmodel

      private void registerSubmodel(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas, org.eclipse.basyx.submodel.metamodel.api.ISubmodel submodel)
      Registers the given submodel.
      Parameters:
      aas - the AAS
      submodel - the submodel
    • getSubmodelFromAggregator

      private List<org.eclipse.basyx.submodel.metamodel.api.ISubmodel> getSubmodelFromAggregator(org.eclipse.basyx.aas.aggregator.api.IAASAggregator aggregator, org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier iIdentifier)
      Gets submodels from aggregator.
      Parameters:
      aggregator - the aggregator
      iIdentifier - the AAS identifier
      Returns:
      the submodels
    • getSubmodel

      private org.eclipse.basyx.submodel.metamodel.api.ISubmodel getSubmodel(Object submodelObject)
      Casts the submodel in submodelObject.
      Parameters:
      submodelObject - the submodel object
      Returns:
      the submodel
    • loadAASServerFeaturesFromConfig

      private void loadAASServerFeaturesFromConfig()
      Loads AAS server features from config.
    • isAutoRegisterEnabled

      private boolean isAutoRegisterEnabled()
      Returns whether auto register is enabled.
      Returns:
      whether auto register is enabled
    • isSubmodelRegistrationWhiteListConfigured

      private boolean isSubmodelRegistrationWhiteListConfigured()
      Returns whether the registration white list is configured.
      Returns:
      whether the registration white list is configured
    • configureSecurity

      private void configureSecurity()
      Configures security.
    • isRegistryConfigured

      private boolean isRegistryConfigured()
      Returns whether the registry is configured.
      Returns:
      whether the registry is configured
    • isEventingEnabled

      private boolean isEventingEnabled()
      Returns whether AAS eventing is enabled.
      Returns:
      true for eventing, false else
    • configureMqttFeature

      private void configureMqttFeature()
      Configures the MQTT feature.
    • getURL

      public String getURL()
      Retrieves the URL on which the component is providing its HTTP server.
      Returns:
    • isExternalPathConfigured

      private boolean isExternalPathConfigured()
      Returns whether external path is configured.
      Returns:
      whether external path is configured
    • getExternalURL

      private String getExternalURL()
      Returns the external URL.
      Returns:
      the external URL
    • getInternalURL

      private String getInternalURL()
      Returns the internal URL.
      Returns:
      the internal URL
    • stopComponent

      public void stopComponent()
      Specified by:
      stopComponent in interface org.eclipse.basyx.components.IComponent
    • deregisterAASAndSmAddedDuringRuntime

      private void deregisterAASAndSmAddedDuringRuntime()
      Deregisters AAS and SSM during runtime.
    • deregisterAASAndAccompanyingSM

      private void deregisterAASAndAccompanyingSM(org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas)
      Deregisters AAS and SM.
      Parameters:
      aas - the AAS
    • getSubmodelDescriptors

      private List<org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor> getSubmodelDescriptors(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier aasIdentifier)
      Returns the submodel descriptors for the given AAS.
      Parameters:
      aasIdentifier - the AAS identifier
      Returns:
      the submodel descriptors
    • deregisterSubmodel

      private void deregisterSubmodel(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier aasIdentifier, org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor submodelDescriptor)
      Deregisters a submodel.
      Parameters:
      aasIdentifier - the identifier to deregister
      submodelDescriptor - the submodel to deregister
    • deregisterAAS

      private void deregisterAAS(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier aasIdentifier)
      Deregisters an AAS.
      Parameters:
      aasIdentifier - the identifier to deregister
    • addAASServerFeature

      public void addAASServerFeature(org.eclipse.basyx.components.aas.aascomponent.IAASServerFeature aasServerFeature)
      Adds an AAS server feature.
      Parameters:
      aasServerFeature - the feature
    • initializeAASServerFeatures

      private void initializeAASServerFeatures()
      Initializes up AAS server features.
    • initializeAasBundles

      private void initializeAasBundles(org.eclipse.basyx.vab.protocol.http.server.BaSyxContext context)
      Initializes the AAS bundles.
      Parameters:
      context - the BaSyx context
    • cleanUpAASServerFeatures

      private void cleanUpAASServerFeatures()
      Cleans up AAS server features.
    • loadBundleString

      private String loadBundleString(String filePath) throws IOException
      Loads a bundle as string.
      Parameters:
      filePath - the file path
      Returns:
      the bundle as string
      Throws:
      IOException - if I/O fails
    • loadBundleFromXML

      private Set<org.eclipse.basyx.aas.bundle.AASBundle> loadBundleFromXML(String xmlPath) throws IOException, ParserConfigurationException, SAXException
      Loads a bundle from XML.
      Parameters:
      xmlPath - the XML path
      Returns:
      the bundle
      Throws:
      IOException - if I/O fails
      ParserConfigurationException - if parser is not configured correcty
      SAXException - if XML reading fails
    • loadBundleFromJSON

      private Set<org.eclipse.basyx.aas.bundle.AASBundle> loadBundleFromJSON(String jsonPath) throws IOException
      Loads a bundle from JSON.
      Parameters:
      jsonPath - the JSON path
      Returns:
      the bundle
      Throws:
      IOException - if I/O fails
    • loadBundleFromAASX

      private static Set<org.eclipse.basyx.aas.bundle.AASBundle> loadBundleFromAASX(String aasxPath, String childFilePath) throws IOException, ParserConfigurationException, SAXException, org.apache.poi.openxml4j.exceptions.InvalidFormatException, URISyntaxException
      Loads a bundle from AASX.
      Parameters:
      aasxPath - the AASX path
      Returns:
      the bundle
      Throws:
      IOException - if I/O fails
      ParserConfigurationException - if parser is not configured correcty
      SAXException - if XML reading fails
      org.apache.poi.openxml4j.exceptions.InvalidFormatException - if a format is invalid
      URISyntaxException - if a URI is invalid
    • addAASServerFeaturesToContext

      private void addAASServerFeaturesToContext(org.eclipse.basyx.vab.protocol.http.server.BaSyxContext context)
      Adds AAS server features to context.
      Parameters:
      context - the context to modify
    • getFlatAASBundles

      private Collection<org.eclipse.basyx.aas.bundle.AASBundle> getFlatAASBundles()
      Returns the flat AAS bundles.
      Returns:
      the bundles
    • createAggregatorServlet

      private org.eclipse.basyx.vab.protocol.http.server.VABHTTPInterface<?> createAggregatorServlet()
      Creates the aggregator servlet.
      Returns:
      the aggregator servlet
    • createAASAggregator

      private org.eclipse.basyx.aas.aggregator.api.IAASAggregator createAASAggregator()
      Creates the AAS aggregator.
      Returns:
      the aggregator instance
    • isMongoDBBackend

      private boolean isMongoDBBackend()
      Are we running a mongo DB backend?
      Returns:
      true for mongo, false else
    • createMongoDbConfiguration

      private org.eclipse.basyx.components.configuration.BaSyxMongoDBConfiguration createMongoDbConfiguration()
      Creates a mongo DB configuration.
      Returns:
      the configuration
    • createAASServerDecoratorList

      private List<org.eclipse.basyx.components.aas.aascomponent.IAASServerDecorator> createAASServerDecoratorList()
      Creates an AAS server decorator list.
      Returns:
      the decorator list
    • loadAASBundles

      private void loadAASBundles()
      Loads the AAS bundles.
    • loadAASFromSource

      private List<Collection<org.eclipse.basyx.aas.bundle.AASBundle>> loadAASFromSource(List<String> aasSources)
      Loads AAS from source.
      Parameters:
      aasSources - the sources
      Returns:
      the AAS bundle
    • getAASXFileSubPath

      private String getAASXFileSubPath(int aasxIndex)
      Returns the AASX file sub path.
      Parameters:
      aasxIndex - the AASX index
      Returns:
      the sub path
    • loadBundleFromFile

      private Set<org.eclipse.basyx.aas.bundle.AASBundle> loadBundleFromFile(String aasSource, String childFilePath)
      Loads an AAS source as bundle from a file.
      Parameters:
      aasSource - the AAS source
      Returns:
      the bundle
    • createRegistryFromConfig

      private org.eclipse.basyx.aas.registration.api.IAASRegistry createRegistryFromConfig(org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration aasConfig)
      Only creates the registry, if it hasn't been set explicitly before.
      Parameters:
      aasConfig - the server configuration
      Returns:
      the registry
    • shouldUseSecuredRegistryConnection

      private boolean shouldUseSecuredRegistryConnection(org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration aasConfig)
      Returns whether we should use a secured registry connection.
      Parameters:
      aasConfig - the AAS server configuration
      Returns:
      whether we should use a secured registry connection
    • registerWhitelistedSubmodels

      private void registerWhitelistedSubmodels()
      Registers whitelisted submodels.
    • registerSubmodelsFromWhitelist

      private void registerSubmodelsFromWhitelist()
      Registers submodels from a whitelist.
    • updateSMEndpoint

      private void updateSMEndpoint(String smId, List<org.eclipse.basyx.aas.metamodel.map.descriptor.AASDescriptor> descriptors)
      Updates a SM endpoint.
      Parameters:
      smId - the sm identifier
      descriptors - the related AAS descriptors
    • updateSMEndpoint

      private void updateSMEndpoint(org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor smDescriptor)
      Updates a SM endpoint.
      Parameters:
      smDescriptor - the submodel descriptor
    • findSMDescriptor

      private org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor findSMDescriptor(String smId, Collection<org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor> smDescriptors)
      Finds a SM descriptor.
      Parameters:
      smId - the SM id
      smDescriptors - the SM descriptors to search
      Returns:
      the descriptor or null
    • getSMEndpoint

      private String getSMEndpoint(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier smId)
      Returns the SM endpoint for the given SM id.
      Parameters:
      smId - the submodel id
      Returns:
      the endpoint
    • getSMIdShortFromSMId

      private String getSMIdShortFromSMId(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier smId)
      Returns an SM idShort from an sm identifier.
      Parameters:
      smId - the submodel id
      Returns:
      the idShort
      Throws:
      org.eclipse.basyx.vab.exception.provider.ResourceNotFoundException - if the submodel cannot be found
    • getAASIdFromSMId

      private String getAASIdFromSMId(org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier smId)
      Returns the AAS id from a submodel.
      Parameters:
      smId - the submodel id
      Returns:
      the AAS id
      Throws:
      org.eclipse.basyx.vab.exception.provider.ResourceNotFoundException - if the submodel cannot be found
    • modifyFilePaths

      private void modifyFilePaths(String hostName, int port, String rootPath)
      Fixes the File submodel element value paths according to the given endpoint configuration.
      Parameters:
      hostName - the hostname
      port - the port
      rootPath - the root path
    • modifyFilePathsInBundleSet

      private void modifyFilePathsInBundleSet(Collection<org.eclipse.basyx.aas.bundle.AASBundle> bundleSet, String hostName, int port, String bundleFileRootPath)
      Modifies the file paths in bundle set.
      Parameters:
      bundleSet - the bundle set
      hostName - the hostname
      port - the port
      bundleFileRootPath - the bundle root path
    • getMqttAASClientId

      private String getMqttAASClientId()
      Returns the MQTT AAS client id.
      Returns:
      the ID
    • getMqttSubmodelClientId

      private String getMqttSubmodelClientId()
      Returns the MQTT submodel client id.
      Returns:
      the ID
    • addAasxFilesResourceServlet

      private void addAasxFilesResourceServlet(org.eclipse.basyx.vab.protocol.http.server.BaSyxContext context)
      Adds an AASX files resource servlet.
      Parameters:
      context - the BaSyx context
    • createChildContextForAasxResourceFiles

      private org.apache.catalina.Context createChildContextForAasxResourceFiles(String childContextPath, String childDocbasePath)
      Creates a child context for AASX resource files.
      Parameters:
      childContextPath - the child context path
      childDocbasePath - the child docbase
      Returns:
      the child context
    • createBasyxResourceDirectoryIfNotExists

      private void createBasyxResourceDirectoryIfNotExists()
      Creates a resource directory if it does not exist.