Class VABSubmodelAPI
- java.lang.Object
-
- org.eclipse.basyx.submodel.restapi.vab.VABSubmodelAPI
-
- All Implemented Interfaces:
ISubmodelAPI
public class VABSubmodelAPI extends Object implements ISubmodelAPI
Implements the Submodel API by mapping it to VAB paths- Author:
- schnicke
-
-
Constructor Summary
Constructors Constructor Description VABSubmodelAPI(IModelProvider modelProvider)
Creates a VABSubmodelAPI that wraps an IModelProvider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubmodelElement(String idShortPath, ISubmodelElement elem)
Adds a submodelElement to the submodelvoid
addSubmodelElement(ISubmodelElement elem)
Adds a submodelElement to the submodelvoid
deleteSubmodelElement(String idShortPath)
Removes a submodelElement from the submodelObject
getOperationResult(String idShortPath, String requestId)
Gets the result of an asynchronously invoked operationCollection<IOperation>
getOperations()
Helper function for quick access of operationsSubmodel
getSubmodel()
Retrieves the underlying submodelISubmodelElement
getSubmodelElement(String idShortPath)
Retrieves a submodelElementFile
getSubmodelElementFile(String idShortPath)
Collection<ISubmodelElement>
getSubmodelElements()
Helper function for quick access of submodelElementsObject
getSubmodelElementValue(String idShortPath)
Retrieves the value of a submodelElementObject
invokeAsync(String idShortPath, Object... params)
Invoke an operation asynchronouslyObject
invokeOperation(String idShortPath, Object... params)
Invokes an operationvoid
updateSubmodelElement(String idShortPath, Object newValue)
Updates the value of a submodelElementvoid
uploadSubmodelElementFile(String idShortPath, InputStream fileStream)
-
-
-
Constructor Detail
-
VABSubmodelAPI
public VABSubmodelAPI(IModelProvider modelProvider)
Creates a VABSubmodelAPI that wraps an IModelProvider- Parameters:
modelProvider
- providing the Submodel
-
-
Method Detail
-
getSubmodel
public Submodel getSubmodel()
Description copied from interface:ISubmodelAPI
Retrieves the underlying submodel- Specified by:
getSubmodel
in interfaceISubmodelAPI
- Returns:
- the submodel
-
addSubmodelElement
public void addSubmodelElement(ISubmodelElement elem)
Description copied from interface:ISubmodelAPI
Adds a submodelElement to the submodel- Specified by:
addSubmodelElement
in interfaceISubmodelAPI
- Parameters:
elem
- the submodelElement to be added
-
addSubmodelElement
public void addSubmodelElement(String idShortPath, ISubmodelElement elem)
Description copied from interface:ISubmodelAPI
Adds a submodelElement to the submodel- Specified by:
addSubmodelElement
in interfaceISubmodelAPI
- Parameters:
idShortPath
- the idShort path to the submodelElementelem
- the submodelElement to be added
-
deleteSubmodelElement
public void deleteSubmodelElement(String idShortPath)
Description copied from interface:ISubmodelAPI
Removes a submodelElement from the submodel- Specified by:
deleteSubmodelElement
in interfaceISubmodelAPI
- Parameters:
idShortPath
- the idShort path to the submodelElement, which is to be removed
-
getOperations
public Collection<IOperation> getOperations()
Description copied from interface:ISubmodelAPI
Helper function for quick access of operations- Specified by:
getOperations
in interfaceISubmodelAPI
- Returns:
- all operations contained by the submodel
-
getSubmodelElements
public Collection<ISubmodelElement> getSubmodelElements()
Description copied from interface:ISubmodelAPI
Helper function for quick access of submodelElements- Specified by:
getSubmodelElements
in interfaceISubmodelAPI
- Returns:
- all submodelElements contained by the submodel
-
updateSubmodelElement
public void updateSubmodelElement(String idShortPath, Object newValue)
Description copied from interface:ISubmodelAPI
Updates the value of a submodelElement- Specified by:
updateSubmodelElement
in interfaceISubmodelAPI
- Parameters:
idShortPath
- the idShort path to the submodelElementnewValue
- new value of the submodelElement
-
uploadSubmodelElementFile
public void uploadSubmodelElementFile(String idShortPath, InputStream fileStream)
- Specified by:
uploadSubmodelElementFile
in interfaceISubmodelAPI
-
getSubmodelElementValue
public Object getSubmodelElementValue(String idShortPath)
Description copied from interface:ISubmodelAPI
Retrieves the value of a submodelElement- Specified by:
getSubmodelElementValue
in interfaceISubmodelAPI
- Parameters:
idShortPath
- the idShort path to the submodelElement- Returns:
- submodelElement value
-
getSubmodelElement
public ISubmodelElement getSubmodelElement(String idShortPath)
Description copied from interface:ISubmodelAPI
Retrieves a submodelElement- Specified by:
getSubmodelElement
in interfaceISubmodelAPI
- Parameters:
idShortPath
- the idShort Path to the submodelElement- Returns:
- the submodelElement
-
invokeOperation
public Object invokeOperation(String idShortPath, Object... params)
Description copied from interface:ISubmodelAPI
Invokes an operation- Specified by:
invokeOperation
in interfaceISubmodelAPI
- Parameters:
idShortPath
- the idShort path to the operationparams
- to be passed to the operation- Returns:
- the result of the operation
-
invokeAsync
public Object invokeAsync(String idShortPath, Object... params)
Description copied from interface:ISubmodelAPI
Invoke an operation asynchronously- Specified by:
invokeAsync
in interfaceISubmodelAPI
- Parameters:
idShortPath
- the idShort path to the operationparams
- to be passed to the operation- Returns:
- the requestId of the invocation
-
getOperationResult
public Object getOperationResult(String idShortPath, String requestId)
Description copied from interface:ISubmodelAPI
Gets the result of an asynchronously invoked operation- Specified by:
getOperationResult
in interfaceISubmodelAPI
- Parameters:
idShortPath
- of the operationrequestId
- the requestId of the invocation- Returns:
- the result of the Operation or a Message that it is not finished yet
-
getSubmodelElementFile
public File getSubmodelElementFile(String idShortPath)
- Specified by:
getSubmodelElementFile
in interfaceISubmodelAPI
-
-