Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "BaSyx / Scenarios / Cloud Edge Deployment"

(Created page with "This example shows the setup and usage of a distributed deployment. It contains two servers as shown in the illustration. The following components are used: * BaSyx_/_Doc...")
 
Line 70: Line 70:
  
  
An example of how to execute and use the scenario can be found in [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/scenarios/cloudedgedeployment TestCloudEdgeDeploymentScenario]. This class demonstrates the access of the AAS in the methode <code>testAAS()</code>, of the DocumentationSubmodel in <code>testDocuSM()</code> and the EdgeSubmodel in <code>testEdgeSM()</code>.
+
An example of how to execute and use the scenario can be found in [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/scenarios/cloudedgedeployment/ TestCloudEdgeDeploymentScenario]. This class demonstrates the access of the AAS in the methode <code>testAAS()</code>, of the DocumentationSubmodel in <code>testDocuSM()</code> and the EdgeSubmodel in <code>testEdgeSM()</code>.

Revision as of 06:25, 23 September 2020

This example shows the setup and usage of a distributed deployment. It contains two servers as shown in the illustration.

The following components are used:



CloudEdgeDeploymentScenario.png


Server one is hosted directly on a smart device and provides values measured directly on the device (e.g. a current temperature). It is called "EdgeServer" in the scenario.

The second server is a cloud server, which hosts the Asset Administration Shell and another submodel containing static property values of the device (e.g. a maximum temperature). It is called "CloudServer".


The EdgeServer and the CloudServer are tomcat servers, which are started in the methodes startupEdgeServer() and startupCloudServer() called by the constructor of the CloudEdgeDeploymentScenario class.

After the startup of both servers the constructor generates a new ConnectedAssetAdministrationShellManager using the InMemory Component. This Manager then is used to push the AAS and its documentation SM to the cloud server.


// Create an AASRegistryProxy to be used by the manager
 
registry = new AASRegistryProxy(registryPath);
 
 
// Create a ConnectedAASManager with the registry created above
 
aasManager = new ConnectedAssetAdministrationShellManager(registry);
 
 
// Push the AAS to the cloud server
// The manager automatically registers it in the registry
 
aasManager.createAAS(ComponentBuilder.getAAS(), aasIdentifier, "http://localhost:8081/cloud");
 
 
// Get the docuSubmodel from the ComponentBuilder
 
SubModel docuSubmodel = ComponentBuilder.getDocuSM();
 
 
// Push the docuSubmodel to the cloud
// The manager automatically registers it in the registry
 
aasManager.createSubModel(aasIdentifier, docuSubmodel);


As a last step the constructor registers the EdgeSubmodel directly in the descriptor of the AAS. This EdgeSubmodel is automatically provided by the EdgeServer and does not need to be pushed there.


// Add the already existing edgeSM to the descriptor of the aas
 
registry.register(aasIdentifier, ComponentBuilder.getEdgeSubmodelDescriptor());


An example of how to execute and use the scenario can be found in TestCloudEdgeDeploymentScenario. This class demonstrates the access of the AAS in the methode testAAS(), of the DocumentationSubmodel in testDocuSM() and the EdgeSubmodel in testEdgeSM().

Back to the top