Class AbstractSubmodel<S extends org.eclipse.basyx.submodel.metamodel.api.ISubModel>

java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx.AbstractSubmodel<S>
Type Parameters:
S - the BaSyx type implementing the sub-model
All Implemented Interfaces:
BaSyxElementTranslator.DataElementsRegistrar, BaSyxElementTranslator.OperationsRegistrar, BaSyxElementTranslator.RemainingSubmodelElementsRegistrar, BaSyxElementTranslator.SubmodelElementsRegistrar, de.iip_ecosphere.platform.support.aas.Element, de.iip_ecosphere.platform.support.aas.ElementContainer, de.iip_ecosphere.platform.support.aas.HasDataSpecification, de.iip_ecosphere.platform.support.aas.HasKind, de.iip_ecosphere.platform.support.aas.HasSemantics, de.iip_ecosphere.platform.support.aas.Identifiable, de.iip_ecosphere.platform.support.aas.Qualifiable, de.iip_ecosphere.platform.support.aas.Referable, de.iip_ecosphere.platform.support.aas.Submodel
Direct Known Subclasses:
BaSyxISubmodel, BaSyxSubmodel

public abstract class AbstractSubmodel<S extends org.eclipse.basyx.submodel.metamodel.api.ISubModel>
extends Object
implements de.iip_ecosphere.platform.support.aas.Submodel, BaSyxElementTranslator.SubmodelElementsRegistrar
Basic sub-model implementation.
Author:
Holger Eichelberger, SSE
  • Field Details

    • submodel

      private S extends org.eclipse.basyx.submodel.metamodel.api.ISubModel submodel
    • operations

      private Map<String,​de.iip_ecosphere.platform.support.aas.Operation> operations
    • dataElements

      private Map<String,​de.iip_ecosphere.platform.support.aas.DataElement> dataElements
    • properties

      private Map<String,​de.iip_ecosphere.platform.support.aas.Property> properties
    • submodelElements

      private Map<String,​de.iip_ecosphere.platform.support.aas.SubmodelElement> submodelElements
  • Constructor Details

    • AbstractSubmodel

      protected AbstractSubmodel​(S submodel)
      Creates an instance. Prevents external creation.
      Parameters:
      submodel - the sub model instance
  • Method Details

    • getSubmodel

      S getSubmodel()
      Returns the sub-model instance.
      Returns:
      the sub-model instance
    • warn

      private void warn​(String msg)
      Emits a warning.
      Parameters:
      msg - the message to be emitted
    • register

      public BaSyxOperation register​(BaSyxOperation operation)
      Registers an operation.
      Specified by:
      register in interface BaSyxElementTranslator.OperationsRegistrar
      Parameters:
      operation - the operation
      Returns:
      operation
    • register

      public BaSyxProperty register​(BaSyxProperty property)
      Registers a property.
      Specified by:
      register in interface BaSyxElementTranslator.DataElementsRegistrar
      Parameters:
      property - the property
      Returns:
      property
    • register

      public BaSyxReferenceElement register​(BaSyxReferenceElement reference)
      Registers a reference element.
      Specified by:
      register in interface BaSyxElementTranslator.RemainingSubmodelElementsRegistrar
      Parameters:
      reference - the reference element
      Returns:
      reference
    • register

      Registers a sub-model element collection.
      Specified by:
      register in interface BaSyxElementTranslator.RemainingSubmodelElementsRegistrar
      Parameters:
      collection - the element collection
      Returns:
      collection
    • getIdShort

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

      public Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> submodelElements()
      Specified by:
      submodelElements in interface de.iip_ecosphere.platform.support.aas.ElementContainer
    • properties

      public Iterable<de.iip_ecosphere.platform.support.aas.Property> properties()
      Specified by:
      properties in interface de.iip_ecosphere.platform.support.aas.ElementContainer
    • dataElements

      public Iterable<de.iip_ecosphere.platform.support.aas.DataElement> dataElements()
      Specified by:
      dataElements in interface de.iip_ecosphere.platform.support.aas.ElementContainer
    • operations

      public Iterable<de.iip_ecosphere.platform.support.aas.Operation> operations()
      Specified by:
      operations in interface de.iip_ecosphere.platform.support.aas.ElementContainer
    • getSubmodelElementsCount

      public int getSubmodelElementsCount()
      Specified by:
      getSubmodelElementsCount in interface de.iip_ecosphere.platform.support.aas.ElementContainer
    • getDataElementsCount

      public int getDataElementsCount()
      Specified by:
      getDataElementsCount in interface de.iip_ecosphere.platform.support.aas.ElementContainer
    • getOperationsCount

      public int getOperationsCount()
      Specified by:
      getOperationsCount in interface de.iip_ecosphere.platform.support.aas.ElementContainer
    • getDataElement

      public de.iip_ecosphere.platform.support.aas.DataElement getDataElement​(String idShort)
      Specified by:
      getDataElement in interface de.iip_ecosphere.platform.support.aas.Submodel
    • getProperty

      public de.iip_ecosphere.platform.support.aas.Property getProperty​(String idShort)
      Specified by:
      getProperty in interface de.iip_ecosphere.platform.support.aas.Submodel
    • getPropertiesCount

      public int getPropertiesCount()
      Specified by:
      getPropertiesCount in interface de.iip_ecosphere.platform.support.aas.ElementContainer
    • getReferenceElement

      public de.iip_ecosphere.platform.support.aas.ReferenceElement getReferenceElement​(String idShort)
      Specified by:
      getReferenceElement in interface de.iip_ecosphere.platform.support.aas.Submodel
    • getOperation

      public de.iip_ecosphere.platform.support.aas.Operation getOperation​(String idShort)
      Specified by:
      getOperation in interface de.iip_ecosphere.platform.support.aas.Submodel
    • getSubmodelElement

      public de.iip_ecosphere.platform.support.aas.SubmodelElement getSubmodelElement​(String idShort)
      Specified by:
      getSubmodelElement in interface de.iip_ecosphere.platform.support.aas.Submodel
    • getSubmodelElementCollection

      public de.iip_ecosphere.platform.support.aas.SubmodelElementCollection getSubmodelElementCollection​(String idShort)
      Specified by:
      getSubmodelElementCollection in interface de.iip_ecosphere.platform.support.aas.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.Submodel
    • delete

      public void delete​(de.iip_ecosphere.platform.support.aas.SubmodelElement elt)
      Specified by:
      delete in interface de.iip_ecosphere.platform.support.aas.Submodel
    • getSubmodelEndpoint

      public static String getSubmodelEndpoint​(de.iip_ecosphere.platform.support.ServerAddress server, de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel)
      Returns an AAS sub-model URI according to the BaSyx naming schema. [public for testing, debugging]
      Parameters:
      server - the server address
      aas - the AAS
      submodel - the sub-model
      Returns:
      the endpoint URI