Class AbstractAas<A extends org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell>

  • Type Parameters:
    A - the BaSyx AAS type to wrap
    All Implemented Interfaces:
    de.iip_ecosphere.platform.support.aas.Aas, de.iip_ecosphere.platform.support.aas.DeferredParent, de.iip_ecosphere.platform.support.aas.Element, de.iip_ecosphere.platform.support.aas.HasDataSpecification, de.iip_ecosphere.platform.support.aas.Identifiable, de.iip_ecosphere.platform.support.aas.Referable
    Direct Known Subclasses:
    BaSyxAas, BaSyxConnectedAas

    public abstract class AbstractAas<A extends org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell>
    extends java.lang.Object
    implements de.iip_ecosphere.platform.support.aas.Aas
    Abstract implementation of the Aas interface.
    Author:
    Holger Eichelberger, SSE
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AbstractAas.BaSyxAbstractAasBuilder
      An abstract builder for two concrete AAS types in BaSyx.
      static interface  AbstractAas.BaSyxSubmodelParent
      Represents the parent instance of a sub-model.
      • Nested classes/interfaces inherited from interface de.iip_ecosphere.platform.support.aas.Aas

        de.iip_ecosphere.platform.support.aas.Aas.AasBuilder
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private A aas  
      private BaSyxAsset asset  
      private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.Builder<?>> deferred  
      private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.aas.Submodel> submodels  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractAas​(A aas)
      Creates an instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(de.iip_ecosphere.platform.support.aas.AasVisitor visitor)  
      void buildDeferred()
      Calls Builder.build() on all deferred builders.
      de.iip_ecosphere.platform.support.aas.Reference createReference()  
      (package private) void defer​(java.lang.String shortId, de.iip_ecosphere.platform.support.Builder<?> builder)
      Registers a sub-build as deferred.
      void delete​(de.iip_ecosphere.platform.support.aas.Submodel submodel)  
      (package private) A getAas()
      Returns the AAS instance.
      static java.lang.String getAasEndpoint​(de.iip_ecosphere.platform.support.ServerAddress server, de.iip_ecosphere.platform.support.aas.Aas aas)
      Returns an AAS endpoint URI according to the BaSyx naming schema.
      de.iip_ecosphere.platform.support.aas.Asset getAsset()  
      (package private) <B extends de.iip_ecosphere.platform.support.Builder<?>>
      B
      getDeferred​(java.lang.String shortId, java.lang.Class<B> cls)
      Returns a deferred builder.
      java.lang.String getIdentification()
      Returns the identification of the AAS.
      java.lang.String getIdShort()  
      de.iip_ecosphere.platform.support.aas.Submodel getSubmodel​(java.lang.String idShort)  
      int getSubmodelCount()  
      de.iip_ecosphere.platform.support.aas.types.technicaldata.TechnicalDataSubmodel getTechnicalDataSubmodel()  
      (package private) <S extends de.iip_ecosphere.platform.support.aas.Submodel>
      S
      register​(S submodel)
      Registers a sub-model.
      protected void setAsset​(BaSyxAsset asset)
      Defines the asset.
      java.lang.Iterable<de.iip_ecosphere.platform.support.aas.Submodel> submodels()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface de.iip_ecosphere.platform.support.aas.Aas

        createAasBuilder, createSubmodelBuilder
      • Methods inherited from interface de.iip_ecosphere.platform.support.aas.Element

        update
    • Field Detail

      • aas

        private A extends org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell aas
      • submodels

        private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.aas.Submodel> submodels
      • deferred

        private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.Builder<?>> deferred
    • Constructor Detail

      • AbstractAas

        protected AbstractAas​(A aas)
        Creates an instance. Prevents external creation.
        Parameters:
        aas - the BaSyx AAS instance
    • Method Detail

      • getAas

        A getAas()
        Returns the AAS instance.
        Returns:
        the AAS instance
      • getIdShort

        public java.lang.String getIdShort()
        Specified by:
        getIdShort in interface de.iip_ecosphere.platform.support.aas.Element
      • submodels

        public java.lang.Iterable<de.iip_ecosphere.platform.support.aas.Submodel> submodels()
        Specified by:
        submodels in interface de.iip_ecosphere.platform.support.aas.Aas
      • getSubmodelCount

        public int getSubmodelCount()
        Specified by:
        getSubmodelCount in interface de.iip_ecosphere.platform.support.aas.Aas
      • getSubmodel

        public de.iip_ecosphere.platform.support.aas.Submodel getSubmodel​(java.lang.String idShort)
        Specified by:
        getSubmodel in interface de.iip_ecosphere.platform.support.aas.Aas
      • register

        <S extends de.iip_ecosphere.platform.support.aas.Submodel> S register​(S submodel)
        Registers a sub-model.
        Type Parameters:
        S - the actual sub-model type
        Parameters:
        submodel - the sub-model to register
        Returns:
        subModel
      • accept

        public void accept​(de.iip_ecosphere.platform.support.aas.AasVisitor visitor)
        Specified by:
        accept in interface de.iip_ecosphere.platform.support.aas.Element
      • createReference

        public de.iip_ecosphere.platform.support.aas.Reference createReference()
        Specified by:
        createReference in interface de.iip_ecosphere.platform.support.aas.Aas
      • getAsset

        public de.iip_ecosphere.platform.support.aas.Asset getAsset()
        Specified by:
        getAsset in interface de.iip_ecosphere.platform.support.aas.Aas
      • setAsset

        protected void setAsset​(BaSyxAsset asset)
        Defines the asset.
        Parameters:
        asset - the asset
      • delete

        public void delete​(de.iip_ecosphere.platform.support.aas.Submodel submodel)
        Specified by:
        delete in interface de.iip_ecosphere.platform.support.aas.Aas
      • getAasEndpoint

        public static java.lang.String getAasEndpoint​(de.iip_ecosphere.platform.support.ServerAddress server,
                                                      de.iip_ecosphere.platform.support.aas.Aas aas)
        Returns an AAS endpoint URI according to the BaSyx naming schema. [public for testing, debugging]
        Parameters:
        server - the server address
        aas - the AAS
        Returns:
        the endpoint URI
      • defer

        void defer​(java.lang.String shortId,
                   de.iip_ecosphere.platform.support.Builder<?> builder)
        Registers a sub-build as deferred.
        Parameters:
        shortId - the shortId of the element
        builder - the sub-builder to be registered
        See Also:
        buildDeferred()
      • buildDeferred

        public void buildDeferred()
        Calls Builder.build() on all deferred builders.
        Specified by:
        buildDeferred in interface de.iip_ecosphere.platform.support.aas.DeferredParent
        See Also:
        defer(String, Builder)
      • getDeferred

        <B extends de.iip_ecosphere.platform.support.Builder<?>> B getDeferred​(java.lang.String shortId,
                                                                               java.lang.Class<B> cls)
        Returns a deferred builder.
        Type Parameters:
        B - the builder type
        Parameters:
        shortId - the short id
        cls - the builder type
        Returns:
        the builder or null if no builder for shortId with the respective type is registered
      • getTechnicalDataSubmodel

        public de.iip_ecosphere.platform.support.aas.types.technicaldata.TechnicalDataSubmodel getTechnicalDataSubmodel()
        Specified by:
        getTechnicalDataSubmodel in interface de.iip_ecosphere.platform.support.aas.Aas
      • getIdentification

        public java.lang.String getIdentification()
        Returns the identification of the AAS.
        Specified by:
        getIdentification in interface de.iip_ecosphere.platform.support.aas.Identifiable
        Returns:
        the identification (prefixed according to IdentifierType, custom if none matches). Can e.g. be used with Registry if not null.