Removes obsolete files
diff --git a/examples/basys.examples/examples/examples/contexts/BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory.java b/examples/basys.examples/examples/examples/contexts/BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory.java
deleted file mode 100644
index b547ac1..0000000
--- a/examples/basys.examples/examples/examples/contexts/BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package examples.contexts;
-
-import org.eclipse.basyx.components.servlets.RawCFGSubModelProviderServlet;
-import org.eclipse.basyx.components.servlets.SQLDirectoryServlet;
-import org.eclipse.basyx.regression.support.server.BaSyxContext;
-
-
-/**
- * BaSyx context that contains an Industrie 4.0 Servlet infrastructure
- * - One in-memory only AAS Server that receives and hosts asset administration shells and sub models
- * - One SQL directory that manages AAS and sub model registrations
- *
- * @author kuhn
- *
- */
-public class BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory extends BaSyxContext {
-
-
- /**
- * Version of serialized instance
- */
- private static final long serialVersionUID = 1L;
-
-
-
- /**
- * Constructor
- */
- public BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory() {
- // Invoke base constructor to set up Tomcat server in basys.components context
- super("/basys.examples", "");
-
- // Define Servlet infrastucture
- addServletMapping("/Components/Directory/SQL/*", new SQLDirectoryServlet().withParameter("config", "/WebContent/WEB-INF/config/directory/sqldirectory/directory.properties"));
- addServletMapping("/Components/BaSys/1.0/aasServer/*", new RawCFGSubModelProviderServlet().withParameter("config", "/WebContent/WEB-INF/config/aasServer/aasServer.properties"));
- }
-}
-
diff --git a/examples/basys.examples/examples/examples/controllingdevice/submodel/object/DeviceStatusSubmodel.java b/examples/basys.examples/examples/examples/controllingdevice/submodel/object/DeviceStatusSubmodel.java
deleted file mode 100644
index b883b41..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/submodel/object/DeviceStatusSubmodel.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package examples.controllingdevice.submodel.object;
-
-import java.util.Map;
-import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
-import org.eclipse.basyx.aas.metamodel.factory.MetaModelElementFactory;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.SubModel;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.submodelelement.property.Property;
-
-
-
-/**
- * Implement a sub model that describes a device status
- *
- * @author kuhn
- *
- */
-public class DeviceStatusSubmodel extends SubModel {
-
-
- /**
- * Version of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
-
- /**
- * Constructor
- */
- @SuppressWarnings("unchecked")
- public DeviceStatusSubmodel() {
-
- // Meta model element factory
- MetaModelElementFactory factory = new MetaModelElementFactory();
-
- // Initialize this sub model
- ((Map<String, Object>) this.get("identification")).put("id", "urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#002");
- ((Map<String, Object>) this.get("identification")).put("idType", IdentifierType.URI);
-
-
- // This sub model only defines two property named "device status" and "mode"
- Property deviceStatusProperty = factory.create(new Property(), "offline");
- deviceStatusProperty.setId("deviceStatus");
- Property deviceModeProperty = factory.create(new Property(), "idle");
- deviceModeProperty.setId("mode");
-
- // Add properties to sub model properties
- ((Map<String, Object>) get("properties")).put("deviceStatus", deviceStatusProperty);
- ((Map<String, Object>) get("properties")).put("mode", deviceModeProperty);
- }
-
-
- /**
- * Constructor
- */
- public DeviceStatusSubmodel(IAssetAdministrationShell aas) {
- // Invoke default constructor
- this();
-
- // Add sub model to AAS
- aas.addSubModel(this);
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/submodel/object/DeviceTCPServer.java b/examples/basys.examples/examples/examples/controllingdevice/submodel/object/DeviceTCPServer.java
deleted file mode 100644
index abc85f4..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/submodel/object/DeviceTCPServer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package examples.controllingdevice.submodel.object;
-
-import org.eclipse.basyx.vab.backend.server.basyx.BaSyxTCPServer;
-import org.eclipse.basyx.vab.provider.hashmap.VABHashmapProvider;
-
-
-
-/**
- * BaSyx TCP server that communicates using the native BaSyx protocol
- *
- * @author kuhn
- *
- */
-public class DeviceTCPServer {
-
-
- /**
- * Create IModelProvider that provides a VAB element
- */
- protected VABHashmapProvider modelProvider = new VABHashmapProvider(new DeviceStatusSubmodel());
-
-
- /**
- * Create native BaSyx TCP server using default port
- */
- protected BaSyxTCPServer<VABHashmapProvider> tcpServer = new BaSyxTCPServer<VABHashmapProvider>(modelProvider, 6998);
-
-
-
-
- /**
- * Start TCP server
- */
- public void startTCPServer() {
- // Start TCP server
- tcpServer.start();
- }
-
-
- /**
- * Stop TCP server
- */
- public void stopTCPServer() {
- // Shutdown TCP server
- tcpServer.shutdown();
- }
-
-
-
- /**
- * Main method
- */
- public static void main(String[] args) {
- // Create device TCP server
- DeviceTCPServer deviceServer = new DeviceTCPServer();
-
- // Start device TCP server
- deviceServer.startTCPServer();
-
- // Wait until TCP server completes (which will never happen) or do something else meaningful
- try {deviceServer.tcpServer.join();} catch (InterruptedException e) {e.printStackTrace();}
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/submodel/object/ExampleDirectory.java b/examples/basys.examples/examples/examples/controllingdevice/submodel/object/ExampleDirectory.java
deleted file mode 100644
index 1be6180..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/submodel/object/ExampleDirectory.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package examples.controllingdevice.submodel.object;
-
-import org.eclipse.basyx.aas.impl.services.PreconfiguredDirectory;
-
-
-
-
-/**
- * Implement a directory for the example setting
- *
- * @author kuhn
- *
- */
-public class ExampleDirectory extends PreconfiguredDirectory {
-
-
- /**
- * Constructor - load all directory entries
- */
- public ExampleDirectory() {
- // VAB Element mapping
- addMapping("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#002", "basyx://localhost:6998");
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/submodel/object/RunExample.java b/examples/basys.examples/examples/examples/controllingdevice/submodel/object/RunExample.java
deleted file mode 100644
index 11d98b0..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/submodel/object/RunExample.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package examples.controllingdevice.submodel.object;
-
-import static org.junit.Assert.assertTrue;
-
-import org.eclipse.basyx.aas.backend.connector.basyx.BaSyxConnectorProvider;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-
-
-/**
- * Run example for controlling device (SubModel/BaSyx TCP)
- *
- * @author kuhn
- *
- */
-public class RunExample {
-
-
- /**
- * VAB connection manager backend
- */
- protected VABConnectionManager connManager = new VABConnectionManager(new ExampleDirectory(), new BaSyxConnectorProvider());
-
-
- /**
- * Device TCP server for this example
- */
- protected DeviceTCPServer deviceTCPServer = null;
-
-
- /**
- * Creates the manager to be used in the test cases
- */
- @Before
- public void before() {
- // Create and start device TCP server
- deviceTCPServer = new DeviceTCPServer();
- // - Start server
- deviceTCPServer.startTCPServer();
- }
-
-
- /**
- * Creates the manager to be used in the test cases
- */
- @After
- public void after() {
- // Stop TCP server
- deviceTCPServer.stopTCPServer();
- }
-
-
- /**
- * Test basic queries
- */
- @Test
- public void test() throws Exception {
-
- // Server connections
- // - Connect to AAS server
- VABElementProxy connSubModel = this.connManager.connectToVABElement("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#002");
-
- // Device updates status to ready
- Object devState = connSubModel.readElementValue("properties/deviceStatus/value");
-
- // Compare and output device status
- // - Automated result check
- assertTrue(devState.equals("offline"));
- // - Output result to console
- System.out.println("Status:"+devState);
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/ControllingDeviceVABObjectContext.java b/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/ControllingDeviceVABObjectContext.java
deleted file mode 100644
index aec7b2b..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/ControllingDeviceVABObjectContext.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package examples.controllingdevice.vab.dynamic;
-
-import org.eclipse.basyx.components.servlets.RawCFGSubModelProviderServlet;
-import org.eclipse.basyx.components.servlets.SQLDirectoryServlet;
-
-import examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
-
-/*
-<servlet>
-<servlet-name>DeviceStatusVABObject</servlet-name>
-<servlet-class> examples.controllingdevice.vab.object.SimpleVABElementServlet </servlet-class>
-
-<load-on-startup>5</load-on-startup>
-</servlet>
-<servlet-mapping>
-<servlet-name>DeviceStatusVABObject</servlet-name>
-<url-pattern>/Testsuite/components/BaSys/1.0/devicestatusVAB/*</url-pattern>
-</servlet-mapping>
-
-
-<servlet>
-<servlet-name>DeviceStatusSubmodel</servlet-name>
-<servlet-class> examples.controllingdevice.vab.object.SimpleSubmodelServlet </servlet-class>
-
-<load-on-startup>5</load-on-startup>
-</servlet>
-<servlet-mapping>
-<servlet-name>DeviceStatusSubmodel</servlet-name>
-<url-pattern>/Testsuite/components/BaSys/1.0/devicestatusSM/*</url-pattern>
-</servlet-mapping>
-
- */
-
-/**
- * Tailored context for examples.controllingdevice.vab.object test cases
- *
- * @author kuhn
- *
- */
-public class ControllingDeviceVABObjectContext extends BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory {
-
-
- /**
- * Version of serialized instance
- */
- private static final long serialVersionUID = 1L;
-
-
-
- /**
- * Constructor
- */
- public ControllingDeviceVABObjectContext() {
- // Invoke base constructor to set up Tomcat server
- super();
-
- // Define test case specific Servlet infrastucture
- addServletMapping("/Testsuite/components/BaSys/1.0/devicestatusVAB/*", new SimpleVABElementServlet());
- addServletMapping("/Testsuite/components/BaSys/1.0/devicestatusSM/*", new SimpleSubmodelServlet());
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/DeviceStatusVABObject.java b/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/DeviceStatusVABObject.java
deleted file mode 100644
index 5bb423d..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/DeviceStatusVABObject.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package examples.controllingdevice.vab.dynamic;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-
-/**
- * A device status VAB object that does not conform to the sub model meta model.
- *
- * @author kuhn
- *
- */
-public class DeviceStatusVABObject extends HashMap<String, Object> {
-
-
- /**
- * Version of serialized instances
- */
- private static final long serialVersionUID = -1339664424451243526L;
-
-
- /**
- * Constructor
- */
- public DeviceStatusVABObject() {
-
- // Create contained property map
- Map<String, Object> propertyMap = new HashMap<>();
- // - Create device status and mode property
- propertyMap.put("deviceStatus", new String("offline"));
- propertyMap.put("mode", new String("idle"));
-
- // Put properties into 'elements' map of this provider
- put("properties", propertyMap);
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/ExampleDirectory.java b/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/ExampleDirectory.java
deleted file mode 100644
index 6bc70c5..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/ExampleDirectory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package examples.controllingdevice.vab.dynamic;
-
-import org.eclipse.basyx.aas.impl.services.PreconfiguredDirectory;
-
-
-
-
-/**
- * Implement a pre-configured directory service. This is most helpful for static topologies or test setups.
- *
- * @author kuhn
- *
- */
-public class ExampleDirectory extends PreconfiguredDirectory {
-
-
- /**
- * Constructor - load all directory entries
- */
- public ExampleDirectory() {
- // Define mappings
- // - Device sub model (VAB)
- addMapping("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#003", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/devicestatusVAB/");
- // - Device sub model (SM)
- addMapping("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#004", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/devicestatusSM/");
- }
-}
-
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/RunExample.java b/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/RunExample.java
deleted file mode 100644
index c6bcf3b..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/RunExample.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package examples.controllingdevice.vab.dynamic;
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.function.Supplier;
-
-import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.regression.support.server.AASHTTPServerResource;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-import org.eclipse.basyx.vab.provider.lambda.VABLambdaProviderHelper;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-import examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
-
-
-
-/**
- * Run example for controlling device (SubModel/BaSyx TCP)
- *
- * @author kuhn
- *
- */
-public class RunExample {
-
-
- /**
- * VAB connection manager backend
- */
- protected VABConnectionManager connManager = new VABConnectionManager(new ExampleDirectory(), new HTTPConnectorProvider());
-
-
- /**
- * Makes sure Tomcat Server with basic BaSys topology is started
- */
- @ClassRule
- public static AASHTTPServerResource res = AASHTTPServerResource.getTestResource(new ControllingDeviceVABObjectContext());
-
-
-
-
- /**
- * Test basic queries
- */
- @Test
- public void test() throws Exception {
-
- // Server connections
- // - Connect to device (VAB object)
- VABElementProxy connSubModel1 = this.connManager.connectToVABElement("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#003");
-
-/* // Read status from device
- Object devState1 = connSubModel1.readElementValue("properties/deviceStatus");
- // - Output device status
- System.out.println("Status1:"+devState1);
-*/
-
-/* // Read mode from device
- Object devMode1a = connSubModel1.readElementValue("properties/mode");
- // - Output device mode
- System.out.println("Mode1a:"+devMode1a);
- // - Update device mode
- connSubModel1.updateElementValue("properties/mode", "start");
- // Read mode from device again
- Object devMode1b = connSubModel1.readElementValue("properties/mode");
- // - Output device mode again
- System.out.println("Mode1b:"+devMode1b);
-*/
-
- // Create accessors for simple value property property1.1
- Map<String, Object> dynamicPropertyVal = VABLambdaProviderHelper.createSimple((Supplier<Object> & Serializable) () -> {
- System.out.println("ABC:");
- return "xyz";
- }, null);
- // - Update device mode
- connSubModel1.updateElementValue("properties/mode", dynamicPropertyVal);
-
- // Read mode from device again
- Object devMode1c = connSubModel1.readElementValue("properties/mode");
- // - Output device mode again
- System.out.println("Mode1c:"+devMode1c);
-
-/*
-
-
-
- // Server connections
- // - Connect to device (sub model)
- VABElementProxy connSubModel2 = this.connManager.connectToVABElement("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#004");
-
- // Read status from device
- Object devState2 = connSubModel2.readElementValue("properties/deviceStatus/value");
- // - Output device status
- System.out.println("Status2:"+devState2);
-
- // Read mode from device
- Object devMode2a = connSubModel2.readElementValue("properties/mode/value");
- // - Output device mode
- System.out.println("Mode2a:"+devMode2a);
- // - Update device mode
- connSubModel2.updateElementValue("properties/mode/value", "start");
- // Read mode from device again
- Object devMode2b = connSubModel2.readElementValue("properties/mode/value");
- // - Output device mode again
- System.out.println("Mode2b:"+devMode2b);
-*/
- }
-}
-
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/SimpleSubmodelServlet.java b/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/SimpleSubmodelServlet.java
deleted file mode 100644
index 4a9689a..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/SimpleSubmodelServlet.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package examples.controllingdevice.vab.dynamic;
-
-import org.eclipse.basyx.vab.backend.server.http.VABHTTPInterface;
-import org.eclipse.basyx.vab.provider.hashmap.VABHashmapProvider;
-import org.eclipse.basyx.vab.provider.lambda.VABLambdaProvider;
-
-import examples.controllingdevice.submodel.object.DeviceStatusSubmodel;
-
-
-
-/**
- * Servlet interface for VAB elements, e.g. AAS, sub model, or other VAB objects
- *
- * @author kuhn
- *
- */
-public class SimpleSubmodelServlet extends VABHTTPInterface<VABHashmapProvider> {
-
-
- /**
- * Version information to identify the version of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Constructor
- */
- public SimpleSubmodelServlet() {
- // Invoke base constructor, instantiate device status sub model
- super(new VABLambdaProvider(new DeviceStatusSubmodel()));
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/SimpleVABElementServlet.java b/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/SimpleVABElementServlet.java
deleted file mode 100644
index 17b542e..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/dynamic/SimpleVABElementServlet.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package examples.controllingdevice.vab.dynamic;
-
-import org.eclipse.basyx.vab.backend.server.http.VABHTTPInterface;
-import org.eclipse.basyx.vab.provider.hashmap.VABHashmapProvider;
-import org.eclipse.basyx.vab.provider.lambda.VABLambdaProvider;
-
-
-
-/**
- * Servlet interface for VAB elements, e.g. AAS, sub model, or other VAB objects
- *
- * @author kuhn
- *
- */
-public class SimpleVABElementServlet extends VABHTTPInterface<VABHashmapProvider> {
-
-
- /**
- * Version information to identify the version of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Constructor
- */
- public SimpleVABElementServlet() {
- // Invoke base constructor, instantiate a device status VAB object
- super(new VABLambdaProvider(new DeviceStatusVABObject()));
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/object/ControllingDeviceVABObjectContext.java b/examples/basys.examples/examples/examples/controllingdevice/vab/object/ControllingDeviceVABObjectContext.java
deleted file mode 100644
index 0b24a4c..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/object/ControllingDeviceVABObjectContext.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package examples.controllingdevice.vab.object;
-
-import org.eclipse.basyx.components.servlets.RawCFGSubModelProviderServlet;
-import org.eclipse.basyx.components.servlets.SQLDirectoryServlet;
-
-import examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
-
-/*
-<servlet>
-<servlet-name>DeviceStatusVABObject</servlet-name>
-<servlet-class> examples.controllingdevice.vab.object.SimpleVABElementServlet </servlet-class>
-
-<load-on-startup>5</load-on-startup>
-</servlet>
-<servlet-mapping>
-<servlet-name>DeviceStatusVABObject</servlet-name>
-<url-pattern>/Testsuite/components/BaSys/1.0/devicestatusVAB/*</url-pattern>
-</servlet-mapping>
-
-
-<servlet>
-<servlet-name>DeviceStatusSubmodel</servlet-name>
-<servlet-class> examples.controllingdevice.vab.object.SimpleSubmodelServlet </servlet-class>
-
-<load-on-startup>5</load-on-startup>
-</servlet>
-<servlet-mapping>
-<servlet-name>DeviceStatusSubmodel</servlet-name>
-<url-pattern>/Testsuite/components/BaSys/1.0/devicestatusSM/*</url-pattern>
-</servlet-mapping>
-
- */
-
-/**
- * Tailored context for examples.controllingdevice.vab.object test cases
- *
- * @author kuhn
- *
- */
-public class ControllingDeviceVABObjectContext extends BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory {
-
-
- /**
- * Version of serialized instance
- */
- private static final long serialVersionUID = 1L;
-
-
-
- /**
- * Constructor
- */
- public ControllingDeviceVABObjectContext() {
- // Invoke base constructor to set up Tomcat server
- super();
-
- // Define test case specific Servlet infrastucture
- addServletMapping("/Testsuite/components/BaSys/1.0/devicestatusVAB/*", new SimpleVABElementServlet());
- addServletMapping("/Testsuite/components/BaSys/1.0/devicestatusSM/*", new SimpleSubmodelServlet());
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/object/DeviceStatusVABObject.java b/examples/basys.examples/examples/examples/controllingdevice/vab/object/DeviceStatusVABObject.java
deleted file mode 100644
index 40b6f82..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/object/DeviceStatusVABObject.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package examples.controllingdevice.vab.object;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-
-/**
- * A device status VAB object that does not conform to the sub model meta model.
- *
- * @author kuhn
- *
- */
-public class DeviceStatusVABObject extends HashMap<String, Object> {
-
-
- /**
- * Version of serialized instances
- */
- private static final long serialVersionUID = -1339664424451243526L;
-
-
- /**
- * Constructor
- */
- public DeviceStatusVABObject() {
-
- // Create contained property map
- Map<String, Object> propertyMap = new HashMap<>();
- // - Create device status and mode property
- propertyMap.put("deviceStatus", new String("offline"));
- propertyMap.put("mode", new String("idle"));
-
- // Put properties into 'elements' map of this provider
- put("properties", propertyMap);
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/object/ExampleDirectory.java b/examples/basys.examples/examples/examples/controllingdevice/vab/object/ExampleDirectory.java
deleted file mode 100644
index 31363a9..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/object/ExampleDirectory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package examples.controllingdevice.vab.object;
-
-import org.eclipse.basyx.aas.impl.services.PreconfiguredDirectory;
-
-
-
-
-/**
- * Implement a pre-configured directory service. This is most helpful for static topologies or test setups.
- *
- * @author kuhn
- *
- */
-public class ExampleDirectory extends PreconfiguredDirectory {
-
-
- /**
- * Constructor - load all directory entries
- */
- public ExampleDirectory() {
- // Define mappings
- // - Device sub model (VAB)
- addMapping("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#003", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/devicestatusVAB/");
- // - Device sub model (SM)
- addMapping("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#004", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/devicestatusSM/");
- }
-}
-
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/object/RunExample.java b/examples/basys.examples/examples/examples/controllingdevice/vab/object/RunExample.java
deleted file mode 100644
index f446a04..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/object/RunExample.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package examples.controllingdevice.vab.object;
-
-import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.regression.support.server.AASHTTPServerResource;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-import examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
-
-
-
-/**
- * Run example for controlling device (SubModel/BaSyx TCP)
- *
- * @author kuhn
- *
- */
-public class RunExample {
-
-
- /**
- * VAB connection manager backend
- */
- protected VABConnectionManager connManager = new VABConnectionManager(new ExampleDirectory(), new HTTPConnectorProvider());
-
-
- /**
- * Makes sure Tomcat Server with basic BaSys topology is started
- */
- @ClassRule
- public static AASHTTPServerResource res = AASHTTPServerResource.getTestResource(new ControllingDeviceVABObjectContext());
-
-
-
-
- /**
- * Test basic queries
- */
- @Test
- public void test() throws Exception {
-
- // Server connections
- // - Connect to device (VAB object)
- VABElementProxy connSubModel1 = this.connManager.connectToVABElement("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#003");
-
- // Read status from device
- Object devState1 = connSubModel1.readElementValue("properties/deviceStatus");
- // - Output device status
- System.out.println("Status1:"+devState1);
-
- // Read mode from device
- Object devMode1a = connSubModel1.readElementValue("properties/mode");
- // - Output device mode
- System.out.println("Mode1a:"+devMode1a);
- // - Update device mode
- connSubModel1.updateElementValue("properties/mode", "start");
- // Read mode from device again
- Object devMode1b = connSubModel1.readElementValue("properties/mode");
- // - Output device mode again
- System.out.println("Mode1b:"+devMode1b);
-
-
-
- // Server connections
- // - Connect to device (sub model)
- VABElementProxy connSubModel2 = this.connManager.connectToVABElement("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#004");
-
- // Read status from device
- Object devState2 = connSubModel2.readElementValue("properties/deviceStatus/value");
- // - Output device status
- System.out.println("Status2:"+devState2);
-
- // Read mode from device
- Object devMode2a = connSubModel2.readElementValue("properties/mode/value");
- // - Output device mode
- System.out.println("Mode2a:"+devMode2a);
- // - Update device mode
- connSubModel2.updateElementValue("properties/mode/value", "start");
- // Read mode from device again
- Object devMode2b = connSubModel2.readElementValue("properties/mode/value");
- // - Output device mode again
- System.out.println("Mode2b:"+devMode2b);
- }
-}
-
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/object/SimpleSubmodelServlet.java b/examples/basys.examples/examples/examples/controllingdevice/vab/object/SimpleSubmodelServlet.java
deleted file mode 100644
index 02d1889..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/object/SimpleSubmodelServlet.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package examples.controllingdevice.vab.object;
-
-import org.eclipse.basyx.vab.backend.server.http.VABHTTPInterface;
-import org.eclipse.basyx.vab.provider.hashmap.VABHashmapProvider;
-
-import examples.controllingdevice.submodel.object.DeviceStatusSubmodel;
-
-
-
-/**
- * Servlet interface for VAB elements, e.g. AAS, sub model, or other VAB objects
- *
- * @author kuhn
- *
- */
-public class SimpleSubmodelServlet extends VABHTTPInterface<VABHashmapProvider> {
-
-
- /**
- * Version information to identify the version of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Constructor
- */
- public SimpleSubmodelServlet() {
- // Invoke base constructor, instantiate device status sub model
- super(new VABHashmapProvider(new DeviceStatusSubmodel()));
- }
-}
diff --git a/examples/basys.examples/examples/examples/controllingdevice/vab/object/SimpleVABElementServlet.java b/examples/basys.examples/examples/examples/controllingdevice/vab/object/SimpleVABElementServlet.java
deleted file mode 100644
index 4b49c86..0000000
--- a/examples/basys.examples/examples/examples/controllingdevice/vab/object/SimpleVABElementServlet.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package examples.controllingdevice.vab.object;
-
-import org.eclipse.basyx.vab.backend.server.http.VABHTTPInterface;
-import org.eclipse.basyx.vab.provider.hashmap.VABHashmapProvider;
-
-
-
-/**
- * Servlet interface for VAB elements, e.g. AAS, sub model, or other VAB objects
- *
- * @author kuhn
- *
- */
-public class SimpleVABElementServlet extends VABHTTPInterface<VABHashmapProvider> {
-
-
- /**
- * Version information to identify the version of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Constructor
- */
- public SimpleVABElementServlet() {
- // Invoke base constructor, instantiate a device status VAB object
- super(new VABHashmapProvider(new DeviceStatusVABObject()));
- }
-}
diff --git a/examples/basys.examples/examples/examples/deviceaas/RunExample.java b/examples/basys.examples/examples/examples/deviceaas/RunExample.java
deleted file mode 100644
index 660d653..0000000
--- a/examples/basys.examples/examples/examples/deviceaas/RunExample.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package examples.deviceaas;
-
-import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-import basys.examples.deployment.BaSyxDeployment;
-import basys.examples.example.BaSyxExample;
-import examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
-import examples.deviceaas.devices.devicemanager.DeviceMockup;
-import examples.deviceaas.devices.devicemanager.ManufacturingDeviceManager;
-import examples.deviceaas.devices.devicemanager.ReceiveDeviceStatusApplication;
-import examples.directory.ExamplesDirectory;
-
-
-
-/**
- * Run example for device AAS
- *
- * @author kuhn
- *
- */
-public class RunExample extends BaSyxExample {
-
-
- /**
- * VAB connection manager backend
- */
- protected VABConnectionManager connManager = new VABConnectionManager(new ExamplesDirectory(), new HTTPConnectorProvider());
-
-
- /**
- * Instantiate and start context elements for this example. BaSyxDeployment contexts instantiate all
- * components on the IP address of the host. Therefore, all components use the same IP address.
- */
- @ClassRule
- public static BaSyxDeployment context = new BaSyxDeployment(
- // Simulated servlets
- // - BaSys topology with one AAS Server and one SQL directory
- new BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory(),
-
- // Simulated runnables
- // - Manufacturing device manager, e.g. deployed to additonal device
- new ManufacturingDeviceManager().setName("DeviceManager"),
-
- // Simulated mockups
- new DeviceMockup(9998).setName("Device"),
- new ReceiveDeviceStatusApplication().setName("Application")
- );
-
-
-
- /**
- * Test sequence:
- * - Device status update
- * - Read device status from AAS
- */
- @Test
- public void test() throws Exception {
-
- // Device updates status to ready
- ((DeviceMockup) context.getRunnable("Device")).statusChange("ready");
-
- // Application waits for status change
- waitfor( () -> ((ReceiveDeviceStatusApplication) context.getRunnable("Application")).getDeviceStatus().equals("ready") );
- }
-}
diff --git a/examples/basys.examples/examples/examples/deviceaas/RunExampleSimpleAPIManualRegistry.java b/examples/basys.examples/examples/examples/deviceaas/RunExampleSimpleAPIManualRegistry.java
deleted file mode 100644
index 8400fc7..0000000
--- a/examples/basys.examples/examples/examples/deviceaas/RunExampleSimpleAPIManualRegistry.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package examples.deviceaas;
-
-import java.util.Map;
-
-import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.AssetAdministrationShell;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.SubModel;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
-import org.eclipse.basyx.regression.support.server.AASHTTPServerResource;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-import basys.examples.aasdescriptor.AASDescriptor;
-import basys.examples.aasdescriptor.ModelUrn;
-import basys.examples.aasdescriptor.SubmodelDescriptor;
-import basys.examples.frontend.client.connmanager.BaSysConnectionManager;
-import basys.examples.frontend.client.connmanager.ModelServerProxy;
-import basys.examples.frontend.client.proxies.AASRegistryProxy;
-import examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
-import examples.directory.ExamplesDirectory;
-
-
-
-/**
- * Run example for device AAS
- *
- * @author kuhn
- *
- */
-public class RunExampleSimpleAPIManualRegistry {
-
-
- /**
- * BaSys connection manager backend
- */
- protected BaSysConnectionManager connManager = new BaSysConnectionManager(new ExamplesDirectory(), new HTTPConnectorProvider());
-
-
- /**
- * Makes sure Tomcat Server with basic BaSys topology is started
- */
- @ClassRule
- public static AASHTTPServerResource res = AASHTTPServerResource.getTestResource(new BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory());
-
-
-
- /**
- * Test basic queries
- */
- @Test @SuppressWarnings("unchecked")
- public void test() throws Exception {
-
- // Server connections
- // - Connect to AAS server
- ModelServerProxy modelServer = this.connManager.connectToModelServer("AASServer");
-
-
- // Instantiate AAS registry proxy that connects to registry
- AASRegistryProxy registry = new AASRegistryProxy("http://localhost:8080/basys.examples/Components/Directory/SQL");
-
-
- // Create device AAS
- // - Product ID (urn:<legalEntity>:<subUnit>:<subModel>:<version>:<revision>:<elementID>#<elementInstance>)
- ModelUrn deviceAASID = new ModelUrn("de.FHG", "devices.es.iese", "aas", "1.0", "3", "x-509", "001");
- // - Create device AAS
- AssetAdministrationShell aas = new AssetAdministrationShell()
- .putPath("idShort", "DeviceIDShort");
- // - Push AAS to model repository
- modelServer.pushToServer(deviceAASID, aas);
-
-
- // The device also brings a sub model structure with an own ID that is being pushed on the server
- ModelUrn deviceStatusSMID = new ModelUrn("de.FHG", "devices.es.iese", "statusSM", "1.0", "3", "x-509", "001");
- // - Create generic sub model
- SubModel statusSM = new SubModel()
- .putPath("properties/status", "offline");
- // - Push static sub model to model repository
- modelServer.pushToServer(deviceStatusSMID, statusSM);
-
-
- // Delete AAS registration for a fresh start - ignore if URL was not found. In this case, there was no previous registration and the registry was clean
- registry.delete(deviceAASID);
-
-
- // Register AAS and sub models in directory (push AAS descriptor to server)
- // - Create an AAS descriptor
- AASDescriptor deviceAASDescriptor = new AASDescriptor(deviceAASID.getURN(), IdentifierType.URI, modelServer.getURLToModel(deviceAASID));
- // - Add a sub model descriptor for device
- SubmodelDescriptor deviceStatusSubmodelDescriptor = new SubmodelDescriptor(deviceStatusSMID.getURN(), IdentifierType.URI, modelServer.getURLToModel(deviceStatusSMID));
- deviceAASDescriptor.addSubmodelDescriptor(deviceStatusSubmodelDescriptor);
- // - Push AAS descriptor to server
- registry.register(deviceAASDescriptor);
-
-
- // Device updates status to ready
- //connSubModel.updateElementValue(statusSubmodelURLOnServer+"/properties/status", "ready");
- modelServer.updateElementValue(deviceStatusSMID, "/properties/status", "ready");
- // - Read updated status back
- modelServer.readElementValue(deviceStatusSMID, "/properties/status");
-
-
- // Lookup device AAS
- AASDescriptor aasDescriptor = registry.lookup(deviceAASID);
- // - Get information about status sub model
- SubmodelDescriptor smDescriptor = aasDescriptor.getSubModelDescriptor(deviceStatusSMID.getURN());
-
-
- // Connect to status sub model end point
- VABElementProxy connSubModel = connManager.connectToVABElementByURL(smDescriptor.getFirstEndpoint());
- Map<String, Object> deviceSM = (Map<String, Object>) connSubModel.readElementValue("/");
- // - Output status information
- System.out.println("ReadBack:"+((Map<String, Object>) deviceSM.get("properties")).get("status"));
- }
-}
diff --git a/examples/basys.examples/examples/examples/deviceaas/RunExampleSimpleAPIManualRegistryURL.java b/examples/basys.examples/examples/examples/deviceaas/RunExampleSimpleAPIManualRegistryURL.java
deleted file mode 100644
index 428aff1..0000000
--- a/examples/basys.examples/examples/examples/deviceaas/RunExampleSimpleAPIManualRegistryURL.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package examples.deviceaas;
-
-import java.util.Map;
-
-import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.aas.metamodel.hashmap.VABModelMap;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.AssetAdministrationShell;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.SubModel;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
-import org.eclipse.basyx.regression.support.server.AASHTTPServerResource;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-import basys.examples.aasdescriptor.AASDescriptor;
-import basys.examples.aasdescriptor.ModelUrn;
-import basys.examples.aasdescriptor.SubmodelDescriptor;
-import basys.examples.frontend.client.connmanager.BaSysConnectionManager;
-import basys.examples.frontend.client.connmanager.ModelServerProxy;
-import basys.examples.frontend.client.proxies.AASRegistryProxy;
-import examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
-import examples.directory.ExamplesDirectory;
-
-
-
-/**
- * Run example for device AAS
- *
- * @author kuhn
- *
- */
-public class RunExampleSimpleAPIManualRegistryURL {
-
-
- /**
- * BaSys connection manager backend
- */
- protected BaSysConnectionManager connManager = new BaSysConnectionManager(new ExamplesDirectory(), new HTTPConnectorProvider());
-
-
- /**
- * Makes sure Tomcat Server with basic BaSys topology is started
- */
- @ClassRule
- public static AASHTTPServerResource res = AASHTTPServerResource.getTestResource(new BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory());
-
-
-
- /**
- * Test basic queries
- */
- @Test @SuppressWarnings("unchecked")
- public void test() throws Exception {
-
- // Server connections
- // - Connect to AAS server
- //VABElementProxy connSubModel = this.connManager.connectToVABElement("AASServer");
- ModelServerProxy modelServer = this.connManager.connectToModelServerURL("http://localhost:8080/basys.examples/Components/BaSys/1.0/aasServer/");
-
- // - Invoke BaSyx service calls via web services
- //WebServiceRawClient client = new WebServiceRawClient();
- // - Directory web service URL
- //String wsURL = "http://localhost:8080/basys.components/Testsuite/Directory/SQL";
- // - AAS repository server URL
- //String aasSrvURL = "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/aasserver";
-
-
- // Instantiate AAS registry proxy that connects to registry
- AASRegistryProxy registry = new AASRegistryProxy("http://localhost:8080/basys.examples/Components/Directory/SQL");
-
-
- // Create device AAS
- // - Product ID (urn:<legalEntity>:<subUnit>:<subModel>:<version>:<revision>:<elementID>#<elementInstance>)
- ModelUrn deviceAASID = new ModelUrn("de.FHG", "devices.es.iese", "aas", "1.0", "3", "x-509", "001");
- // - Create device AAS
- AssetAdministrationShell aas = new AssetAdministrationShell();
- aas.put("idShort", "DeviceIDShort");
- // - Push AAS to model repository
- modelServer.pushToServer(deviceAASID, aas);
- // - AAS URL on server
- //String aasURLOnServer = "/aas/submodels/aasRepository/"+deviceAASID.getEncodedURN();
- // - Transfer device AAS to server
- //connSubModel.createElement(aasURLOnServer, aas);
-
-
- // The device also brings a sub model structure with an own ID that is being pushed on the server
- ModelUrn deviceStatusSMID = new ModelUrn("de.FHG", "devices.es.iese", "statusSM", "1.0", "3", "x-509", "001");
- // - Create generic sub model
- SubModel statusSM = new SubModel();
- statusSM.putPath("properties/status", "offline");
- //((Map<String, Object>) statusSM.get("properties")).put("status", "offline");
- // - Push static sub model to model repository
- modelServer.pushToServer(deviceStatusSMID, statusSM);
- // - Sub model URL on server
- //String statusSubmodelURLOnServer = "/aas/submodels/aasRepository/"+deviceStatusSMID.getEncodedURN();
- // - Transfer device sub model to server
- //connSubModel.createElement(statusSubmodelURLOnServer, statusSM);
-
-
- // Delete AAS registration for a fresh start - ignore if URL was not found. In this case, there was no previous registration and the registry was clean
- registry.delete(deviceAASID);
-
-
- // Register AAS and sub models in directory (push AAS descriptor to server)
- // - Create an AAS descriptor
- //AASDescriptor deviceAASDescriptor = new AASDescriptor(deviceAASID.getURN(), Identification.URI, aasSrvURL+aasURLOnServer);
- AASDescriptor deviceAASDescriptor = new AASDescriptor(deviceAASID.getURN(), IdentifierType.URI, modelServer.getURLToModel(deviceAASID));
- // - Add a sub model descriptor for device
- SubmodelDescriptor deviceStatusSubmodelDescriptor = new SubmodelDescriptor(deviceStatusSMID.getURN(), IdentifierType.URI, modelServer.getURLToModel(deviceStatusSMID));
- deviceAASDescriptor.addSubmodelDescriptor(deviceStatusSubmodelDescriptor);
- // - Push AAS descriptor to server
- //client.post(wsURL+"/api/v1/registry", JSONTools.Instance.serialize(deviceAASDescriptor).toString());
- registry.register(deviceAASDescriptor);
-
-
- // Device updates status to ready
- //connSubModel.updateElementValue(statusSubmodelURLOnServer+"/properties/status", "ready");
- modelServer.updateElementValue(deviceStatusSMID, "/properties/status", "ready");
- // - Read updated status back
- modelServer.readElementValue(deviceStatusSMID, "/properties/status");
-
-
- // Lookup device AAS
- // - Lookup AAS from AAS directory, get AAS descriptor
- //String jsonData = client.get(wsURL+"/api/v1/registry/"+deviceAASID.getEncodedURN());
- // - Read AAS end point from AAS descriptor
- //AASDescriptor aasDescriptor = new AASDescriptor((Map<String, Object>) JSONTools.Instance.deserialize(new JSONObject(jsonData)));
- AASDescriptor aasDescriptor = registry.lookup(deviceAASID);
- // - Get information about status sub model
- SubmodelDescriptor smDescriptor = aasDescriptor.getSubModelDescriptor(deviceStatusSMID.getURN());
-
-
- // Connect to status sub model end point
- // - FIXME - we need the ability to connect to an absolute URL here
- //Map<String, Object> deviceSM = (Map<String, Object>) connSubModel.readElementValue(statusSubmodelURLOnServer);
- //Map<String, Object> deviceSM = (Map<String, Object>) connSubModel.readElementValue(smDescriptor.getFirstEndpoint());
- VABElementProxy connSubModel = connManager.connectToVABElementByURL(smDescriptor.getFirstEndpoint());
- Map<String, Object> deviceSM = (Map<String, Object>) connSubModel.readElementValue("/");
- // - Output status information
- System.out.println("ReadBack:"+((Map<String, Object>) deviceSM.get("properties")).get("status"));
- }
-}
diff --git a/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/DeviceMockup.java b/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/DeviceMockup.java
deleted file mode 100644
index cdf94af..0000000
--- a/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/DeviceMockup.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package examples.deviceaas.devices.devicemanager;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.net.Socket;
-
-import basys.examples.deployment.BaSyxContextRunnable;
-
-
-
-/**
- * This class implements a mockup of a manufacturing device
- *
- * @author kuhn
- *
- */
-public class DeviceMockup implements BaSyxContextRunnable {
-
-
- /**
- * Communication socket
- */
- protected Socket communicationSocket = null;
-
-
- /**
- * Communication stream to connected device manager
- */
- protected DataOutputStream toDeviceManager = null;
-
-
- /**
- * Store server port
- */
- protected int serverPort;
-
-
- /**
- * Store device name
- */
- protected String deviceName = null;
-
-
-
- /**
- * Constructor
- */
- public DeviceMockup(int port) {
- // Store server port
- serverPort = port;
- }
-
-
- /**
- * Indicate device status change
- */
- public void statusChange(String newStatus) {
- // Signal status change
- try {
- // Write bytes to device manager
- toDeviceManager.writeBytes(newStatus);
-
- // Flush communication
- toDeviceManager.flush();
- } catch (IOException e) {
- // Handle exceptions for now by printing them to the console
- e.printStackTrace();
- }
- }
-
-
- /**
- * Close device communication socket
- */
- public void closeSocket() {
- // Try to close socket
- try {
- // Close socket
- communicationSocket.close();
- } catch (IOException e) {
- // Handle exceptions for now by printing them to the console
- e.printStackTrace();
- }
- }
-
-
- /**
- * Start the device
- */
- @Override
- public void start() {
- // Try to create connection
- try {
- // Create connection
- communicationSocket = new Socket("localhost", serverPort);
-
- // Create output stream
- // - The output stream is simple but will do for our mockup
- toDeviceManager = new DataOutputStream(communicationSocket.getOutputStream());
- } catch (IOException e) {
- // Handle exceptions for now by printing them to the console
- e.printStackTrace();
- }
- }
-
-
- /**
- * Stop the device
- */
- @Override
- public void stop() {
- // Close communication socket
- closeSocket();
- }
-
-
- /**
- * Change the runnable name
- */
- @Override
- public BaSyxContextRunnable setName(String newName) {
- // Set name
- deviceName = newName;
-
- // Return 'this' reference to enable chaining
- return this;
- }
-
-
- /**
- * Get runnable name
- */
- @Override
- public String getName() {
- return deviceName;
- }
-}
diff --git a/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/ManufacturingDeviceManager.java b/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/ManufacturingDeviceManager.java
deleted file mode 100644
index a19fd68..0000000
--- a/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/ManufacturingDeviceManager.java
+++ /dev/null
@@ -1,260 +0,0 @@
-package examples.deviceaas.devices.devicemanager;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.URLEncoder;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.aas.backend.http.tools.GSONTools;
-import org.eclipse.basyx.aas.backend.http.tools.factory.DefaultTypeFactory;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.AssetAdministrationShell;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.SubModel;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-
-import basys.examples.aasdescriptor.AASDescriptor;
-import basys.examples.aasdescriptor.SubmodelDescriptor;
-import basys.examples.tools.BaSyxManagerComponent;
-import basys.examples.urntools.ModelUrn;
-import examples.directory.ExamplesDirectory;
-
-
-
-/**
- * Example manufacturing device manager code
- *
- * This example code illustrates a basic device manager component. It implements the interaction between a device and the BaSyx infrastructure.
- * This code is for example deployed on the device (in case of availability of a Java runtime environment) or to an explicit connector device.
- * The Asset Administration Shell is not kept on the device, but transferred to an AAS server during registration. This ensures its presence also
- * if the device itself is not available, e.g. due to a failure. Important asset data, such as manufacturer, and support contacts remain available
- * in this case.
- *
- * This code implements the following:
- * - Registration of device the AAS and sub models with the BaSyx infrastructure
- * - Updating of sub model properties to reflect the device status
- * - TCP connection to legacy device
- *
- *
- * @author kuhn
- *
- */
-public class ManufacturingDeviceManager extends BaSyxManagerComponent {
-
-
-
- /**
- * TCP server thread
- */
- public class TCPServer extends Thread {
-
-
- /**
- * Device manager reference
- */
- protected ManufacturingDeviceManager deviceManagerInstance = null;
-
-
-
- /**
- * Constructor
- */
- public TCPServer(ManufacturingDeviceManager instance) {
- // Store instance reference
- deviceManagerInstance = instance;
- }
-
-
- /**
- * Run server
- */
- @Override
- public void run() {
- // Communication socket
- ServerSocket deviceCommunicationSocket = null;
-
- // IOExceptions on this level are not expected. The server will not recover
- try {
- // Create a server socket
- deviceCommunicationSocket = new ServerSocket(9998);
-
- // Continuously listen for incoming connection requests from device,
- // but only support one connection at a time
- while (!deviceManagerInstance.endExecution) {
- // Accept one socket connection at a time
- Socket deviceConnectionSocket = deviceCommunicationSocket.accept();
-
- // Stream reader
- BufferedReader fromClient = new BufferedReader(new InputStreamReader(deviceConnectionSocket.getInputStream()));
-
- // Wait for data as long as socket is kept open
- while (!deviceConnectionSocket.isClosed()) {
- // An IOException here could indicate a closed socket
- try {
- // This server implements a very simple protocol that transmits status updates as strings
- String newDeviceStatus = fromClient.readLine();
-
- // Invoke callback
- deviceManagerInstance.onDeviceStatusChange(newDeviceStatus);
- // Handle IO exceptions
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- // Close socket
- deviceCommunicationSocket.close();
-
- // Handle all non-recoverable exceptions
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
-
-
- /**
- * VAB connection manager backend
- */
- protected VABConnectionManager connManager = new VABConnectionManager(new ExamplesDirectory(), new HTTPConnectorProvider());
-
-
- /**
- * GSON serializer
- */
- protected GSONTools serializer = new GSONTools(new DefaultTypeFactory());
-
-
- /**
- * Server connection
- */
- protected VABElementProxy connSubModel = null;
-
-
- /**
- * Status sub model URN
- */
- protected String statusSubmodelURLOnServer = null;
-
-
- /**
- * Controller sub model URN
- */
- protected String controllerSubmodelURLOnServer = null;
-
-
-
-
-
-
- /**
- * Constructor
- */
- public ManufacturingDeviceManager() {
- // Do nothing here
- }
-
-
-
- /**
- * Initialize the device, and register it with the backend
- */
- @Override @SuppressWarnings("unchecked")
- public void initialize() {
- // Create TCP thread (or any other connection) to legacy device
- new TCPServer(this).start();
-
-
- // Server connections
- // - Connect to AAS server
- connSubModel = this.connManager.connectToVABElement("AASServer");
- // - Invoke BaSyx service calls via web services
- WebServiceRawClient client = new WebServiceRawClient();
- // - Directory web service URL
- String wsURL = "http://localhost:8080/basys.examples/Components/Directory/SQL";
- // - AAS repository server URL
- String aasSrvURL = "http://localhost:8080/basys.examples/Components/BaSys/1.0/aasServer";
-
-
- // Create device AAS
- // - Product ID (urn:<legalEntity>:<subUnit>:<subModel>:<version>:<revision>:<elementID>#<elementInstance>)
- ModelUrn deviceAASID = new ModelUrn("de.FHG", "devices.es.iese", "aas", "1.0", "3", "x-509", "001");
- // - Create device AAS
- AssetAdministrationShell aas = new AssetAdministrationShell();
- aas.put("idShort", "DeviceIDShort");
- // - AAS URL on server
- String aasURLOnServer = "/aas/submodels/aasRepository/"+deviceAASID.getEncodedURN();
- // - Transfer device AAS to server
- connSubModel.createElement(aasURLOnServer, aas);
-
-
- // The device also brings a sub model structure with an own ID that is being pushed on the server
- ModelUrn deviceStatusSMID = new ModelUrn("de.FHG", "devices.es.iese", "statusSM", "1.0", "3", "x-509", "001");
- // - Create generic sub model
- SubModel statusSM = new SubModel();
- ((Map<String, Object>) statusSM.get("properties")).put("status", "offline");
- // - Sub model URL on server
- statusSubmodelURLOnServer = "/aas/submodels/aasRepository/"+deviceStatusSMID.getEncodedURN();
- // - Transfer device sub model to server
- connSubModel.createElement(statusSubmodelURLOnServer, statusSM);
-
-
- // The device also brings a sub model structure with an own ID that is being pushed on the server
- ModelUrn deviceControllerSMID = new ModelUrn("de.FHG", "devices.es.iese", "controllerSM", "1.0", "3", "x-509", "001");
- // - Create generic sub model
- SubModel controllerSM = new SubModel();
- // - Create sub model contents
- Map<String, Object> listOfControllers = new HashMap<>();
- ((Map<String, Object>) controllerSM.get("properties")).put("controllers", listOfControllers);
- // - Sub model URL on server
- controllerSubmodelURLOnServer = "/aas/submodels/aasRepository/"+deviceControllerSMID.getEncodedURN();
- // - Transfer device sub model to server
- connSubModel.createElement(controllerSubmodelURLOnServer, controllerSM);
-
-
- // Delete AAS registration for a fresh start - ignore if URL was not found. In this case, there was no previous registration and the registry was clean
- client.delete(wsURL+"/api/v1/registry/"+URLEncoder.encode(deviceAASID.getURN()));
-
-
- // Register AAS and sub models in directory (push AAS descriptor to server)
- // - Create an AAS descriptor
- AASDescriptor deviceAASDescriptor = new AASDescriptor(deviceAASID.getURN(), IdentifierType.URI, aasSrvURL+aasURLOnServer);
- // - Add a sub model descriptor for device
- SubmodelDescriptor deviceStatusSubmodelDescriptor = new SubmodelDescriptor(deviceStatusSMID.getURN(), IdentifierType.URI, aasSrvURL+statusSubmodelURLOnServer);
- deviceAASDescriptor.addSubmodelDescriptor(deviceStatusSubmodelDescriptor);
- SubmodelDescriptor deviceControllerSubmodelDescriptor = new SubmodelDescriptor(deviceControllerSMID.getURN(), IdentifierType.URI, aasSrvURL+controllerSubmodelURLOnServer);
- deviceAASDescriptor.addSubmodelDescriptor(deviceControllerSubmodelDescriptor);
- // - Push AAS descriptor to server
- client.post(wsURL+"/api/v1/registry", serializer.getJsonString(serializer.serialize(deviceAASDescriptor)));
- }
-
-
- /**
- * Change the device status
- */
- public void onDeviceStatusChange(String newStatus) {
- System.out.println("Status change:"+newStatus);
-
- // Device updates status to ready
- connSubModel.updateElementValue(statusSubmodelURLOnServer+"/properties/status", "ready");
- }
-
-
-
-
- /**
- * Main method - instantiate and run this manager component
- */
- public static void main(String[] args) {
- // Run this manager
- new ManufacturingDeviceManager().start();
- }
-}
diff --git a/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/ManufacturingDeviceManagerServlet.java b/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/ManufacturingDeviceManagerServlet.java
deleted file mode 100644
index 801eb89..0000000
--- a/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/ManufacturingDeviceManagerServlet.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package examples.deviceaas.devices.devicemanager;
-
-
-/**
- * Example manufacturing device Asset Administration Shell (AAS) code
- *
- * This example servlet code illustrates the interaction between a device and an AAS of the BaSys infrastructure.
- * The servlet connects to a legacy device using a TCP connection (this connection is mocked in this example).
- *
- * @author kuhn
- *
- */
-public class ManufacturingDeviceManagerServlet {
-
-
-
- /**
- * Constructor
- */
- public ManufacturingDeviceManagerServlet() {
- // Do nothing here
- }
-
-
-
- /**
- * Initialize the device, and register it with the backend
- */
- public void register() {
-
- }
-
-
- /**
- *
- */
-
-}
diff --git a/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/ReceiveDeviceStatusApplication.java b/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/ReceiveDeviceStatusApplication.java
deleted file mode 100644
index 1838dec..0000000
--- a/examples/basys.examples/examples/examples/deviceaas/devices/devicemanager/ReceiveDeviceStatusApplication.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package examples.deviceaas.devices.devicemanager;
-
-import java.util.Map;
-
-import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.aas.backend.http.tools.GSONTools;
-import org.eclipse.basyx.aas.backend.http.tools.factory.DefaultTypeFactory;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-
-import basys.examples.aasdescriptor.AASDescriptor;
-import basys.examples.aasdescriptor.SubmodelDescriptor;
-import basys.examples.deployment.BaSyxContextRunnable;
-import basys.examples.urntools.ModelUrn;
-import examples.directory.ExamplesDirectory;
-
-
-
-
-/**
- * Example BaSys 4.0 application that receives a status change
- *
- * @author kuhn
- *
- */
-public class ReceiveDeviceStatusApplication implements BaSyxContextRunnable {
-
-
- /**
- * The WebServiceRawClient invokes BaSyx service calls via web services
- */
- protected WebServiceRawClient client = new WebServiceRawClient();
-
-
- /**
- * Directory web service URL
- */
- protected String wsURL = "http://localhost:8080/basys.examples/Components/Directory/SQL";
-
-
- /**
- * URN of device - used to identify device
- */
- protected ModelUrn deviceAASID = new ModelUrn("de.FHG", "devices.es.iese", "aas", "1.0", "3", "x-509", "001");
-
-
- /**
- * URN of device sub model - used too identify device status sub model
- */
- protected ModelUrn deviceStatusSMID = new ModelUrn("de.FHG", "devices.es.iese", "statusSM", "1.0", "3", "x-509", "001");
-
-
- /**
- * GSON serializer
- */
- protected GSONTools serializer = new GSONTools(new DefaultTypeFactory());
-
-
- /**
- * VAB connection manager backend
- */
- protected VABConnectionManager connManager = new VABConnectionManager(new ExamplesDirectory(), new HTTPConnectorProvider());
-
-
- /**
- * Application name
- */
- protected String applicationName = null;
-
-
-
-
-
- /**
- * Constructor
- */
- public ReceiveDeviceStatusApplication() {
- // Create WebServiceRawClient that invokes BaSyx service calls via web services
- client = new WebServiceRawClient();
- }
-
-
- /**
- * Receive status
- */
- @SuppressWarnings("unchecked")
- public String getDeviceStatus() {
- // Lookup device AAS
- // - Lookup AAS from AAS directory, get AAS descriptor
- String jsonData = client.get(wsURL+"/api/v1/registry/"+deviceAASID.getEncodedURN());
- // - Read AAS end point from AAS descriptor
- AASDescriptor aasDescriptor = new AASDescriptor((Map<String, Object>) serializer.deserialize(serializer.getMap(serializer.getObjFromJsonStr(jsonData))));
-
-
- // - Get information about status sub model
- SubmodelDescriptor smDescriptor = aasDescriptor.getSubModelDescriptor(deviceStatusSMID.getURN());
-
-
- // Connect to status sub model end point
- VABElementProxy connSM = connManager.connectToVABElementByURL(smDescriptor.getFirstEndpoint());
- // - Read elements
- Map<String, Object> deviceSM = (Map<String, Object>) connSM.readElementValue("/");
- // - Output status information
- System.out.println("ReadBack:"+((Map<String, Object>) deviceSM.get("properties")).get("status"));
-
-
- // Return status
- return ((Map<String, Object>) deviceSM.get("properties")).get("status").toString();
- }
-
-
-
- /**
- * Start the application
- */
- @Override
- public void start() {
- // Do nothing
- }
-
-
- /**
- * Stop the application
- */
- @Override
- public void stop() {
- // Do nothing
- }
-
-
- /**
- * Change the runnable name
- */
- @Override
- public BaSyxContextRunnable setName(String newName) {
- // Set name
- applicationName = newName;
-
- // Return 'this' reference to enable chaining
- return this;
- }
-
-
- /**
- * Get runnable name
- */
- @Override
- public String getName() {
- return applicationName;
- }
-
-}
diff --git a/examples/basys.examples/examples/examples/productaas/RunExample.java b/examples/basys.examples/examples/examples/productaas/RunExample.java
deleted file mode 100644
index cdcea1e..0000000
--- a/examples/basys.examples/examples/examples/productaas/RunExample.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package examples.productaas;
-
-import java.net.URLEncoder;
-import java.util.Map;
-
-import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.aas.backend.http.tools.GSONTools;
-import org.eclipse.basyx.aas.backend.http.tools.factory.DefaultTypeFactory;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.AssetAdministrationShell;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
-import org.eclipse.basyx.regression.support.server.AASHTTPServerResource;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-import basys.examples.aasdescriptor.AASDescriptor;
-import basys.examples.aasdescriptor.ModelUrn;
-import examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
-import examples.directory.ExamplesDirectory;
-
-
-
-/**
- * Run example for product AAS
- *
- * @author kuhn
- *
- */
-public class RunExample {
-
-
- /**
- * VAB connection manager backend
- */
- protected VABConnectionManager connManager = new VABConnectionManager(new ExamplesDirectory(), new HTTPConnectorProvider());
-
-
- /**
- * Makes sure Tomcat Server with basic BaSys topology is started
- */
- @ClassRule
- public static AASHTTPServerResource res = AASHTTPServerResource.getTestResource(new BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory());
-
-
-
- /**
- * Test basic queries
- */
- @SuppressWarnings("unchecked")
- @Test
- public void test() throws Exception {
- // Create GSON serializer
- GSONTools serializer = new GSONTools(new DefaultTypeFactory());
-
-
- // Server connections
- // - Connect to AAS server
- VABElementProxy connSubModel = this.connManager.connectToVABElement("AASServer");
- // - Invoke BaSyx service calls via web services
- WebServiceRawClient client = new WebServiceRawClient();
- // - Directory web service URL
- String wsURL = "http://localhost:8080/basys.examples/Components/Directory/SQL";
- // - AAS repository server URL
- String aasSrvURL = "http://localhost:8080/basys.examples/Components/BaSys/1.0/aasServer";
-
-
- // Create product AAS
- // - Product ID (urn:<legalEntity>:<subUnit>:<subModel>:<version>:<revision>:<elementID>#<elementInstance>)
- ModelUrn productID = new ModelUrn("de.FHG", "products.es.iese", "aas", "1.0", "3", "product1", null);
- // - Create map with complex type
- AssetAdministrationShell aas = new AssetAdministrationShell();
- aas.put("idShort", "ProductIDShort");
- // - AAS URL on server
- //String aasURLOnServer = "/aas/submodels/rawSampleCFG/"+productID.getEncodedURN();
- String aasURLOnServer = "/aas/submodels/aasRepository/"+productID.getEncodedURN();
- // - Create AAS structure on server
- connSubModel.createElement(aasURLOnServer, aas);
-
-
- // Delete AAS registration for a fresh start - ignore if URL was not found. In this case, there was no previous registration and the registry was clean
- client.delete(wsURL+"/api/v1/registry/"+URLEncoder.encode(productID.getURN()));
-
-
- // Register AAS in directory (push AAS descriptor to server)
- // - Create an AAS descriptor
- AASDescriptor productAASDescriptor = new AASDescriptor(productID.getURN(), IdentifierType.URI, aasSrvURL+aasURLOnServer);
- // - Push AAS descriptor to server
- client.post(wsURL+"/api/v1/registry", serializer.getJsonString(serializer.serialize(productAASDescriptor)));
-
-
- // Lookup AAS
- // - Lookup AAS from AAS directory, get AAS descriptor
- String jsonData = client.get(wsURL+"/api/v1/registry/"+productID.getEncodedURN());
- // - Read AAS end point from AAS descriptor
- AASDescriptor aasDescriptor = new AASDescriptor((Map<String, Object>) serializer.deserialize(serializer.getMap(serializer.getObjFromJsonStr(jsonData))));
- System.out.println("Endpoint1:"+jsonData);
- System.out.println("Endpoint2:"+serializer.getObjFromJsonStr(jsonData));
- System.out.println("Endpoint3:"+serializer.getMap(serializer.getObjFromJsonStr(jsonData)));
- System.out.println("Endpoint:"+aasDescriptor.getFirstEndpoint());
-
-
- // Connect to AAS end point
- VABElementProxy connSM = connManager.connectToVABElementByURL(aasDescriptor.getFirstEndpoint());
- System.out.println("XXX");
- Map<String, Object> productAAS = (Map<String, Object>) connSM.readElementValue("");
- // - Read product AAS from server
- System.out.println("ReadBack1:"+connSM);
- System.out.println("ReadBack2:"+productAAS);
-
- System.out.println("ReadBack:"+productAAS.get("idShort"));
- }
-}
diff --git a/examples/basys.examples/examples/examples/productaas/RunExampleSimpleAPI.java b/examples/basys.examples/examples/examples/productaas/RunExampleSimpleAPI.java
deleted file mode 100644
index e286517..0000000
--- a/examples/basys.examples/examples/examples/productaas/RunExampleSimpleAPI.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package examples.productaas;
-
-import java.net.URLEncoder;
-import java.util.Map;
-
-import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.aas.backend.http.tools.GSONTools;
-import org.eclipse.basyx.aas.backend.http.tools.factory.DefaultTypeFactory;
-import org.eclipse.basyx.aas.metamodel.hashmap.VABModelMap;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.AssetAdministrationShell;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
-import org.eclipse.basyx.regression.support.server.AASHTTPServerResource;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-import basys.examples.aasdescriptor.AASDescriptor;
-import basys.examples.aasdescriptor.ModelUrn;
-import basys.examples.frontend.client.connmanager.BaSysConnectionManager;
-import basys.examples.frontend.client.connmanager.ModelServerProxy;
-import basys.examples.frontend.client.proxies.AASRegistryProxy;
-import examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
-import examples.directory.ExamplesDirectory;
-
-
-
-/**
- * Run example for product AAS
- *
- * @author kuhn
- *
- */
-public class RunExampleSimpleAPI {
-
-
- /**
- * VAB connection manager backend
- */
- protected BaSysConnectionManager connManager = new BaSysConnectionManager(new ExamplesDirectory(), new HTTPConnectorProvider());
-
-
- /**
- * Makes sure Tomcat Server with basic BaSys topology is started
- */
- @ClassRule
- public static AASHTTPServerResource res = AASHTTPServerResource.getTestResource(new BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory());
-
-
-
- /**
- * Test basic queries
- */
- @SuppressWarnings("unchecked") @Test
- public void test() throws Exception {
-
- // Server connections
- // - Connect to AAS server
- ModelServerProxy modelServer = this.connManager.connectToModelServer("AASServer");
-
- // Instantiate AAS registry proxy
- AASRegistryProxy registry = new AASRegistryProxy("http://localhost:8080/basys.examples/Components/Directory/SQL");
-
- // Create product AAS
- // - Product ID (urn:<legalEntity>:<subUnit>:<subModel>:<version>:<revision>:<elementID>#<elementInstance>)
- ModelUrn productID = new ModelUrn("de.FHG", "products.es.iese", "aas", "1.0", "3", "product1", null);
- // - Create map with complex type
- AssetAdministrationShell aas = new AssetAdministrationShell();
- aas.put("idShort", "ProductIDShort");
- // - Push AAS to model repository
- modelServer.pushToServer(productID, aas);
-
-
- // Delete AAS registration for a fresh start - ignore if URL was not found. In this case, there was no previous registration and the registry was clean
- registry.delete(productID);
-
-
- // Register AAS in directory (push AAS descriptor to server)
- // - Create an AAS descriptor
- AASDescriptor productAASDescriptor = new AASDescriptor(productID.getURN(), IdentifierType.URI, modelServer.getURLToModel(productID));
- // - Push AAS descriptor to server
- registry.register(productAASDescriptor);
-
-
- // Lookup AAS
- // - Read AAS end point from AAS descriptor
- AASDescriptor aasDescriptor = registry.lookup(productID);
- // Connect to AAS end point
- VABElementProxy connSubModel2 = connManager.connectToVABElementByURL(aasDescriptor.getFirstEndpoint());
- // - Get AAS
- Map<String, Object> productAAS = (Map<String, Object>) connSubModel2.readElementValue("/");
- // - Read product AAS from server
- System.out.println("ReadBack:"+productAAS.get("idShort"));
- }
-}
diff --git a/examples/basys.examples/examples/org/eclipse/basyx/examples/mockup/devicemanager/BaSyxTCPManufacturingDeviceManager.java b/examples/basys.examples/examples/org/eclipse/basyx/examples/mockup/devicemanager/BaSyxTCPManufacturingDeviceManager.java
deleted file mode 100644
index c1fc932..0000000
--- a/examples/basys.examples/examples/org/eclipse/basyx/examples/mockup/devicemanager/BaSyxTCPManufacturingDeviceManager.java
+++ /dev/null
@@ -1,174 +0,0 @@
-package org.eclipse.basyx.examples.mockup.devicemanager;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.AssetAdministrationShell;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.SubModel;
-import org.eclipse.basyx.components.devicemanager.TCPDeviceManagerComponent;
-import org.eclipse.basyx.components.proxy.registry.AASHTTPRegistryProxy;
-import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-import basys.examples.aasdescriptor.AASDescriptor;
-import basys.examples.aasdescriptor.ModelUrn;
-
-
-
-/**
- * Example manufacturing device manager code
- *
- * This example code illustrates a basic device manager component. It implements the interaction between a device and the BaSyx infrastructure.
- * This code is for example deployed on the device (in case of availability of a Java runtime environment) or to an explicit connector device.
- * The Asset Administration Shell is not kept on the device, but transferred to an AAS server during registration. This ensures its presence also
- * if the device itself is not available, e.g. due to a failure. Important asset data, such as manufacturer, and support contacts remain available
- * in this case.
- *
- * This code implements the following:
- * - Registration of device the AAS and sub models with the BaSyx infrastructure
- * - Updating of sub model properties to reflect the device status
- * - TCP connection to legacy device
- *
- *
- * @author kuhn
- *
- */
-public class BaSyxTCPManufacturingDeviceManager extends TCPDeviceManagerComponent {
-
-
- /**
- * AAS server connection
- */
- protected VABElementProxy aasServerConnection = null;
-
-
-
-
-
-
- /**
- * Constructor
- */
- public BaSyxTCPManufacturingDeviceManager(int port) {
- // Invoke base constructor
- super(port);
-
-
- // Set registry that will be used by this service
- setRegistry(new AASHTTPRegistryProxy("http://localhost:8080/basys.examples/Components/Directory/SQL"));
-
-
- // Set service connection manager and create AAS server connection
- setConnectionManager(new VABConnectionManager(new ExamplesPreconfiguredDirectory(), new HTTPConnectorProvider()));
- // - Create AAS server connection
- aasServerConnection = getConnectionManager().connectToHTTPVABElement("AASServer", "/aas/submodels/aasRepository/");
-
-
- // Set AAS server VAB object ID, AAS server URL, and AAS server path prefix
- setAASServerObjectID("AASServer");
- setAASServerURL("http://localhost:8080/basys.examples/Components/BaSys/1.0/aasServer");
- setAASServerPathPrefix("/aas/submodels/aasRepository/");
- }
-
-
-
- /**
- * Initialize the device, and register it with the backend
- */
- @Override
- public void start() {
- // Base implementation
- super.start();
-
- // Create the device AAS and sub model structure
- createDeviceAASAndSubModels();
-
-
- // Create AAS and sub model descriptors
- AASDescriptor aasDescriptor = createAASDescriptorURI(lookupURN("AAS"));
- addSubModelDescriptorURI(aasDescriptor, lookupURN("Status"));
- addSubModelDescriptorURI(aasDescriptor, lookupURN("Controller"));
-
-
- // Register AAS and sub model descriptors in directory (push AAS descriptor to server)
- getRegistry().delete(lookupURN("AAS"));
- getRegistry().register(aasDescriptor);
- }
-
-
-
- /**
- * Create the device AAS and sub model structure
- */
- @SuppressWarnings("unchecked")
- protected void createDeviceAASAndSubModels() {
-
- // Register URNs of managed VAB objects
- addShortcut("AAS", new ModelUrn("urn:de.FHG:devices.es.iese:aas:1.0:3:x-509#001"));
- addShortcut("Status", new ModelUrn("urn:de.FHG:devices.es.iese:statusSM:1.0:3:x-509#001"));
- addShortcut("Controller", new ModelUrn("urn:de.FHG:devices.es.iese:controllerSM:1.0:3:x-509#001"));
-
-
- // Create device AAS
- AssetAdministrationShell aas = new AssetAdministrationShell();
- // - Populate AAS
- aas.setId("DeviceIDShort");
- // - Transfer device AAS to server
- aasServerConnection.createElement(lookupURN("AAS").toString(), aas);
-
-
- // The device also brings a sub model structure with an own ID that is being pushed on the server
- // - Create generic sub model and add properties
- SubModel statusSM = new SubModel()
- // - Property status: indicate device status
- .putPath("properties/status", "offline")
- // - Property statistics: export invocation statistics for every service
- // - invocations: indicate total service invocations. Properties are not persisted in this example,
- // therefore we start counting always at 0.
- .putPath("properties/statistics/default/invocations", 0);
- // - Transfer device sub model to server
- aasServerConnection.createElement(lookupURN("Status").toString(), statusSM);
-
-
- // The device also brings a sub model structure with an own ID that is being pushed on the server
- // - Create generic sub model
- SubModel controllerSM = new SubModel();
- // - Create sub model contents manually
- Map<String, Object> listOfControllers = new HashMap<>();
- ((Map<String, Object>) controllerSM.get("properties")).put("controllers", listOfControllers);
- // - Transfer device sub model to server
- aasServerConnection.createElement(lookupURN("Controller").toString(), controllerSM);
- }
-
-
-
-
-
-
- /**
- * Received a string from network
- */
- @Override
- public void onReceive(byte[] rxData) {
- System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++RCV");
-
- // Do not process null values
- if (rxData == null) return;
-
- // Convert received data to string
- String rxStr = new String(rxData);
- // - Trim string to remove possibly trailing and leading white spaces
- rxStr = rxStr.trim();
-
- // Check what was being received. This check is performed based on a prefix that he device has to provide);
- // - Update of device status
- if (hasPrefix(rxStr, "status:")) aasServerConnection.updateElementValue(lookupURN("Status").getEncodedURN()+"/properties/status", removePrefix(rxStr, "status"));
- // - Indicate service invocation
- if (hasPrefix(rxStr, "invocation:")) {
- // Read and increment invocation counter
- int invocations = (int) aasServerConnection.readElementValue(lookupURN("Status").getEncodedURN()+"/properties/statistics/default/invocations");
- aasServerConnection.updateElementValue(lookupURN("Status").getEncodedURN()+"/properties/statistics/default/invocations", ++invocations);
- }
- }
-}
diff --git a/examples/basys.examples/src/basys/examples/deployment/BaSyxContextRunnable.java b/examples/basys.examples/src/basys/examples/deployment/BaSyxContextRunnable.java
deleted file mode 100644
index fe52f1f..0000000
--- a/examples/basys.examples/src/basys/examples/deployment/BaSyxContextRunnable.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package basys.examples.deployment;
-
-
-
-/**
- * Runnable in a BaSyx context
- *
- * @author kuhn
- *
- */
-public interface BaSyxContextRunnable {
-
-
- /**
- * Start the runnable
- */
- public void start();
-
-
- /**
- * Stop the runnable
- */
- public void stop();
-
-
- /**
- * Change the runnable name
- */
- public BaSyxContextRunnable setName(String newName);
-
-
- /**
- * Get runnable name
- */
- public String getName();
-}
diff --git a/examples/basys.examples/src/basys/examples/deployment/BaSyxDeployment.java b/examples/basys.examples/src/basys/examples/deployment/BaSyxDeployment.java
deleted file mode 100644
index 898fb46..0000000
--- a/examples/basys.examples/src/basys/examples/deployment/BaSyxDeployment.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package basys.examples.deployment;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.basyx.regression.support.server.AASHTTPServerResource;
-import org.eclipse.basyx.regression.support.server.BaSyxContext;
-import org.junit.rules.ExternalResource;
-
-
-
-
-/**
- * This class represents a BaSyx deployment with servers / servlets and assets for running BaSyx examples
- *
- * @author kuhn
- *
- */
-public class BaSyxDeployment extends ExternalResource {
-
-
- /**
- * Store context objects
- */
- protected Object[] contextComponents = null;
-
-
- /**
- * Map runnable names to runnables
- */
- protected Map<String, BaSyxContextRunnable> contectRunnablesByName = new HashMap<>();
-
-
-
-
- /**
- * Constructor - accept parameter of type BaSyxContext or Runnable
- */
- public BaSyxDeployment(Object... components) {
- // Store context objects
- contextComponents = components;
-
- // Store runnable objects by name
- for (Object obj: contextComponents) {
- // Check component type
- if (!(obj instanceof BaSyxContextRunnable)) continue;
-
- // Add BaSyxContextRunnable to context
- // - Cast object
- BaSyxContextRunnable contextRunnable = (BaSyxContextRunnable) obj;
- // - Add context runnable to map if it is named
- if (contextRunnable.getName() == null) continue;
- // - Add context runnable to map
- contectRunnablesByName.put(contextRunnable.getName(), contextRunnable);
- }
- }
-
-
-
- /**
- * Execute before a test case starts
- */
- protected void before() {
- // Iterate context components
- for (Object contextComponent: contextComponents) {
- // Process BaSyx context objects that run in a tomcat server
- if (contextComponent instanceof BaSyxContext) {
- // Get HTTP server resource
- AASHTTPServerResource resource = AASHTTPServerResource.getTestResource((BaSyxContext) contextComponent);
- // - Invoke 'before' operation that starts the server
- resource.before();
- // - Continue loop
- continue;
- }
-
- // Process runnables
- if (contextComponent instanceof BaSyxContextRunnable) {
- // Execute runnable
- ((BaSyxContextRunnable) contextComponent).start();
- // - Continue loop
- continue;
- }
-
- // Unknown deployment context
- throw new UnknownContextComponentTypeException();
- }
- }
-
-
- /**
- * Execute after test case ends
- */
- protected void after() {
- // Iterate context components
- for (Object contextComponent: contextComponents) {
- // Process BaSyx context objects that run in a tomcat server
- if (contextComponent instanceof BaSyxContext) {
- // Get HTTP server resource
- AASHTTPServerResource resource = AASHTTPServerResource.getTestResource((BaSyxContext) contextComponent);
- // - Invoke 'before' operation that starts the server
- resource.after();
- // - Continue loop
- continue;
- }
-
- // Process runnables
- if (contextComponent instanceof BaSyxContextRunnable) {
- // Execute runnable
- ((BaSyxContextRunnable) contextComponent).stop();
- // - Continue loop
- continue;
- }
-
- // Unknown deployment context
- throw new UnknownContextComponentTypeException();
- }
- }
-
-
- /**
- * Get context runnable by name
- */
- public BaSyxContextRunnable getRunnable(String name) {
- return contectRunnablesByName.get(name);
- }
-}
-
diff --git a/examples/basys.examples/src/basys/examples/deployment/UnknownContextComponentTypeException.java b/examples/basys.examples/src/basys/examples/deployment/UnknownContextComponentTypeException.java
deleted file mode 100644
index d7ba441..0000000
--- a/examples/basys.examples/src/basys/examples/deployment/UnknownContextComponentTypeException.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package basys.examples.deployment;
-
-
-/**
- * This exception indicates the presence of an unknown component type in a BaSyx context
- *
- * @author kuhn
- *
- */
-public class UnknownContextComponentTypeException extends RuntimeException {
-
-
- /**
- * Version information for serialized instances
- */
- private static final long serialVersionUID = 1L;
-}
diff --git a/examples/basys.examples/src/basys/examples/deployment/controlComponent/ControlComponent.java b/examples/basys.examples/src/basys/examples/deployment/controlComponent/ControlComponent.java
deleted file mode 100644
index 7bf415d..0000000
--- a/examples/basys.examples/src/basys/examples/deployment/controlComponent/ControlComponent.java
+++ /dev/null
@@ -1,717 +0,0 @@
-package basys.examples.deployment.controlComponent;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-
-
-
-/**
- * BaSys 4.0 control component interface. This is a VAB object that cannot be serialized.
- *
- * @author kuhn
- *
- */
-public abstract class ControlComponent extends HashMap<String, Object> {
-
-
- /**
- * The status map implements the service/ substructure of the control component structure. It also
- * indicates variable changes via callbacks of the outer class.
- *
- * @author kuhn
- *
- */
- class StatusMap extends HashMap<String, Object> {
-
-
- /**
- * Version number of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
-
- /**
- * Constructor
- */
- public StatusMap() {
- // Populate control component "status" sub structure
- put("occupationState ", 0); // Occupation state: FREE
- put("occupier", ""); // Occupier: none
- put("lastOccupier", ""); // Last occupier: none
- put("exMode", 1); // Execution mode: AUTO
- put("exState", "IDLE"); // Execution state: IDLE
- put("opMode", ""); // Component specific operation mode (e.g. active service)
- put("workState", ""); // Component specific work state
- put("errorState", ""); // Component error state
- put("prevError", ""); // Component previous error
- }
-
-
- /**
- * Update an value
- *
- * @return Added value
- */
- @Override
- public Object put(String key, Object value) {
- // Invoke base implementation
- Object result = super.put(key, value);
-
- // Indicate value change
- onVariableChange(key, value);
-
- // Indicate specific changes to callback operations of control component
- switch(key) {
- case "occupationState": onNewOccupationState(OccupationState.byValue((int) value)); break;
- case "occupier": onNewOccupier(value.toString()); break;
- case "lastOccupier": onLastOccupier(value.toString()); break;
- case "exMode": onChangedExecutionMode(ExecutionMode.byValue((int) value)); break;
- case "exState": onChangedExecutionState(ExecutionState.byValue(value.toString())); break;
- case "opMode": onChangedOperationMode(value.toString()); break;
- case "workState": onChangedWorkState(value.toString()); break;
- case "errorState": onChangedErrorState(value.toString()); break;
- case "prevError": onChangedPrevError(value.toString()); break;
- }
-
- // Return result
- return result;
- }
- }
-
-
-
-
- /**
- * Version number of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Operations map
- */
- protected Map<String, Function<?, ?>> operations = new HashMap<String, Function<?, ?>>();
-
-
- /**
- * Saved occupier ID in case of local occupier overwrite
- */
- protected String savedOccupierID = null;
-
-
- /**
- * Status map
- */
- protected Map<String, Object> status = null;
-
-
-
-
- /**
- * Constructor
- */
- public ControlComponent() {
- // Add control component output signals to map
- // - Order list
- put("orderList", new LinkedList<String>());
- // - "status" sub structure
- status = new StatusMap();
- put("status", status);
-
- // Input signals
- // - Command / stores last command
- put("cmd", ""); // No command
- put("localOverwrite", ""); // Local override signal
- put("localOverwriteFree", ""); // Local override release signal
-
- // Operations
- // - Add "operations" sub structure
- put("operations", operations);
- // - Service operations
- Map<String, Function<?, ?>> serviceOperations = new HashMap<>();
- // - Populate service operations
- serviceOperations.put("free", (Function<String, Void> & Serializable) (v) -> {freeControlComponent(v); return null;});
- serviceOperations.put("occupy", (Function<String, Void> & Serializable) (v) -> {occupyControlComponent(v); return null;});
- serviceOperations.put("priority", (Function<String, Void> & Serializable) (v) -> {priorityOccupation(v); return null;});
- serviceOperations.put("auto", (Function<String, Void> & Serializable) (v) -> {this.setExecutionMode(ExecutionMode.AUTO); return null;});
- serviceOperations.put("semiauto", (Function<String, Void> & Serializable) (v) -> {this.setExecutionMode(ExecutionMode.SEMIAUTO); return null;});
- serviceOperations.put("manual", (Function<String, Void> & Serializable) (v) -> {this.setExecutionMode(ExecutionMode.MANUAL); return null;});
- serviceOperations.put("simulation", (Function<String, Void> & Serializable) (v) -> {this.setExecutionMode(ExecutionMode.SIMULATION); return null;});
- serviceOperations.put("start", (Function<String, Void> & Serializable) (v) -> {this.changeExecutionState("START"); return null;});
- serviceOperations.put("reset", (Function<String, Void> & Serializable) (v) -> {this.changeExecutionState("RESET"); return null;});
- serviceOperations.put("hold", (Function<String, Void> & Serializable) (v) -> {this.changeExecutionState("HOLD"); return null;});
- serviceOperations.put("unhold", (Function<String, Void> & Serializable) (v) -> {this.changeExecutionState("UNHOLD"); return null;});
- serviceOperations.put("suspend", (Function<String, Void> & Serializable) (v) -> {this.changeExecutionState("SUSPEND"); return null;});
- serviceOperations.put("unsuspend", (Function<String, Void> & Serializable) (v) -> {this.changeExecutionState("UNSUSPEND"); return null;});
- serviceOperations.put("abort", (Function<String, Void> & Serializable) (v) -> {this.changeExecutionState("ABORT"); return null;});
- serviceOperations.put("stop", (Function<String, Void> & Serializable) (v) -> {this.changeExecutionState("STOP"); return null;});
- serviceOperations.put("clear", (Function<String, Void> & Serializable) (v) -> {this.changeExecutionState("CLEAR"); return null;});
- serviceOperations.put("reset", (Function<String, Void> & Serializable) (v) -> {this.changeExecutionState("RESET"); return null;});
- serviceOperations.put("bstate", (Function<String, Void> & Serializable) (v) -> {this.setOperationMode("BSTATE"); return null;});
- }
-
-
-
- /**
- * Indicate change of a variable
- */
- protected abstract void onVariableChange(String varName, Object newValue);
-
-
- /**
- * Indicate new occupier
- */
- protected abstract void onNewOccupier(String occupierId);
-
-
- /**
- * Indicate new occupation state
- */
- protected abstract void onNewOccupationState(OccupationState state);
-
-
- /**
- * Indicate a change of last occupier. This is probably not relevant for many sub classes, therefore this class
- * provides a default implementation.
- */
- protected void onLastOccupier(String lastOccupierId) { /* Do nothing */ }
-
-
- /**
- * Indicate an execution mode change
- */
- protected abstract void onChangedExecutionMode(ExecutionMode newExecutionMode);
-
-
- /**
- * Indicate an execution state change
- */
- protected abstract void onChangedExecutionState(ExecutionState newExecutionState);
-
-
- /**
- * Indicate an operation mode change
- */
- protected abstract void onChangedOperationMode(String newOperationMode);
-
-
- /**
- * Indicate an work state change
- */
- protected abstract void onChangedWorkState(String newWorkState);
-
-
- /**
- * Indicate an error state change
- */
- protected abstract void onChangedErrorState(String newWorkState);
-
-
- /**
- * Indicate an previous error state change. This is probably not relevant for many sub classes, therefore this class
- * provides a default implementation.
- */
- protected abstract void onChangedPrevError(String newWorkState);
-
-
-
-
- /**
- * Get "operations" map
- */
- protected Map<String, Function<?, ?>> getOperationsMap() {
- return operations;
- }
-
-
-
- /**
- * Update an value
- *
- * @return Added value
- */
- @Override
- public Object put(String key, Object value) {
- // Invoke base implementation
- Object result = super.put(key, value);
-
- // Indicate value change
- onVariableChange(key, value);
-
- // Process variable changes
- switch(key) {
- case "cmd": changeExecutionState(value.toString()); break;
- case "localOverwrite": invokeLocalOverwrite(); break;
- case "localOverwriteFree": clearLocalOverwrite(); break;
- }
-
- // Return result
- return result;
- }
-
-
- /**
- * Helper method - free this control component
- */
- private void freeControlComponent(String senderId) {
- // Update occupier if sender is occupier
- if (senderId.equals(this.getOccupierID())) {
- // Get occupier from last occupier and reset last occupier
- this.setOccupierID(this.getLastOccupierID());
- this.setLastOccupierID("");
- // Component is free if last occupier is empty, occupied otherwise
- if (this.getOccupierID().isEmpty()) this.setOccupationState(OccupationState.FREE); else this.setOccupationState(OccupationState.OCCUPIED);
- }
- }
-
-
- /**
- * Helper method - occupy this control component if it is free
- */
- private void occupyControlComponent(String occupier) {
- // Update occupier if component is FREE
- if (this.getOccupationState().equals(OccupationState.FREE)) {this.setOccupierID(occupier); this.setOccupationState(OccupationState.OCCUPIED);}
- }
-
-
- /**
- * Helper method - priority occupation of this component
- */
- private void priorityOccupation(String occupier) {
- // Occupy component if component is FREE or OCCUPIED
- if ((this.getOccupationState().equals(OccupationState.FREE)) || (this.getOccupationState().equals(OccupationState.OCCUPIED))) {
- this.setLastOccupierID(this.getOccupierID());
- this.setOccupierID(occupier);
- this.setOccupationState(OccupationState.PRIORITY);
- }
- }
-
-
- /**
- * Helper method - local overwrite of OCCUPIED or PRIORITY occupation
- */
- private void invokeLocalOverwrite() {
- // Store current occupier because we need to restore it later
- savedOccupierID = this.getOccupierID();
-
- // Enter local overwrite state
- this.setOccupationState(OccupationState.LOCAL);
- this.setOccupierID("LOCAL");
- }
-
-
- /**
- * Helper method - clear local occupier overwrite status
- */
- private void clearLocalOverwrite() {
- // Restore current occupier ID
- this.setOccupierID(savedOccupierID);
-
- // Restore occupier state based on variables
- if (this.getOccupierID().isEmpty()) this.setOccupationState(OccupationState.FREE); else
- if (this.getLastOccupierID().isEmpty()) this.setOccupationState(OccupationState.OCCUPIED); else
- this.setOccupationState(OccupationState.PRIORITY);
- }
-
-
- /**
- * Change execution state based on execution order
- */
- private void changeExecutionState(String orderString) {
- // Do not react on empty values
- if (orderString.isEmpty()) return;
-
- // Get execution order based on order string
- ExecutionOrder order = ExecutionOrder.byValue(orderString);
-
- // Check if execution order leads to valid state in current state
- switch(getExecutionState().toLowerCase()) {
- case "idle":
- // Process expected orders
- if (order.equals(ExecutionOrder.START)) {this.setExecutionState(ExecutionState.STARTING.getValue()); break;}
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "starting":
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "execute":
- // Process expected orders
- if (order.equals(ExecutionOrder.COMPLETE)) {this.setExecutionState(ExecutionState.COMPLETING.getValue()); break;}
- if (order.equals(ExecutionOrder.HOLD)) {this.setExecutionState(ExecutionState.HOLDING.getValue()); break;}
- if (order.equals(ExecutionOrder.SUSPEND)) {this.setExecutionState(ExecutionState.SUSPENDING.getValue()); break;}
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "completing":
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "complete":
- if (order.equals(ExecutionOrder.RESET)) {this.setExecutionState(ExecutionState.RESETTING.getValue()); break;}
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "resetting":
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "holding":
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "held":
- if (order.equals(ExecutionOrder.UNHOLD)) {this.setExecutionState(ExecutionState.UNHOLDING.getValue()); break;}
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "unholding":
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "suspending":
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "suspended":
- if (order.equals(ExecutionOrder.UNSUSPEND)) {this.setExecutionState(ExecutionState.UNSUSPENDING.getValue()); break;}
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "unsuspending":
- if (order.equals(ExecutionOrder.STOP)) {this.setExecutionState(ExecutionState.STOPPING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "stopping":
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "stopped":
- if (order.equals(ExecutionOrder.RESET)) {this.setExecutionState(ExecutionState.RESETTING.getValue()); break;}
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "aborted":
- if (order.equals(ExecutionOrder.CLEAR)) {this.setExecutionState(ExecutionState.CLEARING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- case "clearing":
- if (order.equals(ExecutionOrder.ABORT)) {this.setExecutionState(ExecutionState.ABORTING.getValue()); break;}
- // Unexpected order in this state
- throw new RuntimeException("Unexpected command "+orderString+" in state "+getExecutionState());
-
- // Received order in unexpected state
- default:
- // Indicate error
- throw new RuntimeException("Unexpected order "+orderString+" in state "+getExecutionState());
- }
- }
-
-
- /**
- * Finish current execution state (execute 'SC' order). This only works in transition states
- */
- public void finishState() {
- // Check if state complete message leads to valid state in current state
- switch(getExecutionState().toLowerCase()) {
- // Process state changes
- case "starting": this.setExecutionState(ExecutionState.EXECUTE.getValue()); break;
- case "execute": this.setExecutionState(ExecutionState.COMPLETING.getValue()); break;
- case "completing": this.setExecutionState(ExecutionState.COMPLETE.getValue()); break;
- case "resetting": this.setExecutionState(ExecutionState.IDLE.getValue()); break;
- case "holding": this.setExecutionState(ExecutionState.HELD.getValue()); break;
- case "unholding": this.setExecutionState(ExecutionState.EXECUTE.getValue()); break;
- case "suspending": this.setExecutionState(ExecutionState.SUSPENDED.getValue()); break;
- case "unsuspending": this.setExecutionState(ExecutionState.EXECUTE.getValue()); break;
- case "stopping": this.setExecutionState(ExecutionState.STOPPED.getValue()); break;
- case "stopped": this.setExecutionState(ExecutionState.IDLE.getValue()); break;
- case "aborting": this.setExecutionState(ExecutionState.ABORTED.getValue()); break;
- case "clearing": this.setExecutionState(ExecutionState.STOPPED.getValue()); break;
-
- // Received order in unexpected state
- default:
- // Indicate error
- throw new RuntimeException("Unexpected state complete order in state "+getExecutionState());
- }
- }
-
-
- /**
- * Get order list
- */
- @SuppressWarnings("unchecked")
- public List<String> getOrderList() {
- // Get map entry
- return (List<String>) get("orderList");
- }
-
-
- /**
- * Add order to order list
- */
- @SuppressWarnings("unchecked")
- public void addOrder(String newOrder) {
- // Get map entry
- ((List<String>) get("orderList")).add(newOrder);
- }
-
-
- /**
- * Clear order list
- */
- @SuppressWarnings("unchecked")
- public void clearOrder() {
- // Get map entry
- ((List<String>) get("orderList")).clear();
- }
-
-
- /**
- * Get occupation state
- */
- public OccupationState getOccupationState() {
- // Return occupation state
- return OccupationState.byValue((Integer) status.get("occupationState"));
- }
-
-
- /**
- * Set occupation state
- */
- public void setOccupationState(OccupationState occSt) {
- // Update occupation state
- status.put("occupationState ", occSt.getValue());
- }
-
-
- /**
- * Get occupier ID
- */
- public String getOccupierID() {
- // If occupier is not set, a null pointer Exception will be thrown when invoking toString(). Return an empty string in this case (=no occupier)
- try {return status.get("occupier").toString();} catch (NullPointerException e) {return "";}
- }
-
-
- /**
- * Set occupier ID
- */
- public void setOccupierID(String occId) {
- status.put("occupier", occId);
- }
-
-
- /**
- * Get last occupier ID
- */
- public String getLastOccupierID() {
- // If member is not set, a null pointer Exception will be thrown when invoking toString(). Return an empty string in this case (=no occupier)
- try {return status.get("lastOccupier").toString();} catch (NullPointerException e) {return "";}
- }
-
-
- /**
- * Set last occupier ID
- */
- public void setLastOccupierID(String occId) {
- status.put("lastOccupier", occId);
- }
-
-
- /**
- * Get execution mode
- */
- public ExecutionMode getExecutionMode() {
- // Return execution mode
- return ExecutionMode.byValue((Integer) status.get("exMode"));
- }
-
-
- /**
- * Set execution mode
- */
- public void setExecutionMode(ExecutionMode exMode) {
- // Return execution mode
- status.put("exMode", exMode.getValue());
- }
-
-
- /**
- * Get execution state
- */
- public String getExecutionState() {
- // If member is not set, a null pointer Exception will be thrown when invoking toString(). Return an empty string in this case (=no occupier)
- try {return status.get("exState").toString();} catch (NullPointerException e) {return "";}
- }
-
-
- /**
- * Set execution state
- */
- public void setExecutionState(String newSt) {
- // Change execution state
- status.put("exState", newSt);
- }
-
-
- /**
- * Get operation mode
- */
- public String getOperationMode() {
- // If member is not set, a null pointer Exception will be thrown when invoking toString(). Return an empty string in this case (=no occupier)
- try {return status.get("opMode").toString();} catch (NullPointerException e) {return "";}
- }
-
-
- /**
- * Set operation mode
- */
- public void setOperationMode(String opMode) {
- // Change operation mode
- status.put("opMode", opMode);
- }
-
-
- /**
- * Get work state
- */
- public String getWorkState() {
- // If member is not set, a null pointer Exception will be thrown when invoking toString(). Return an empty string in this case (=no occupier)
- try {return status.get("workState").toString();} catch (NullPointerException e) {return "";}
- }
-
-
- /**
- * Set work state
- */
- public void setWorkState(String workState) {
- // Change work state
- status.put("workState", workState);
- }
-
-
- /**
- * Get error state
- */
- public String getErrorState() {
- // If member is not set, a null pointer Exception will be thrown when invoking toString(). Return an empty string in this case (=no occupier)
- try {return status.get("errorState").toString();} catch (NullPointerException e) {return "";}
- }
-
-
- /**
- * Set error state
- */
- public void setErrorState(String errorState) {
- // Change error state
- status.put("errorState", errorState);
- }
-
-
- /**
- * Get last error state
- */
- public String getLastErrorState() {
- // If member is not set, a null pointer Exception will be thrown when invoking toString(). Return an empty string in this case (=no occupier)
- try {return status.get("prevError").toString();} catch (NullPointerException e) {return "";}
- }
-
-
- /**
- * Set last error state
- */
- public void setLastErrorState(String lastErrorState) {
- // Change last error state
- status.put("prevError", lastErrorState);
- }
-
-
-
- /**
- * Get last command
- */
- public String getCommand() {
- // If member is not set, a null pointer Exception will be thrown when invoking toString(). Return an empty string in this case (=no occupier)
- try {return get("cmd").toString();} catch (NullPointerException e) {return "";}
- }
-
-
- /**
- * Set command
- */
- public void setCommand(String cmd) {
- // Change last command
- put("cmd", cmd);
- }
-
-
- /**
- * Get local overwrite variable
- */
- public String getLocalOverwrite() {
- // If member is not set, a null pointer Exception will be thrown when invoking toString(). Return an empty string in this case (=no occupier)
- try {return get("localOverwrite").toString();} catch (NullPointerException e) {return "";}
- }
-
-
- /**
- * Set local overwrite variable
- */
- public void setLocalOverwrite(String cmd) {
- // Change local overwrite command
- put("localOverwrite", cmd);
- }
-
-
- /**
- * Get local overwrite free variable
- */
- public String getLocalOverwriteFree() {
- // If member is not set, a null pointer Exception will be thrown when invoking toString(). Return an empty string in this case (=no occupier)
- try {return get("localOverwriteFree").toString();} catch (NullPointerException e) {return "";}
- }
-
-
- /**
- * Set local overwrite free variable
- */
- public void setLocalOverwriteFree(String cmd) {
- // Change local overwrite free command
- put("localOverwriteFree", cmd);
- }
-}
-
-
diff --git a/examples/basys.examples/src/basys/examples/deployment/controlComponent/ExecutionMode.java b/examples/basys.examples/src/basys/examples/deployment/controlComponent/ExecutionMode.java
deleted file mode 100644
index 3d82a67..0000000
--- a/examples/basys.examples/src/basys/examples/deployment/controlComponent/ExecutionMode.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package basys.examples.deployment.controlComponent;
-
-
-/**
- * Execution mode enum
- *
- * @author kuhn
- *
- */
-public enum ExecutionMode {
- // Enumeration constants
- AUTO(1), SEMIAUTO(2), MANUAL(3), RESERVED(4), SIMULATION(5);
-
-
-
- /**
- * Get OccupationState by its value
- */
- public static ExecutionMode byValue(int value) {
- // Switch by requested value
- switch (value) {
- case 1: return AUTO;
- case 2: return SEMIAUTO;
- case 3: return MANUAL;
- case 4: return RESERVED;
- case 5: return SIMULATION;
- }
-
- // Indicate error
- throw new RuntimeException("Unknown value requested");
- }
-
-
-
-
- /**
- * Enumeration item value
- */
- protected int value = -1;
-
-
-
- /**
- * Constructor
- */
- private ExecutionMode(int val) {
- this.value = val;
- }
-
-
- /**
- * Get enumeration value
- */
- public int getValue() {
- return value;
- }
-}
diff --git a/examples/basys.examples/src/basys/examples/deployment/controlComponent/ExecutionOrder.java b/examples/basys.examples/src/basys/examples/deployment/controlComponent/ExecutionOrder.java
deleted file mode 100644
index de9a8aa..0000000
--- a/examples/basys.examples/src/basys/examples/deployment/controlComponent/ExecutionOrder.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package basys.examples.deployment.controlComponent;
-
-
-/**
- * Execution order enum
- *
- * @author kuhn
- *
- */
-public enum ExecutionOrder {
- // Enumeration constants
- START("START"), COMPLETE("COMPLETE"), RESET("RESET"), HOLD("HOLD"), UNHOLD("UNHOLD"), SUSPEND("SUSPEND"), UNSUSPEND("UNSUSPEND"), CLEAR("CLEAR"), STOP("STOP"), ABORT("ABORT");
-
-
-
- /**
- * Get execution order by its value
- */
- public static ExecutionOrder byValue(String value) {
- // Switch by requested value
- switch (value.toLowerCase()) {
- case "start": return START;
- case "complete": return COMPLETE;
- case "reset": return RESET;
- case "hold": return HOLD;
- case "unhold": return UNHOLD;
- case "suspend": return SUSPEND;
- case "unsuspend": return UNSUSPEND;
- case "clear": return CLEAR;
- case "stop": return STOP;
- case "abort": return ABORT;
- }
-
- // Indicate error
- throw new RuntimeException("Unknown value requested:"+value.toLowerCase());
- }
-
-
-
-
- /**
- * Enumeration item value
- */
- protected String value = null;
-
-
-
- /**
- * Constructor
- */
- private ExecutionOrder(String val) {
- this.value = val;
- }
-
-
- /**
- * Get enumeration value
- */
- public String getValue() {
- return value;
- }
-}
diff --git a/examples/basys.examples/src/basys/examples/deployment/controlComponent/ExecutionState.java b/examples/basys.examples/src/basys/examples/deployment/controlComponent/ExecutionState.java
deleted file mode 100644
index fc0810d..0000000
--- a/examples/basys.examples/src/basys/examples/deployment/controlComponent/ExecutionState.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package basys.examples.deployment.controlComponent;
-
-
-/**
- * Execution state enum
- *
- * @author kuhn
- *
- */
-public enum ExecutionState {
- // Enumeration constants
- IDLE("IDLE"), STARTING("STARTING"), EXECUTE("EXECUTE"), COMPLETING("COMPLETING"), COMPLETE("COMPLETE"), RESETTING("RESETTING"), HOLDING("HOLDING"), HELD("HELD"), UNHOLDING("UNHOLDING"),
- SUSPENDING("SUSPENDING"), SUSPENDED("SUSPENDED"), UNSUSPENDING("UNSUSPENDING"), STOPPING("STOPPING"), STOPPED("STOPPED"), ABORTING("ABORTING"), ABORTED("ABORTED"), CLEARING("CLEARING");
-
-
-
- /**
- * Get execution order by its value
- */
- public static ExecutionState byValue(String value) {
- // Switch by requested value
- switch (value.toLowerCase()) {
- case "idle": return IDLE;
- case "starting": return STARTING;
- case "execute": return EXECUTE;
- case "completing": return COMPLETING;
- case "complete": return COMPLETE;
- case "resetting": return RESETTING;
- case "holding": return HOLDING;
- case "held": return HELD;
- case "unholding": return UNHOLDING;
- case "suspending": return SUSPENDING;
- case "suspended": return SUSPENDED;
- case "unsuspending": return UNSUSPENDING;
- case "stopping": return STOPPING;
- case "stopped": return STOPPED;
- case "aborting": return ABORTING;
- case "aborted": return ABORTED;
- case "clearing": return CLEARING;
- }
-
- // Indicate error
- throw new RuntimeException("Unknown value requested");
- }
-
-
-
-
- /**
- * Enumeration item value
- */
- protected String value = null;
-
-
-
- /**
- * Constructor
- */
- private ExecutionState(String val) {
- this.value = val;
- }
-
-
- /**
- * Get enumeration value
- */
- public String getValue() {
- return value;
- }
-}
diff --git a/examples/basys.examples/src/basys/examples/deployment/controlComponent/OccupationState.java b/examples/basys.examples/src/basys/examples/deployment/controlComponent/OccupationState.java
deleted file mode 100644
index 09f5c7a..0000000
--- a/examples/basys.examples/src/basys/examples/deployment/controlComponent/OccupationState.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package basys.examples.deployment.controlComponent;
-
-
-/**
- * Occupation state enum
- *
- * @author kuhn
- *
- */
-public enum OccupationState {
- // Enumeration constants
- FREE(0), OCCUPIED(1), PRIORITY(2), LOCAL(3);
-
-
-
- /**
- * Get OccupationState by its value
- */
- public static OccupationState byValue(int value) {
- // Switch by requested value
- switch (value) {
- case 0: return FREE;
- case 1: return OCCUPIED;
- case 2: return PRIORITY;
- case 3: return LOCAL;
- }
-
- // Indicate error
- throw new RuntimeException("Unknown value requested");
- }
-
-
-
-
- /**
- * Enumeration item value
- */
- protected int value = -1;
-
-
-
- /**
- * Constructor
- */
- private OccupationState(int val) {
- this.value = val;
- }
-
-
- /**
- * Get enumeration value
- */
- public int getValue() {
- return value;
- }
-}
diff --git a/examples/basys.examples/src/basys/examples/example/BaSyxExample.java b/examples/basys.examples/src/basys/examples/example/BaSyxExample.java
deleted file mode 100644
index addc042..0000000
--- a/examples/basys.examples/src/basys/examples/example/BaSyxExample.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package basys.examples.example;
-
-import java.util.function.Supplier;
-
-
-
-/**
- * Base class for all BaSyx examples
- *
- * @author kuhn
- */
-public class BaSyxExample {
-
-
-
- /**
- * Wait for a condition
- */
- protected void waitfor(Supplier<Boolean> function) {
- while (!function.get()) Thread.yield();
- }
-}
diff --git a/examples/basys.examples/src/basys/examples/frontend/client/connmanager/BaSysConnectionManager.java b/examples/basys.examples/src/basys/examples/frontend/client/connmanager/BaSysConnectionManager.java
deleted file mode 100644
index d7c60a1..0000000
--- a/examples/basys.examples/src/basys/examples/frontend/client/connmanager/BaSysConnectionManager.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package basys.examples.frontend.client.connmanager;
-
-import org.eclipse.basyx.vab.core.IConnectorProvider;
-import org.eclipse.basyx.vab.core.IDirectoryService;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
-import org.eclipse.basyx.vab.core.tools.VABPathTools;
-
-
-
-
-
-/**
- * Connection manager that creates BaSys specific connections on request
- *
- * @author kuhn
- *
- */
-public class BaSysConnectionManager extends VABConnectionManager {
-
-
- /**
- * Constructor
- *
- * @param networkDirectoryService Directory service provider
- * @param providerProvider Connection provider
- */
- public BaSysConnectionManager(IDirectoryService networkDirectoryService, IConnectorProvider providerProvider) {
- // Invoke base constructor
- super(networkDirectoryService, providerProvider);
- }
-
-
-
- /**
- * Connect to an model provider server
- *
- * Model provider servers are network repositories that store models and enable access to them.
- *
- * @param urn the URN that describes the model provider server
- */
- public ModelServerProxy connectToModelServer(String urn) {
- // Get AAS from directory
- String addr = null;
-
- // Lookup address in directory server
- addr = directoryService.lookup(urn);
-
- // Return a new ModelServerProxy
- return new ModelServerProxy(VABPathTools.removeAddressEntry(addr), addr, providerProvider.getConnector(addr));
- }
-
-
- /**
- * Connect to an model provider server through a provided URL
- *
- * @param url to model provider server
- */
- public ModelServerProxy connectToModelServerURL(String url) {
- // Return a new ModelServerProxy
- return new ModelServerProxy(VABPathTools.removeAddressEntry(url), url, providerProvider.getConnector(url));
- }
-}
-
diff --git a/examples/basys.examples/src/basys/examples/frontend/client/connmanager/ModelServerProxy.java b/examples/basys.examples/src/basys/examples/frontend/client/connmanager/ModelServerProxy.java
deleted file mode 100644
index c1cf9cd..0000000
--- a/examples/basys.examples/src/basys/examples/frontend/client/connmanager/ModelServerProxy.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package basys.examples.frontend.client.connmanager;
-
-import java.util.HashMap;
-
-import org.eclipse.basyx.vab.core.IModelProvider;
-import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
-
-import basys.examples.aasdescriptor.ModelUrn;
-
-
-
-/**
- * Proxy class for connecting to a model server.
- *
- * Model servers provide static data models to the VAB. this class hides the nasty details to communicate via VAB primitives with model servers.
- *
- * @author kuhn
- *
- */
-public class ModelServerProxy extends VABElementProxy {
-
-
- /**
- * Full address with qualifier.
- */
- protected String fullQualifiedAddr = null;
-
-
-
- /**
- * Constructor
- *
- * @param addr Address
- * @param provider Provider reference
- */
- public ModelServerProxy(String addr, String fullAddr, IModelProvider provider) {
- // Invoke base constructor
- super(addr, provider);
-
- // Store qualified address
- fullQualifiedAddr = fullAddr;
- }
-
-
-
-
- /**
- * Push model to model repository
- */
- public void pushToServer(ModelUrn modelID, HashMap<String, Object> model) {
- // Model URL on server
- String modelURLOnServer = "/aas/submodels/aasRepository/"+modelID.getEncodedURN();
-
- // Transfer model to server
- this.createElement(modelURLOnServer, model);
- }
-
-
- /**
- * Push model to model repository
- */
- public void pushToServer(String modelIDRaw, HashMap<String, Object> model) {
- // Push to server
- pushToServer(new ModelUrn(modelIDRaw), model);
- }
-
-
-
-
- /**
- * Get URL to model on server
- */
- public String getURLToModel(ModelUrn modelID) {
- // Return address on server
- return this.fullQualifiedAddr+"/aas/submodels/aasRepository/"+modelID.getEncodedURN();
- }
-
-
- /**
- * Get URL to model on server
- */
- public String getURLToModel(String modelIDRaw) {
- // Return address on server
- return getURLToModel(new ModelUrn(modelIDRaw));
- }
-
-
-
-
- /**
- * Update model element value on server
- */
- public void updateElementValue(ModelUrn modelID, String elementPath, Object newValue) {
- // Build URL
- String modelURLOnServer = "/aas/submodels/aasRepository/"+modelID.getEncodedURN();
-
- // Invoke base function
- updateElementValue(modelURLOnServer+elementPath, newValue);
- }
-
-
- /**
- * Update model element value on server
- */
- public void updateElementValue(String modelIDRaw, String elementPath, Object newValue) {
- updateElementValue(new ModelUrn(modelIDRaw), elementPath, newValue);
- }
-
-
-
-
- /**
- * Read model element value
- */
- public Object readElementValue(ModelUrn modelID, String elementPath) {
- // Build URL
- String modelURLOnServer = "/aas/submodels/aasRepository/"+modelID.getEncodedURN();
-
- // Invoke base function
- return readElementValue(modelURLOnServer+elementPath);
- }
-
-
- /**
- * Read model element value
- */
- public Object readElementValue(String modelIDRaw, String elementPath) {
- return readElementValue(new ModelUrn(modelIDRaw), elementPath);
- }
-
-
-
-
- /**
- * Create model element
- */
- public void createElement(ModelUrn modelID, String elementPath, Object newValue) {
- // Build URL
- String modelURLOnServer = "/aas/submodels/aasRepository/"+modelID.getEncodedURN();
-
- // Invoke base function
- createElement(modelURLOnServer+elementPath, newValue);
- }
-
-
- /**
- * Create model element
- */
- public void createElement(String modelIDRaw, String elementPath, Object newValue) {
- createElement(new ModelUrn(modelIDRaw), elementPath, newValue);
- }
-
-
-
-
- /**
- * Delete model element based on path
- */
- public void deleteElement(ModelUrn modelID, String elementPath) {
- // Build URL
- String modelURLOnServer = "/aas/submodels/aasRepository/"+modelID.getEncodedURN();
-
- // Invoke base function
- deleteElement(modelURLOnServer+elementPath);
- }
-
-
- /**
- * Delete model element based on path
- */
- public void deleteElement(String modelIDRaw, String elementPath) {
- deleteElement(new ModelUrn(modelIDRaw), elementPath);
- }
-
-
-
-
- /**
- * Delete model element based on path and value
- */
- public void deleteElement(ModelUrn modelID, String elementPath, Object value) {
- // Build URL
- String modelURLOnServer = "/aas/submodels/aasRepository/"+modelID.getEncodedURN();
-
- // Invoke base function
- deleteElement(modelURLOnServer+elementPath, value);
- }
-
-
- /**
- * Delete model element based on path and value
- */
- public void deleteElement(String modelIDRaw, String elementPath, Object value) {
- deleteElement(new ModelUrn(modelIDRaw), elementPath, value);
- }
-}
-
diff --git a/examples/basys.examples/src/basys/examples/frontend/client/proxies/AASRegistryProxy.java b/examples/basys.examples/src/basys/examples/frontend/client/proxies/AASRegistryProxy.java
deleted file mode 100644
index af54bcd..0000000
--- a/examples/basys.examples/src/basys/examples/frontend/client/proxies/AASRegistryProxy.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package basys.examples.frontend.client.proxies;
-
-import java.net.URLEncoder;
-import java.util.Map;
-
-import org.eclipse.basyx.aas.backend.http.tools.GSONTools;
-import org.eclipse.basyx.aas.backend.http.tools.factory.DefaultTypeFactory;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
-import basys.examples.aasdescriptor.AASDescriptor;
-import basys.examples.aasdescriptor.ModelUrn;
-
-
-
-
-/**
- * Local proxy class that hides HTTP calls to BaSys registry
- *
- * @author kuhn
- *
- */
-public class AASRegistryProxy {
-
-
- /**
- * Store AAS registry URL
- */
- protected String aasRegistryURL = null;
-
-
- /**
- * Invoke BaSyx service calls via web services
- */
- protected WebServiceRawClient client = null;
-
-
- /**
- * JSON serializer
- */
- protected GSONTools serializer = null;
-
-
-
-
-
- /**
- * Constructor
- */
- public AASRegistryProxy(String aasRegURL) {
- // Store URL
- aasRegistryURL = aasRegURL;
-
- // Create web service client
- client = new WebServiceRawClient();
-
- // Create serializer
- serializer = new GSONTools(new DefaultTypeFactory());
- }
-
-
- /**
- * Register AAS descriptor in registry
- */
- public void register(AASDescriptor deviceAASDescriptor) {
- // Perform web service call to registry
- client.post(aasRegistryURL+"/api/v1/registry", serializer.getJsonString(serializer.serialize(deviceAASDescriptor)));
- }
-
-
- /**
- * Delete AAS descriptor from registry
- */
- public void delete(ModelUrn aasID) {
- // - Instantiate web service client
- //WebServiceRawClient client = new WebServiceRawClient();
- // - Invoke delete operation of AAS registry
- client.delete(aasRegistryURL+"/api/v1/registry/"+URLEncoder.encode(aasID.getURN()));
- }
-
-
- /**
- * Lookup device AAS
- */
- @SuppressWarnings("unchecked")
- public AASDescriptor lookup(ModelUrn aasID) {
- // Lookup AAS from AAS directory, get AAS descriptor
- String jsonData = client.get(aasRegistryURL+"/api/v1/registry/"+aasID.getEncodedURN());
-
- // Deserialize AAS descriptor
- AASDescriptor aasDescriptor = new AASDescriptor((Map<String, Object>) serializer.deserialize(serializer.getMap(serializer.getObjFromJsonStr(jsonData))));
-
- // Return AAS descriptor
- return aasDescriptor;
- }
-}
-
diff --git a/examples/basys.examples/src/basys/examples/tools/BaSyxManagerComponent.java b/examples/basys.examples/src/basys/examples/tools/BaSyxManagerComponent.java
deleted file mode 100644
index c23a9f8..0000000
--- a/examples/basys.examples/src/basys/examples/tools/BaSyxManagerComponent.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package basys.examples.tools;
-
-import basys.examples.deployment.BaSyxContextRunnable;
-
-/**
- * Base class for stand alone device managers that connect legacy devices with BaSyx. This component runs
- * for example in interface devices.
- *
- * @author kuhn
- *
- */
-public abstract class BaSyxManagerComponent implements BaSyxContextRunnable {
-
-
- /**
- * Flag that indicates the request for ending the execution
- */
- protected boolean endExecution = false;
-
-
- /**
- * Store device name
- */
- protected String deviceName = null;
-
-
-
-
-
-
- /**
- * Indicate change of end execution flag
- */
- protected void onEndExecutionChanged(boolean endExecutionFlag) {
- // Default implementation does nothing
- }
-
-
- /**
- * End the execution of this BaSyx manager
- */
- public void endExecution() {
- // Change flag
- endExecution = true;
-
- // Signal flag change
- onEndExecutionChanged(endExecution);
- }
-
-
- /**
- * Run this manager
- */
- @Override
- public void start() {
- // Do nothing
- }
-
-
- /**
- * Stop this manager
- */
- @Override
- public void stop() {
- // End execution of this BaSyx manager
- endExecution();
- }
-
-
- /**
- * Change the runnable name
- */
- @Override
- public BaSyxContextRunnable setName(String newName) {
- // Set name
- deviceName = newName;
-
- // Return 'this' reference to enable chaining
- return this;
- }
-
-
- /**
- * Get runnable name
- */
- @Override
- public String getName() {
- return deviceName;
- }
-}
-
diff --git a/examples/basys.examples/support/examples/directory/ExamplesDirectory.java b/examples/basys.examples/support/examples/directory/ExamplesDirectory.java
deleted file mode 100644
index 9462c87..0000000
--- a/examples/basys.examples/support/examples/directory/ExamplesDirectory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package examples.directory;
-
-import org.eclipse.basyx.testsuite.support.backend.common.stubs.java.directory.TestsuiteDirectory;
-
-
-
-
-/**
- * Implement the test suite directory service with pre-configured directory entries
- *
- * @author kuhn
- *
- */
-public class ExamplesDirectory extends TestsuiteDirectory {
-
-
- /**
- * Constructor - load all directory entries
- */
- public ExamplesDirectory() {
- // Populate with entries from base implementation
- super();
-
- // Define mappings
- // - AAS server mapping
- //addMapping("AASServer", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/aasserver/");
- addMapping("AASServer", "http://localhost:8080/basys.examples/Components/BaSys/1.0/aasServer/");
- }
-}