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.SubmodelElementsRegistrar,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:
BaSyxISubmodel,BaSyxSubmodel
public abstract class AbstractSubmodel<S extends org.eclipse.basyx.submodel.metamodel.api.ISubmodel> extends java.lang.Object implements de.iip_ecosphere.platform.support.aas.Submodel, BaSyxElementTranslator.SubmodelElementsRegistrar
Basic sub-model implementation.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.aas.DataElement>dataElementsprivate java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.Builder<?>>deferredprivate java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.aas.Operation>operationsprivate java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.aas.Property>propertiesprivate Ssubmodelprivate java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.aas.SubmodelElement>submodelElements
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSubmodel(S submodel)Creates an instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(de.iip_ecosphere.platform.support.aas.AasVisitor visitor)voidbuildDeferred()CallsBuilder.build()on all deferred builders.de.iip_ecosphere.platform.support.aas.ReferencecreateReference()java.lang.Iterable<de.iip_ecosphere.platform.support.aas.DataElement>dataElements()(package private) voiddefer(java.lang.String shortId, de.iip_ecosphere.platform.support.Builder<?> builder)Registers a sub-build as deferred.voiddelete(de.iip_ecosphere.platform.support.aas.SubmodelElement elt)de.iip_ecosphere.platform.support.aas.DataElementgetDataElement(java.lang.String idShort)intgetDataElementsCount()<B extends de.iip_ecosphere.platform.support.Builder<?>>
BgetDeferred(java.lang.String shortId, java.lang.Class<B> cls)Returns a deferred builder.java.lang.StringgetIdentification()Returns the identification of the submodel.java.lang.StringgetIdShort()de.iip_ecosphere.platform.support.aas.OperationgetOperation(java.lang.String idShort)intgetOperationsCount()intgetPropertiesCount()de.iip_ecosphere.platform.support.aas.PropertygetProperty(java.lang.String idShort)de.iip_ecosphere.platform.support.aas.ReferenceElementgetReferenceElement(java.lang.String idShort)(package private) SgetSubmodel()Returns the sub-model instance.de.iip_ecosphere.platform.support.aas.SubmodelElementgetSubmodelElement(java.lang.String idShort)de.iip_ecosphere.platform.support.aas.SubmodelElementCollectiongetSubmodelElementCollection(java.lang.String idShort)intgetSubmodelElementsCount()static java.lang.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.java.lang.Iterable<de.iip_ecosphere.platform.support.aas.Operation>operations()java.lang.Iterable<de.iip_ecosphere.platform.support.aas.Property>properties()<D extends org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.DataElement>
BaSyxDataElement<D>register(BaSyxDataElement<D> dataElement)Registers a data element.BaSyxFileregister(BaSyxFile file)Registers a file data element.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.java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement>submodelElements()private voidwarn(java.lang.String msg)Emits a warning.
-
-
-
Field Detail
-
submodel
private S extends org.eclipse.basyx.submodel.metamodel.api.ISubmodel submodel
-
operations
private java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.aas.Operation> operations
-
dataElements
private java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.aas.DataElement> dataElements
-
properties
private java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.aas.Property> properties
-
submodelElements
private java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.aas.SubmodelElement> submodelElements
-
deferred
private java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.Builder<?>> deferred
-
-
Constructor Detail
-
AbstractSubmodel
protected AbstractSubmodel(S submodel)
Creates an instance. Prevents external creation.- Parameters:
submodel- the sub model instance
-
-
Method Detail
-
getSubmodel
S getSubmodel()
Returns the sub-model instance.- Returns:
- the sub-model instance
-
warn
private void warn(java.lang.String msg)
Emits a warning.- Parameters:
msg- the message to be emitted
-
register
public BaSyxFile register(BaSyxFile file)
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a file data element.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
file- the file data element- Returns:
file
-
register
public BaSyxOperation register(BaSyxOperation operation)
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters an operation.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
operation- the operation- Returns:
operation
-
register
public BaSyxProperty register(BaSyxProperty property)
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a property.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
property- the property- Returns:
property
-
register
public BaSyxReferenceElement register(BaSyxReferenceElement reference)
Description copied from interface:BaSyxElementTranslator.SubmodelElementsRegistrarRegisters a reference element.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
reference- the reference- Returns:
reference
-
register
public BaSyxSubmodelElementCollection register(BaSyxSubmodelElementCollection collection)
Registers a sub-model element collection.- Specified by:
registerin interfaceBaSyxElementTranslator.SubmodelElementsRegistrar- Parameters:
collection- the element collection- Returns:
collection
-
register
public <D extends org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.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
-
getIdShort
public java.lang.String getIdShort()
- Specified by:
getIdShortin interfacede.iip_ecosphere.platform.support.aas.Element
-
submodelElements
public java.lang.Iterable<de.iip_ecosphere.platform.support.aas.SubmodelElement> submodelElements()
- Specified by:
submodelElementsin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
properties
public java.lang.Iterable<de.iip_ecosphere.platform.support.aas.Property> properties()
- Specified by:
propertiesin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
dataElements
public java.lang.Iterable<de.iip_ecosphere.platform.support.aas.DataElement> dataElements()
- Specified by:
dataElementsin interfacede.iip_ecosphere.platform.support.aas.ElementContainer
-
operations
public java.lang.Iterable<de.iip_ecosphere.platform.support.aas.Operation> 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
public de.iip_ecosphere.platform.support.aas.DataElement getDataElement(java.lang.String idShort)
- Specified by:
getDataElementin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getProperty
public de.iip_ecosphere.platform.support.aas.Property getProperty(java.lang.String idShort)
- 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
public de.iip_ecosphere.platform.support.aas.ReferenceElement getReferenceElement(java.lang.String idShort)
- Specified by:
getReferenceElementin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getOperation
public de.iip_ecosphere.platform.support.aas.Operation getOperation(java.lang.String idShort)
- Specified by:
getOperationin interfacede.iip_ecosphere.platform.support.aas.ElementsAccess
-
getSubmodelElement
public de.iip_ecosphere.platform.support.aas.SubmodelElement getSubmodelElement(java.lang.String idShort)
- Specified by:
getSubmodelElementin interfacede.iip_ecosphere.platform.support.aas.Submodel
-
getSubmodelElementCollection
public de.iip_ecosphere.platform.support.aas.SubmodelElementCollection getSubmodelElementCollection(java.lang.String idShort)
- Specified by:
getSubmodelElementCollectionin 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
-
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 java.lang.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
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 elementbuilder- the sub-builder to be registered- See Also:
buildDeferred()
-
buildDeferred
public void buildDeferred()
CallsBuilder.build()on all deferred builders.- Specified by:
buildDeferredin interfacede.iip_ecosphere.platform.support.aas.DeferredParent- See Also:
defer(String, Builder)
-
getDeferred
public <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 idcls- the builder type- Returns:
- the builder or null if no builder for
shortIdwith the respective type is registered
-
getIdentification
public java.lang.String 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.
-
-