Class AbstractSubmodel<S extends org.eclipse.digitaltwin.aas4j.v3.model.Submodel>
java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.AbstractSubmodel<S>
- Type Parameters:
S- the BaSyx type implementing the sub-model
- All Implemented Interfaces:
BaSyxElementTranslator.SubmodelElementsRegistrar,BaSyxSubmodelElementParent,de.iip_ecosphere.platform.support.aas.DeferredParent,de.iip_ecosphere.platform.support.aas.Element,de.iip_ecosphere.platform.support.aas.ElementContainer,de.iip_ecosphere.platform.support.aas.ElementsAccess,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:
BaSyxSubmodel
public abstract class AbstractSubmodel<S extends org.eclipse.digitaltwin.aas4j.v3.model.Submodel>
extends Object
implements de.iip_ecosphere.platform.support.aas.Submodel, BaSyxElementTranslator.SubmodelElementsRegistrar, BaSyxSubmodelElementParent
Basic sub-model implementation.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.iip_ecosphere.platform.support.aas.Submodel
de.iip_ecosphere.platform.support.aas.Submodel.IteratorFunction<T extends de.iip_ecosphere.platform.support.aas.SubmodelElement>, de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(de.iip_ecosphere.platform.support.aas.AasVisitor visitor) voidCallsBuilder.build()on all deferred builders.de.iip_ecosphere.platform.support.aas.ReferenceIterable<de.iip_ecosphere.platform.support.aas.DataElement> (package private) voidRegisters a sub-build as deferred.voiddeleteElement(de.iip_ecosphere.platform.support.aas.SubmodelElement elt) voiddeleteElement(String idShort) (package private) voiddeleteSubmodelElement(String idShort) Removes a submodel element through its idShort.(package private) abstract BaSyxSubmodelParentgetAas()Returns the parent AAS.de.iip_ecosphere.platform.support.aas.DataElementgetDataElement(String idShort) int<B extends de.iip_ecosphere.platform.support.Builder<?>>
BgetDeferred(String shortId, Class<B> cls) Returns a deferred builder.de.iip_ecosphere.platform.support.aas.EntityReturns the identification of the submodel.Returns the short id of the element.de.iip_ecosphere.platform.support.aas.OperationgetOperation(String idShort) intintde.iip_ecosphere.platform.support.aas.PropertygetProperty(String idShort) de.iip_ecosphere.platform.support.aas.ReferenceElementgetReferenceElement(String idShort) de.iip_ecosphere.platform.support.aas.RelationshipElementgetRelationshipElement(String idShort) getSemanticId(boolean stripPrefix) Returns the sub-model instance.de.iip_ecosphere.platform.support.aas.SubmodelElementgetSubmodelElement(String idShort) de.iip_ecosphere.platform.support.aas.SubmodelElementCollectiongetSubmodelElementCollection(String idShort) de.iip_ecosphere.platform.support.aas.SubmodelElementListgetSubmodelElementList(String idShort) intstatic 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> Iterable<de.iip_ecosphere.platform.support.aas.Property> private <T extends BaSyxSubmodelElement>
Treg(T elt) Generic registration actions onelt.Registers a BLOB data element.<D extends org.eclipse.digitaltwin.aas4j.v3.model.DataElement>
BaSyxDataElement<D> register(BaSyxDataElement<D> dataElement) Registers a data element.register(BaSyxEntity entity) Registers an entity.Registers a file data element.register(BaSyxMultiLanguageProperty property) Registers a multi-language property.register(BaSyxOperation operation) Registers an operation.register(BaSyxProperty property) Registers a property.register(BaSyxRange range) Registers a range element.register(BaSyxReferenceElement reference) Registers a reference element.register(BaSyxRelationshipElement relationship) Registers a relationship element.register(BaSyxSubmodelElementCollection collection) Registers a sub-model element collection.Registers a sub-model element list.<T extends de.iip_ecosphere.platform.support.aas.SubmodelElement>
TregisterElement(T elt) Registers an element.protected voidResets this submodel with a new instance.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> private voidEmits a warning.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.support.aas.basyx2.BaSyxSubmodelElementParent
getParent, getPathElement, processOnPathMethods inherited from interface de.iip_ecosphere.platform.support.aas.Element
updateMethods inherited from interface de.iip_ecosphere.platform.support.aas.HasSemantics
getSemanticId, setSemanticIdMethods inherited from interface de.iip_ecosphere.platform.support.aas.Submodel
create, createSubmodelElementCollectionBuilder, createSubmodelElementContainerBuilder, createSubmodelElementListBuilder, iterate, refreshOnUse
-
Field Details
-
submodel
-
operations
-
dataElements
-
properties
-
submodelElements
-
deferred
-
-
Constructor Details
-
AbstractSubmodel
Creates an instance. Prevents external creation.- Parameters:
submodel- the submodel instance
-
-
Method Details
-
reset
Resets this submodel with a new instance.- Parameters:
submodel- the new submodel instance
-
getSubmodel
Returns the sub-model instance.- Returns:
- the sub-model instance
-
warn
Emits a warning.- Parameters:
msg- the message to be emitted
-
register
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a file data element.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
file- the file data element- Returns:
file
-
register
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a range element.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
range- the range element- Returns:
range
-
register
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a BLOB data element.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
blob- the BLOB data element- Returns:
blob
-
register
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a relationship element.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
relationship- the relationship element- Returns:
relationship
-
registerElement
public <T extends de.iip_ecosphere.platform.support.aas.SubmodelElement> T registerElement(T elt) Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters an element. Default for all remaining registration functions in this interface.- Specified by:
registerElementin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Type Parameters:
T- the actual type of the element- Parameters:
elt- the element- Returns:
elt
-
register
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters an entity.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
entity- the entity- Returns:
entity
-
register
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters an operation.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
operation- the operation- Returns:
operation
-
register
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a property.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
property- the property- Returns:
property
-
register
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a multi-language property.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
property- the property- Returns:
property
-
register
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a reference element.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
reference- the reference- Returns:
reference
-
register
Registers a sub-model element collection.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
collection- the element collection- Returns:
collection
-
register
Registers a sub-model element list.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
list- the element list- Returns:
collection
-
register
public <D extends org.eclipse.digitaltwin.aas4j.v3.model.DataElement> BaSyxDataElement<D> register(BaSyxDataElement<D> dataElement) Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a data element.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Type Parameters:
D- the element type- Parameters:
dataElement- the element to register- Returns:
dataElement
-
reg
Generic registration actions onelt.- Type Parameters:
T- the element type- Parameters:
elt- the element to register- Returns:
elt
-
getIdShort
Description copied from interface:BaSyxSubmodelElementParentReturns the short id of the element.- Specified by:
getIdShortin interfaceBaSyxSubmodelElementParent- Specified by:
getIdShortin interfacede.iip_ecosphere.platform.support.aas.Element- Specified by:
getIdShortin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess- Returns:
- the short id
-
submodelElements
- Specified by:
submodelElementsin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
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.ElementsAccess
-
getProperty
- Specified by:
getPropertyin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getPropertiesCount
public int getPropertiesCount()- Specified by:
getPropertiesCountin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
getReferenceElement
- Specified by:
getReferenceElementin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getRelationshipElement
public de.iip_ecosphere.platform.support.aas.RelationshipElement getRelationshipElement(String idShort) - Specified by:
getRelationshipElementin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getOperation
- Specified by:
getOperationin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getSubmodelElement
- Specified by:
getSubmodelElementin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getSubmodelElementCollection
public de.iip_ecosphere.platform.support.aas.SubmodelElementCollection getSubmodelElementCollection(String idShort) - Specified by:
getSubmodelElementCollectionin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getSubmodelElementList
public de.iip_ecosphere.platform.support.aas.SubmodelElementList getSubmodelElementList(String idShort) - Specified by:
getSubmodelElementListin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getEntity
- Specified by:
getEntityin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
accept
public void accept(de.iip_ecosphere.platform.support.aas.AasVisitor visitor) - Specified by:
acceptin interfacede.iip_ecosphere.platform.support.aas.Element- Specified by:
acceptin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
createReference
public de.iip_ecosphere.platform.support.aas.Reference createReference()- Specified by:
createReferencein interfacede.iip_ecosphere.platform.support.aas.Submodel
-
deleteElement
public void deleteElement(de.iip_ecosphere.platform.support.aas.SubmodelElement elt) - Specified by:
deleteElementin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
deleteElement
- Specified by:
deleteElementin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
deleteSubmodelElement
Removes a submodel element through its idShort.- Parameters:
idShort- the idshort to remove
-
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
-
defer
Registers a sub-build as deferred.- Parameters:
shortId- the shortId of the elementbuilder- the sub-builder to be registered- See Also:
-
buildDeferred
public void buildDeferred()CallsBuilder.build()on all deferred builders.- Specified by:
buildDeferredin interfacede.iip_ecosphere.platform.support.aas.DeferredParent- See Also:
-
getDeferred
public <B extends de.iip_ecosphere.platform.support.Builder<?>> B getDeferred(String shortId, Class<B> cls) Returns a deferred builder.- Type Parameters:
B- the builder type- Parameters:
shortId- the short idcls- the builder type- Returns:
- the builder or null if no builder for
shortIdwith the respective type is registered
-
getIdentification
Returns the identification of the submodel.- Specified by:
getIdentificationin interfacede.iip_ecosphere.platform.support.aas.Identifiable- Returns:
- the identification (prefixed according to
IdentifierType, custom if none matches). Can e.g. be used withRegistryif not null.
-
getAas
Returns the parent AAS.- Returns:
- the parent AAS
-
getSemanticId
- Specified by:
getSemanticIdin interfacede.iip_ecosphere.platform.support.aas.HasSemantics
-