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
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description private Map<String,de.iip_ecosphere.platform.support.aas.DataElement>dataElementsprivate Map<String,de.iip_ecosphere.platform.support.aas.Operation>operationsprivate Map<String,de.iip_ecosphere.platform.support.aas.Property>propertiesprivate Ssubmodelprivate Map<String,de.iip_ecosphere.platform.support.aas.SubmodelElement>submodelElements -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSubmodel(S submodel)Creates an instance. -
Method Summary
Modifier and Type Method Description voidaccept(de.iip_ecosphere.platform.support.aas.AasVisitor visitor)de.iip_ecosphere.platform.support.aas.ReferencecreateReference()Iterable<de.iip_ecosphere.platform.support.aas.DataElement>dataElements()voiddelete(de.iip_ecosphere.platform.support.aas.SubmodelElement elt)de.iip_ecosphere.platform.support.aas.DataElementgetDataElement(String idShort)intgetDataElementsCount()StringgetIdShort()de.iip_ecosphere.platform.support.aas.OperationgetOperation(String idShort)intgetOperationsCount()intgetPropertiesCount()de.iip_ecosphere.platform.support.aas.PropertygetProperty(String idShort)de.iip_ecosphere.platform.support.aas.ReferenceElementgetReferenceElement(String idShort)(package private) SgetSubmodel()Returns the sub-model instance.de.iip_ecosphere.platform.support.aas.SubmodelElementgetSubmodelElement(String idShort)de.iip_ecosphere.platform.support.aas.SubmodelElementCollectiongetSubmodelElementCollection(String idShort)intgetSubmodelElementsCount()static StringgetSubmodelEndpoint(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.Iterable<de.iip_ecosphere.platform.support.aas.Operation>operations()Iterable<de.iip_ecosphere.platform.support.aas.Property>properties()BaSyxOperationregister(BaSyxOperation operation)Registers an operation.BaSyxPropertyregister(BaSyxProperty property)Registers a property.BaSyxReferenceElementregister(BaSyxReferenceElement reference)Registers a reference element.BaSyxSubmodelElementCollectionregister(BaSyxSubmodelElementCollection collection)Registers a sub-model element collection.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement>submodelElements()private voidwarn(String msg)Emits a warning.
-
Field Details
-
Constructor Details
-
AbstractSubmodel
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
Emits a warning.- Parameters:
msg- the message to be emitted
-
register
Registers an operation.- Specified by:
registerin interfaceBaSyxElementTranslator.OperationsRegistrar- Parameters:
operation- the operation- Returns:
operation
-
register
Registers a property.- Specified by:
registerin interfaceBaSyxElementTranslator.DataElementsRegistrar- Parameters:
property- the property- Returns:
property
-
register
Registers a reference element.- Specified by:
registerin interfaceBaSyxElementTranslator.RemainingSubmodelElementsRegistrar- Parameters:
reference- the reference element- Returns:
reference
-
register
Registers a sub-model element collection.- Specified by:
registerin interfaceBaSyxElementTranslator.RemainingSubmodelElementsRegistrar- Parameters:
collection- the element collection- Returns:
collection
-
getIdShort
- Specified by:
getIdShortin interfacede.iip_ecosphere.platform.support.aas.Element
-
submodelElements
- Specified by:
submodelElementsin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
properties
- Specified by:
propertiesin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
dataElements
- Specified by:
dataElementsin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
operations
- Specified by:
operationsin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
getSubmodelElementsCount
public int getSubmodelElementsCount()- Specified by:
getSubmodelElementsCountin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
getDataElementsCount
public int getDataElementsCount()- Specified by:
getDataElementsCountin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
getOperationsCount
public int getOperationsCount()- Specified by:
getOperationsCountin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
getDataElement
- Specified by:
getDataElementin interfacede.iip_ecosphere.platform.support.aas.Submodel
-
getProperty
- Specified by:
getPropertyin interfacede.iip_ecosphere.platform.support.aas.Submodel
-
getPropertiesCount
public int getPropertiesCount()- Specified by:
getPropertiesCountin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
getReferenceElement
- Specified by:
getReferenceElementin interfacede.iip_ecosphere.platform.support.aas.Submodel
-
getOperation
- Specified by:
getOperationin interfacede.iip_ecosphere.platform.support.aas.Submodel
-
getSubmodelElement
- Specified by:
getSubmodelElementin interfacede.iip_ecosphere.platform.support.aas.Submodel
-
getSubmodelElementCollection
public de.iip_ecosphere.platform.support.aas.SubmodelElementCollection getSubmodelElementCollection(String idShort)- Specified by:
getSubmodelElementCollectionin interfacede.iip_ecosphere.platform.support.aas.Submodel
-
accept
public void accept(de.iip_ecosphere.platform.support.aas.AasVisitor visitor)- Specified by:
acceptin interfacede.iip_ecosphere.platform.support.aas.Element
-
createReference
public de.iip_ecosphere.platform.support.aas.Reference createReference()- Specified by:
createReferencein interfacede.iip_ecosphere.platform.support.aas.Submodel
-
delete
public void delete(de.iip_ecosphere.platform.support.aas.SubmodelElement elt)- Specified by:
deletein interfacede.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 addressaas- the AASsubmodel- the sub-model- Returns:
- the endpoint URI
-