Seperate AAS-Directory and VAB Directory; remove VABConnectionMnager from ConnectedAssetAdministrationShellManager
Change-Id: Ic8e020adde6ac95e47ff0caf85e1c30b2434cd66
Signed-off-by: Zai Zhang <zai.zhang@iese.fraunhofer.de>
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/components/configuration/CFGBaSyxConnection.java b/components/basys.components/src/main/java/org/eclipse/basyx/components/configuration/CFGBaSyxConnection.java
index 2a92d6e..e112d04 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/components/configuration/CFGBaSyxConnection.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/components/configuration/CFGBaSyxConnection.java
@@ -1,7 +1,7 @@
package org.eclipse.basyx.components.configuration;
import org.eclipse.basyx.vab.core.IConnectorProvider;
-import org.eclipse.basyx.vab.core.IDirectoryService;
+import org.eclipse.basyx.vab.core.IVABDirectoryService;
@@ -78,14 +78,14 @@
/**
* Instantiate the directory class
*/
- public IDirectoryService createDirectoryInstance() {
+ public IVABDirectoryService createDirectoryInstance() {
// Try to create instance
try {
// Get Java class by name
Class<?> clazz = Class.forName(directoryProviderName);
// Instantiate class
- IDirectoryService directoryService = (IDirectoryService) clazz.newInstance();
+ IVABDirectoryService directoryService = (IVABDirectoryService) clazz.newInstance();
// Return directory service instance
return directoryService;
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/components/configuration/builder/BaSyxServiceConfigurationBuilder.java b/components/basys.components/src/main/java/org/eclipse/basyx/components/configuration/builder/BaSyxServiceConfigurationBuilder.java
index b56eb55..91cb9f4 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/components/configuration/builder/BaSyxServiceConfigurationBuilder.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/components/configuration/builder/BaSyxServiceConfigurationBuilder.java
@@ -1,10 +1,12 @@
package org.eclipse.basyx.components.configuration.builder;
+import org.eclipse.basyx.aas.api.registry.AASHTTPRegistryProxy;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
+import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
import org.eclipse.basyx.components.configuration.CFGBaSyxProtocolType;
import org.eclipse.basyx.components.configuration.ConfigurableComponent;
-import org.eclipse.basyx.components.proxy.registry.AASHTTPRegistryProxy;
-import org.eclipse.basyx.components.proxy.registry.AASRegistryProxyIF;
+import org.eclipse.basyx.vab.core.IVABDirectoryService;
import org.eclipse.basyx.vab.core.VABConnectionManager;
@@ -29,7 +31,7 @@
*/
protected CFGBaSyxProtocolType protocoltype = null;
-
+ protected IVABDirectoryService vabDirectory = null;
/**
@@ -58,7 +60,7 @@
/**
* Create registry instance based on configuration
*/
- public AASRegistryProxyIF getRegistry() {
+ public IAASRegistryService getRegistry() {
// Create and return registry
return new AASHTTPRegistryProxy(registryURL);
}
@@ -78,11 +80,31 @@
}
/**
+ * Set VAB Directory
+ */
+ @SuppressWarnings("unchecked")
+ public T directoryService(IVABDirectoryService vabDirectory) {
+ // Store VAB directory
+ this.vabDirectory = vabDirectory;
+
+ // Return 'this' Refence
+ return (T) this;
+ }
+
+ /**
* Create connection manager based on configuration
*/
public VABConnectionManager getConnectionManager() {
// Create and return VABConnectionManager
- return new VABConnectionManager(getRegistry(), new HTTPConnectorProvider());
+ return new VABConnectionManager(vabDirectory, new HTTPConnectorProvider());
+ }
+
+ /**
+ * Create connected AAS-manager based on configuration
+ */
+ public ConnectedAssetAdministrationShellManager getConnetedAASManager() {
+ // Create and return connected AAS-manager
+ return new ConnectedAssetAdministrationShellManager(getRegistry(), new HTTPConnectorProvider());
}
}
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/components/devicemanager/DeviceManagerComponent.java b/components/basys.components/src/main/java/org/eclipse/basyx/components/devicemanager/DeviceManagerComponent.java
index c415697..e59dcf4 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/components/devicemanager/DeviceManagerComponent.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/components/devicemanager/DeviceManagerComponent.java
@@ -1,10 +1,10 @@
package org.eclipse.basyx.components.devicemanager;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
import org.eclipse.basyx.components.service.BaseBaSyxService;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.aasdescriptor.SubmodelDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.core.tools.VABPathTools;
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/components/directory/SQLDirectoryProvider.java b/components/basys.components/src/main/java/org/eclipse/basyx/components/directory/SQLDirectoryProvider.java
index bb4a5a9..14a61ad 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/components/directory/SQLDirectoryProvider.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/components/directory/SQLDirectoryProvider.java
@@ -15,8 +15,8 @@
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.descriptor.AASDescriptor;
import org.eclipse.basyx.components.sqlprovider.driver.SQLDriver;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
import org.eclipse.basyx.vab.core.IModelProvider;
/**
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/components/processengine/connector/DeviceServiceExecutor.java b/components/basys.components/src/main/java/org/eclipse/basyx/components/processengine/connector/DeviceServiceExecutor.java
index bc4b3bb..dcfbe5b 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/components/processengine/connector/DeviceServiceExecutor.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/components/processengine/connector/DeviceServiceExecutor.java
@@ -3,14 +3,16 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
+import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
import org.eclipse.basyx.aas.api.resources.IOperation;
import org.eclipse.basyx.aas.api.resources.IProperty;
import org.eclipse.basyx.aas.api.resources.ISingleProperty;
import org.eclipse.basyx.aas.api.resources.ISubModel;
import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.aas.backend.connected.aas.ConnectedSubModel;
-import org.eclipse.basyx.components.service.BaseBaSyxService;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
+import org.eclipse.basyx.vab.core.IConnectorProvider;
/**
@@ -20,7 +22,7 @@
*
* @author Zhang, Zai
* */
-public abstract class DeviceServiceExecutor extends BaseBaSyxService implements IDeviceServiceExecutor {
+public abstract class DeviceServiceExecutor implements IDeviceServiceExecutor {
protected ConnectedAssetAdministrationShellManager manager;
@@ -29,19 +31,33 @@
* private constructor
* create the connected administration shell for data exchange
* */
- public DeviceServiceExecutor(VABConnectionManager connectionmanager) {
- setConnectionManager(connectionmanager);
+ public DeviceServiceExecutor(IAASRegistryService registry, IConnectorProvider provider) {
+
//set-up the administration shell manager to create connected aas
- manager = new ConnectedAssetAdministrationShellManager(connectionmanager);
+ manager = new ConnectedAssetAdministrationShellManager(registry, provider);
};
+ public DeviceServiceExecutor(ConnectedAssetAdministrationShellManager manager) {
+
+ // set-up the administration shell manager to create connected aas
+ this.manager = manager;
+ };
+
/**
* Synchronous invocation the expected service specified by the BPMN-model
* */
+ @Override
public Object executeService( String servicename, String serviceProvider, String submodelid, List<Object> params) {
try {
+ // create Model urn
+ ModelUrn aasUrn = new ModelUrn(serviceProvider);
+
+ // create the connected AAS using the manager
+ IAssetAdministrationShell connectedAAS = manager.retrieveAAS(aasUrn);
+
// create the submodel of the corresponding aas
- ISubModel serviceSubmodel = manager.retrieveSM(submodelid);
+ ISubModel serviceSubmodel = manager.retrieveSM(submodelid, aasUrn);
+
// navigate to the expected service
Map<String, IOperation> operations = serviceSubmodel.getOperations();
IOperation op = operations.get(servicename);
@@ -62,9 +78,12 @@
/**
* Get value of a property from a submodel
* */
- protected Object getProperty(String submodelid, String propertyName) throws Exception {
+ protected Object getProperty(String rawUrn, String submodelid, String propertyName) throws Exception {
+ // create Model urn
+ ModelUrn aasUrn = new ModelUrn(rawUrn);
+
// retrieve submodel with id
- ISubModel statusSubmodel = manager.retrieveSM(submodelid);
+ ISubModel statusSubmodel = manager.retrieveSM(submodelid, aasUrn);
// get properties of the submodel
Map<String, IProperty> properties = ((ConnectedSubModel) statusSubmodel).getProperties();
@@ -115,6 +134,4 @@
@Override
public abstract Object executeService(String serviceName, String deviceid, List<Object> params) throws Exception ;
-
-
}
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/components/processengine/connector/IDeviceServiceExecutor.java b/components/basys.components/src/main/java/org/eclipse/basyx/components/processengine/connector/IDeviceServiceExecutor.java
index 214db23..982d0cb 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/components/processengine/connector/IDeviceServiceExecutor.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/components/processengine/connector/IDeviceServiceExecutor.java
@@ -3,6 +3,16 @@
import java.util.List;
public interface IDeviceServiceExecutor {
+
+ /**
+ *
+ * @param servicename - name of the operation in the aas
+ * @param serviceProvider - raw urn of the device aas
+ * @param submodelid - id of the sub-model for asscess
+ * @param params - parameters needed by the operation in list
+ * @return - return number if operation is executed succesfully
+ * @throws Exception
+ */
public Object executeService( String servicename, String serviceProvider,String submodelid, List<Object> params) throws Exception;
public Object executeService( String serviceName, String deviceid, List<Object> params) throws Exception;
public String getServiceName();
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/components/proxy/registry/AASRegistryProxyIF.java b/components/basys.components/src/main/java/org/eclipse/basyx/components/proxy/registry/AASRegistryProxyIF.java
deleted file mode 100644
index 63169cf..0000000
--- a/components/basys.components/src/main/java/org/eclipse/basyx/components/proxy/registry/AASRegistryProxyIF.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.eclipse.basyx.components.proxy.registry;
-
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
-import org.eclipse.basyx.vab.core.IDirectoryService;
-
-
-
-
-/**
- * BaSys registry interface
- *
- * @author kuhn
- *
- */
-public interface AASRegistryProxyIF extends IDirectoryService {
-
-
- /**
- * Register AAS descriptor in registry, delete old registration
- */
- public void register(ModelUrn aasID, AASDescriptor deviceAASDescriptor);
-
- /**
- * Register AAS descriptor in registry, delete old registration (hacked)
- * @param aasId
- */
- public void register(ModelUrn aasId, org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor desc);
-
-
- /**
- * Only register AAS descriptor in registry
- */
- public void registerOnly(AASDescriptor deviceAASDescriptor);
-
-
- /**
- * Delete AAS descriptor from registry
- */
- public void delete(ModelUrn aasID);
-
-
- /**
- * Lookup device AAS
- */
- public AASDescriptor lookupAAS(ModelUrn aasID);
-}
-
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/components/service/BaseBaSyxService.java b/components/basys.components/src/main/java/org/eclipse/basyx/components/service/BaseBaSyxService.java
index 91d5ce6..6157250 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/components/service/BaseBaSyxService.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/components/service/BaseBaSyxService.java
@@ -3,11 +3,12 @@
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
+import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.components.configuration.ConfigurableComponent;
import org.eclipse.basyx.components.configuration.builder.BaSyxServiceConfigurationBuilder;
-import org.eclipse.basyx.components.proxy.registry.AASRegistryProxyIF;
import org.eclipse.basyx.sdk.api.service.BaSyxService;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
@@ -45,11 +46,16 @@
*/
protected VABConnectionManager connectionManager = null;
+ /**
+ * AAS connected manager for this service
+ */
+ protected ConnectedAssetAdministrationShellManager connectedAASManager = null;
+
/**
* Registry proxy reference that will be used for registering sub models
*/
- protected AASRegistryProxyIF registryProxy = null;
+ protected IAASRegistryService registryProxy = null;
@@ -77,6 +83,9 @@
// Create BaSyx connection manager
setConnectionManager(configuration.getConnectionManager());
+
+ // Createm BaSyx AAS connected manger
+ setConnectedAASManager(configuration.getConnetedAASManager());
}
@@ -205,7 +214,13 @@
connectionManager = connMngr;
}
-
+ /**
+ * Set connected AAS manager for this service
+ */
+ public void setConnectedAASManager(ConnectedAssetAdministrationShellManager connectedAASManager) {
+ this.connectedAASManager = connectedAASManager;
+ }
+
/**
* Get connection manager for this service
*/
@@ -228,7 +243,7 @@
/**
* Set AAS registry proxy
*/
- protected void setRegistry(AASRegistryProxyIF regProxy) {
+ protected void setRegistry(IAASRegistryService regProxy) {
registryProxy = regProxy;
}
@@ -236,7 +251,7 @@
/**
* Get AAS registry proxy reference
*/
- protected AASRegistryProxyIF getRegistry() {
+ protected IAASRegistryService getRegistry() {
return registryProxy;
}
}
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/BaSysProcessModel.java b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/BaSysProcessModel.java
index 5a6f41a..ad6ff27 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/BaSysProcessModel.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/BaSysProcessModel.java
@@ -3,9 +3,9 @@
import java.util.Collection;
import java.util.LinkedList;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.SubModel;
import org.eclipse.basyx.models.manufacturing.process.model.device.DeviceIF;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
@@ -111,6 +111,7 @@
*
* @return Product ID
*/
+ @Override
public ModelUrn endProcessing() {
// Get finished product
ModelUrn productID = getFinishedProducts().iterator().next();
@@ -126,6 +127,7 @@
/**
* Get products on device. This returns an unsorted collection of products.
*/
+ @Override
public Collection<ModelUrn> getProductsOnDevice() {
// Products collection
LinkedList<ModelUrn> productsOnDevice = new LinkedList<>();
@@ -143,6 +145,7 @@
/**
* Get device ID. This is the process ID in this case.
*/
+ @Override
public ModelUrn getDeviceID() {
// Return process ID
return processID;
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/SequentialProcess.java b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/SequentialProcess.java
index 598d098..39f0645 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/SequentialProcess.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/SequentialProcess.java
@@ -4,10 +4,10 @@
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.models.manufacturing.process.model.device.Device;
import org.eclipse.basyx.models.manufacturing.process.model.device.QueueDevice;
import org.eclipse.basyx.models.manufacturing.process.model.device.SequentialDevice;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/TestSequentialProcessModel.java b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/TestSequentialProcessModel.java
index 243ca08..715e260 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/TestSequentialProcessModel.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/TestSequentialProcessModel.java
@@ -3,7 +3,7 @@
import java.util.Collection;
import java.util.NoSuchElementException;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.junit.Test;
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/Device.java b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/Device.java
index 59415fd..f510114 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/Device.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/Device.java
@@ -2,7 +2,8 @@
import java.util.Collection;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/DeviceIF.java b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/DeviceIF.java
index 4ac97bc..ca1846e 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/DeviceIF.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/DeviceIF.java
@@ -2,7 +2,7 @@
import java.util.Collection;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/QueueDevice.java b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/QueueDevice.java
index 47ccf3c..e79df40 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/QueueDevice.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/QueueDevice.java
@@ -4,8 +4,8 @@
import java.util.LinkedList;
import java.util.Queue;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.models.manufacturing.process.model.queue.BoundedQueue;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/SequentialDevice.java b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/SequentialDevice.java
index 2401db6..931a42b 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/SequentialDevice.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/SequentialDevice.java
@@ -1,8 +1,6 @@
package org.eclipse.basyx.models.manufacturing.process.model.device;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
-
-
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
/**
* A sequential device model
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/SortOutDevice.java b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/SortOutDevice.java
index 6aa1fe4..955aa23 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/SortOutDevice.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/models/manufacturing/process/model/device/SortOutDevice.java
@@ -1,8 +1,6 @@
package org.eclipse.basyx.models.manufacturing.process.model.device;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
-
-
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
/**
* A device model that sorts products out
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/active/HTTPGetter.java b/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/active/HTTPGetter.java
index 0ce1f58..fbb41f3 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/active/HTTPGetter.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/active/HTTPGetter.java
@@ -3,7 +3,7 @@
import java.io.Serializable;
import java.util.function.Supplier;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceRawClient;
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/active/HTTPSupplier.java b/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/active/HTTPSupplier.java
index ee02991..9a9da45 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/active/HTTPSupplier.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/active/HTTPSupplier.java
@@ -2,8 +2,8 @@
import java.io.Serializable;
import java.util.function.Consumer;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceRawClient;
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/connManager/AASConnectionManager.java b/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/connManager/AASConnectionManager.java
index 5e92fbd..46abbe8 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/connManager/AASConnectionManager.java
+++ b/components/basys.components/src/main/java/org/eclipse/basyx/tools/aas/connManager/AASConnectionManager.java
@@ -2,15 +2,15 @@
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceRawClient;
import org.eclipse.basyx.aas.backend.connector.MetaprotocolHandler;
import org.eclipse.basyx.aas.backend.http.tools.GSONTools;
import org.eclipse.basyx.aas.backend.http.tools.factory.DefaultTypeFactory;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.aasdescriptor.SubmodelDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
import org.eclipse.basyx.vab.core.IConnectorProvider;
-import org.eclipse.basyx.vab.core.IDirectoryService;
+import org.eclipse.basyx.vab.core.IVABDirectoryService;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
import org.eclipse.basyx.vab.core.tools.VABPathTools;
@@ -42,7 +42,7 @@
* @param providerProvider
* Connection provider instance
*/
- public AASConnectionManager(IDirectoryService networkDirectoryService, IConnectorProvider providerProvider) {
+ public AASConnectionManager(IVABDirectoryService networkDirectoryService, IConnectorProvider providerProvider) {
// Invoke base constructor
super(networkDirectoryService, providerProvider);
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aasdescriptor/AASDescriptor.java b/components/basys.components/src/main/java/org/eclipse/basyx/tools/aasdescriptor/AASDescriptor.java
deleted file mode 100644
index 097918c..0000000
--- a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aasdescriptor/AASDescriptor.java
+++ /dev/null
@@ -1,232 +0,0 @@
-package org.eclipse.basyx.tools.aasdescriptor;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.AssetAdministrationShell;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.Identifier;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.parts.Asset;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.AdministrativeInformation;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
-
-
-
-/**
- * AAS descriptor class
- *
- * @author kuhn
- *
- */
-public class AASDescriptor extends HashMap<String, Object> {
-
-
- /**
- * Version of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
-
- /**
- * Default constructor
- */
- public AASDescriptor() {
- // Add members
- put("identification", new Identifier());
- put("metaData", new HashMap<String, Object>());
- put("administration", new AdministrativeInformation());
- put("idShort", new String(""));
- put("category", new String(""));
- put("descriptions", new LinkedList<Description>());
- put("asset", new Asset());
- put("submodels", new LinkedList<SubmodelDescriptor>());
- put("endpoints", new LinkedList<String>());
- }
-
-
- /**
- * Create a new AAS descriptor with minimal information
- */
- @SuppressWarnings("unchecked")
- public AASDescriptor(String id, String idType, String endpoint) {
- // Invoke default constructor
- this();
-
- // Add identification and end point information
- ((Identifier) get("identification")).setIdType(idType);
- ((Identifier) get("identification")).setId(id);
- ((List<String>) get("endpoints")).add(endpoint);
- }
-
- /**
- * Create a new sub model descriptor with minimal information
- */
- public AASDescriptor(AssetAdministrationShell aas, String endpoint, String endpointType) {
- // Invoke default constructor
-
-
- put("idShort", aas.getId());
- put("submodels", new LinkedList<SubmodelDescriptor>());
-
- // Add identification and end point information
- Identifier identifier = new Identifier();
-
- identifier.setIdType(aas.getIdentification().getIdType());
- identifier.setId(aas.getIdentification().getId());
- put("identification", identifier);
-
- HashMap<String, String> endpointWrapper = new HashMap<String, String>();
- endpointWrapper.put("type", endpointType);
- endpointWrapper.put("address", endpoint + "/aas");
-
- put("endpoints", Arrays.asList(endpointWrapper));
- }
-
- public String getAASId() {
- return (String) get("idShort");
- }
-
-
-
- /**
- * Create a new AAS descriptor with minimal information
- */
- public AASDescriptor(ModelUrn urn, String aasSrvURL) {
- // Invoke default constructor
- this(urn.getURN(), IdentifierType.URI, aasSrvURL+"/aas/submodels/aasRepository/"+urn.getEncodedURN());
- }
-
-
-
- /**
- * Create AAS descriptor from existing hash map
- */
- public AASDescriptor(Map<String, Object> map) {
- // Put all elements from map into this descriptor
- this.putAll(map);
- }
-
-
-
-
- /**
- * Return AAS ID
- */
- @SuppressWarnings("unchecked")
- public String getId() {
- return new Identifier((Map<String, Object>) get("identification")).getId();
- }
-
-
- /**
- * Return AAS ID type
- */
- @SuppressWarnings("unchecked")
- public String getIdType() {
- return new Identifier((Map<String, Object>) get("identification")).getIdType();
- }
-
-
- /**
- * Return first AAS end point
- */
- @SuppressWarnings("unchecked")
- public String getFirstEndpoint() {
- Object e = get("endpoints");
- // Extract String from endpoint in set and list representation
- String endpoint = null;
- if (e instanceof List<?>) {
- List<String> list = (List<String>) e;
- if (list.size() == 0) {
- return null;
- } else {
- return list.get(0);
- }
- } else if (e instanceof HashSet<?>) {
- HashSet<Map<String, Object>> set = (HashSet<Map<String, Object>>) e;
- if (set.size() == 0) {
- return null;
- } else {
- return (String) set.iterator().next().get("address");
- }
- } else {
- endpoint = null;
- }
-
- return endpoint;
- }
-
-
- /**
- * Add a sub model descriptor
- */
- @SuppressWarnings("unchecked")
- public AASDescriptor addSubmodelDescriptor(SubmodelDescriptor desc) {
- // Sub model descriptors are stored in a list
- Collection<Map<String, Object>> submodelDescriptors = (Collection<Map<String, Object>>) get("submodels");
-
- // Add new sub model descriptor to list
- submodelDescriptors.add(desc);
-
- // Return 'this' reference
- return this;
- }
-
-
- /**
- * Add a sub model descriptor - simplified operation with default fields
- *
- * @param urn URN of sub model
- */
- public AASDescriptor addSubmodelDescriptor(ModelUrn urn, String aasSrvURL) {
- // Add sub model descriptor
- addSubmodelDescriptor(new SubmodelDescriptor(urn.getURN(), IdentifierType.URI, aasSrvURL+"/aas/submodels/aasRepository/"+urn.getEncodedURN()));
-
- // Return 'this' reference
- return this;
- }
-
-
-
- /**
- * Get a specific sub model descriptor
- */
- public SubmodelDescriptor getSubModelDescriptor(ModelUrn subModelId) {
- return getSubModelDescriptor(subModelId.getURN());
- }
-
-
- /**
- * Get a specific sub model descriptor
- */
- @SuppressWarnings("unchecked")
- public SubmodelDescriptor getSubModelDescriptor(String subModelId) {
- // Sub model descriptors are stored in a list
- Collection<Map<String, Object>> submodelDescriptorMaps = (Collection<Map<String, Object>>) get("submodels");
-
- System.out.println("Checking submodel desc");
-
- // Create sub model descriptors from contained maps
- // - We cannot guarantee here that these are really SubmodelDescriptors already and therefore need to default to maps
- Collection<SubmodelDescriptor> submodelDescriptors = new LinkedList<>();
- // - Fill sub model descriptors
- for (Map<String, Object> currentMap: submodelDescriptorMaps) submodelDescriptors.add(new SubmodelDescriptor(currentMap));
-
- // Look for descriptor
- for (SubmodelDescriptor desc: submodelDescriptors) {
- System.out.println("Checking: "+desc.getId());
-
- if (desc.getId().equals(subModelId)) return desc;
- }
-
- // No Descritor found
- return null;
- }
-}
-
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aasdescriptor/SubmodelDescriptor.java b/components/basys.components/src/main/java/org/eclipse/basyx/tools/aasdescriptor/SubmodelDescriptor.java
deleted file mode 100644
index cca38bc..0000000
--- a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aasdescriptor/SubmodelDescriptor.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package org.eclipse.basyx.tools.aasdescriptor;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.SubModel;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.Identifier;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.AdministrativeInformation;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.haskind.Kind;
-
-
-
-
-/**
- * AAS descriptor class
- *
- * @author kuhn
- *
- */
-public class SubmodelDescriptor extends HashMap<String, Object> {
-
-
- /**
- * Version of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
-
- /**
- * Default constructor
- */
- public SubmodelDescriptor() {
- // Add members
- put("identification", new Identifier());
- put("metaData", new HashMap<String, Object>());
- put("administration", new AdministrativeInformation());
- put("idShort", new String(""));
- put("category", new String(""));
- put("descriptions", new LinkedList<Description>());
- put("semanticId", new Identifier());
- put("kind", Kind.Instance);
- put("endpoints", new LinkedList<String>());
- }
-
-
- /**
- * Create a new sub model descriptor with minimal information
- */
- @SuppressWarnings("unchecked")
- public SubmodelDescriptor(String id, String idType, String endpoint) {
- // Invoke default constructor
- this();
-
- // Add identification and end point information
- ((Identifier) get("identification")).setIdType(idType);
- ((Identifier) get("identification")).setId(id);
- ((List<String>) get("endpoints")).add(endpoint);
- }
-
- /**
- * Create a new sub model descriptor with minimal information
- */
- public SubmodelDescriptor(SubModel submodel, String endpoint, String endpointType) {
- // Invoke default constructor
- //this();
-
- put("idShort", submodel.getId());
-
- // Add identification and end point information
- Identifier identifier = new Identifier();
- identifier.setIdType(submodel.getIdentification().getIdType());
- identifier.setId(submodel.getIdentification().getId());
- put("identification", identifier);
-
- HashMap<String, String> endpointWrapper = new HashMap<String, String>();
- endpointWrapper.put("type", endpointType);
- endpointWrapper.put("address", endpoint);
-
- put("endpoints", Arrays.asList(endpointWrapper));
- }
-
- /**
- * Create sub model descriptor from existing hash map
- */
- public SubmodelDescriptor(Map<String, Object> map) {
- // Put all elements from map into this descriptor
- this.putAll(map);
- }
-
-
- /**
- * Return sub model ID
- */
- @SuppressWarnings("unchecked")
- public String getId() {
- return new Identifier((Map<String, Object>) get("identification")).getId();
- }
-
-
- /**
- * Return sub model ID type
- */
- @SuppressWarnings("unchecked")
- public String getIdType() {
- return new Identifier((Map<String, Object>) get("identification")).getIdType();
- }
-
-
- /**
- * Return first sub model end point
- */
- @SuppressWarnings("unchecked")
- public String getFirstEndpoint() {
- return ((List<String>) get("endpoints")).get(0);
- }
-}
-
diff --git a/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/file/TestStaticDirectoryFileProvider.java b/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/file/TestStaticDirectoryFileProvider.java
index ca677a8..3d620d3 100644
--- a/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/file/TestStaticDirectoryFileProvider.java
+++ b/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/file/TestStaticDirectoryFileProvider.java
@@ -7,10 +7,10 @@
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceRawClient;
import org.eclipse.basyx.aas.backend.connector.MetaprotocolHandler;
import org.eclipse.basyx.regression.support.server.context.ComponentsRegressionContext;
import org.eclipse.basyx.testsuite.support.backend.servers.AASHTTPServerResource;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
import org.junit.ClassRule;
import org.junit.Test;
diff --git a/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/file/TestStaticDirectoryFileProviderExceptions.java b/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/file/TestStaticDirectoryFileProviderExceptions.java
index 5ce8391..f1365e4 100644
--- a/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/file/TestStaticDirectoryFileProviderExceptions.java
+++ b/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/file/TestStaticDirectoryFileProviderExceptions.java
@@ -7,9 +7,9 @@
import javax.ws.rs.ServerErrorException;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceJSONClient;
import org.eclipse.basyx.regression.support.server.context.ComponentsRegressionContext;
import org.eclipse.basyx.testsuite.support.backend.servers.AASHTTPServerResource;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceJSONClient;
import org.junit.ClassRule;
import org.junit.Test;
diff --git a/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/sql/TestDirectorySQLProvider.java b/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/sql/TestDirectorySQLProvider.java
index af0d8c4..a2d26b1 100644
--- a/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/sql/TestDirectorySQLProvider.java
+++ b/components/basys.components/src/test/java/org/eclipse/basyx/regression/directory/sql/TestDirectorySQLProvider.java
@@ -7,14 +7,14 @@
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceRawClient;
import org.eclipse.basyx.aas.backend.connector.MetaprotocolHandler;
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.descriptor.AASDescriptor;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
import org.eclipse.basyx.regression.support.server.context.ComponentsRegressionContext;
import org.eclipse.basyx.testsuite.support.backend.servers.AASHTTPServerResource;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
diff --git a/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestAASServicecall.java b/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestAASServicecall.java
index 0999c73..ca85852 100644
--- a/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestAASServicecall.java
+++ b/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestAASServicecall.java
@@ -6,15 +6,22 @@
import java.util.ArrayList;
import java.util.Arrays;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
import org.eclipse.basyx.aas.backend.provider.VABMultiSubmodelProvider;
import org.eclipse.basyx.aas.backend.provider.VirtualPathModelProvider;
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.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
import org.eclipse.basyx.components.processengine.connector.DeviceServiceExecutor;
import org.eclipse.basyx.regression.support.processengine.aas.DeviceAdministrationShellFactory;
import org.eclipse.basyx.regression.support.processengine.executor.CoilcarServiceExecutor;
import org.eclipse.basyx.regression.support.processengine.stubs.CoilcarStub;
import org.eclipse.basyx.regression.support.processengine.submodel.DeviceSubmodelFactory;
+import org.eclipse.basyx.testsuite.support.vab.stub.AASRegistryStub;
+import org.eclipse.basyx.testsuite.support.vab.stub.ConnectorProviderStub;
import org.eclipse.basyx.testsuite.support.vab.stub.VABConnectionManagerStub;
import org.junit.Before;
import org.junit.Test;
@@ -30,87 +37,87 @@
* Service Executor to be tested, used by the process engine
*/
private DeviceServiceExecutor serviceExecutor;
-
+
/**
* VAB connection stub needed for setting up service invocation
*/
private VABConnectionManagerStub connectionStub;
-
+
/**
- * A stub for the service sub-model
+ * A stub for the service sub-model
*/
private CoilcarStub coilcar;
+
+
/**
* Setup the test environment, create aas and submodels, setup VAB connection
*/
@Before
public void setupDeviceServiceExecutor() {
// Create a device-aas for coilcar device with id "coilcar" and submodelid "submodel1"
- AssetAdministrationShell aas = new DeviceAdministrationShellFactory().create("coilcar", "submodel1");
-
+ AssetAdministrationShell aas = new DeviceAdministrationShellFactory().create( "coilcar", "submodel1");
+
// Create service stub instead of real coilcar services
coilcar = new CoilcarStub();
-
+
// Create the submodel of services provided by the coilcar with id "submodel1"
SubModel sm = new DeviceSubmodelFactory().create("submodel1", coilcar);
-
+
// Create VAB multi-submodel provider for holding the sub-models
VABMultiSubmodelProvider provider = new VABMultiSubmodelProvider();
-
+
// Add sub-model to the provider
provider.addSubmodel("submodel1", new VirtualPathModelProvider(sm));
-
+
// Add aas to the provider
provider.setAssetAdministrationShell(new VirtualPathModelProvider(aas));
+
+ IAASRegistryService registry = new AASRegistryStub();
+ AASDescriptor aasDescriptor = new AASDescriptor("coilcar", IdentifierType.URI, "");
+ SubmodelDescriptor smDescriptor = new SubmodelDescriptor("submodel1", IdentifierType.URI, "");
+ aasDescriptor.addSubmodelDescriptor(smDescriptor);
+
+ registry.register(new ModelUrn("coilcar"), aasDescriptor);
// setup the connection-manager with the model-provider
- connectionStub = new VABConnectionManagerStub();
- connectionStub.addProvider("submodel1", "", provider);
- connectionStub.addProvider("coilcar", "", provider);
-
+ ConnectorProviderStub connectorProvider = new ConnectorProviderStub();
+ connectorProvider.addMapping("", provider);
+
// create the service executor that calls the services using aas
- serviceExecutor = new CoilcarServiceExecutor(connectionStub);
-
+ serviceExecutor = new CoilcarServiceExecutor(registry, connectorProvider);
+
}
-
+
+
/**
- * Test the service invocation of the service-executor
+ * Test the service invocation of the service-executor
*/
@Test
public void testServicecall() {
- /*
- * Execute the service "moveTo" on the device "coilcar",
- * the service is located in sub-model "submodel1"
- * and has a parameter 123
- */
- serviceExecutor.executeService("moveTo", "coilcar", "submodel1",
- new ArrayList<>(Arrays.asList(new Object[] { 123 })));
-
+ /* Execute the service "moveTo" on the device "coilcar",
+ * the service is located in sub-model "submodel1"
+ * and has a parameter 123*/
+ serviceExecutor.executeService("moveTo", "coilcar", "submodel1", new ArrayList<>(Arrays.asList( new Object[] {123})));
+
// Validate the parameter and service name is delivered successfully to the device stub
assertEquals(123, coilcar.getParameter());
assertTrue(coilcar.getServiceCalled().equals("moveTo"));
-
- /*
- * Execute the service "liftTo" on the device "coilcar",
- * the service is located in sub-model "submodel1"
- * and has a parameter 456
- */
- serviceExecutor.executeService("liftTo", "coilcar", "submodel1",
- new ArrayList<>(Arrays.asList(new Object[] { 456 })));
-
+
+ /* Execute the service "liftTo" on the device "coilcar",
+ * the service is located in sub-model "submodel1"
+ * and has a parameter 456*/
+ serviceExecutor.executeService("liftTo", "coilcar", "submodel1", new ArrayList<>(Arrays.asList( new Object[] {456})));
+
// Validate the parameter and service name is delivered successfully to the device stub
assertEquals(456, coilcar.getParameter());
assertTrue(coilcar.getServiceCalled().equals("liftTo"));
-
- /*
- * Execute the service "moveTo" on the device "coilcar",
- * the service is located in sub-model "submodel1"
- * and has a parameter 789
- */
- serviceExecutor.executeService("moveTo", "coilcar", "submodel1",
- new ArrayList<>(Arrays.asList(new Object[] { 789 })));
-
+
+ /* Execute the service "moveTo" on the device "coilcar",
+ * the service is located in sub-model "submodel1"
+ * and has a parameter 789*/
+ serviceExecutor.executeService("moveTo", "coilcar", "submodel1", new ArrayList<>(Arrays.asList( new Object[] {789})));
+
// Validate the parameter and service name is delivered successfully to the device stub
assertEquals(789, coilcar.getParameter());
assertTrue(coilcar.getServiceCalled().equals("moveTo"));
diff --git a/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestDeviceAdministrationShell.java b/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestDeviceAdministrationShell.java
index 4446d1b..12d72fa 100644
--- a/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestDeviceAdministrationShell.java
+++ b/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestDeviceAdministrationShell.java
@@ -5,15 +5,18 @@
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IOperation;
import org.eclipse.basyx.aas.api.resources.ISubModel;
import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.aas.backend.connected.aas.ConnectedAssetAdministrationShell;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
-import org.eclipse.basyx.regression.support.directory.ComponentsTestsuiteDirectory;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
import org.eclipse.basyx.regression.support.server.context.ComponentsRegressionContext;
import org.eclipse.basyx.testsuite.support.backend.servers.AASHTTPServerResource;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
+import org.eclipse.basyx.testsuite.support.vab.stub.AASRegistryStub;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
@@ -26,17 +29,8 @@
*
*/
public class TestDeviceAdministrationShell {
- private ConnectedAssetAdministrationShell connectedAAS;
-
- /**
- * VAB connection manager backend
- */
- protected VABConnectionManager connManager = new VABConnectionManager(new ComponentsTestsuiteDirectory(),
- new HTTPConnectorProvider());
-
- protected ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(
- connManager);
-
+ private ConnectedAssetAdministrationShellManager manager;
+ ConnectedAssetAdministrationShell connectedAAS;
/**
* Makes sure Tomcat Server is started
*/
@@ -45,10 +39,21 @@
@Before
public void setupConnection() {
+ AASRegistryStub registry = new AASRegistryStub();
+ ModelUrn coilcarUrn = new ModelUrn("coilcar");
+ AASDescriptor ccDescriptor = new AASDescriptor("coilcar", IdentifierType.URI,
+ "http://localhost:8080/basys.components/Testsuite/Processengine/coilcar/");
+ SubmodelDescriptor smDescriptor = new SubmodelDescriptor("submodel1", IdentifierType.URI,
+ "http://localhost:8080/basys.components/Testsuite/Processengine/coilcar/");
+ ccDescriptor.addSubmodelDescriptor(smDescriptor);
+ registry.register(coilcarUrn, ccDescriptor);
+
+ //set-up the administration shell manager to create connected aas
+ manager = new ConnectedAssetAdministrationShellManager(registry, new HTTPConnectorProvider());
+
// create the connected AAS using the manager
-
try {
- connectedAAS = (ConnectedAssetAdministrationShell) manager.retrieveAAS("coilcar");
+ connectedAAS = manager.retrieveAAS(coilcarUrn);
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestTransportProcess_ConfigureEngineProgramically.java b/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestTransportProcess_ConfigureEngineProgramically.java
index d4f22f5..9e19a74 100644
--- a/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestTransportProcess_ConfigureEngineProgramically.java
+++ b/components/basys.components/src/test/java/org/eclipse/basyx/regression/processengineconnector/tests/TestTransportProcess_ConfigureEngineProgramically.java
@@ -11,15 +11,17 @@
import org.activiti.engine.RepositoryService;
import org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration;
import org.activiti.engine.runtime.ProcessInstance;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
import org.eclipse.basyx.components.processengine.connector.DeviceServiceDelegate;
-import org.eclipse.basyx.regression.support.processengine.SetupAAS;
import org.eclipse.basyx.regression.support.processengine.executor.CoilcarServiceExecutor;
import org.eclipse.basyx.regression.support.server.context.ComponentsRegressionContext;
import org.eclipse.basyx.testsuite.support.backend.servers.AASHTTPServerResource;
-import org.eclipse.basyx.testsuite.support.vab.stub.DirectoryServiceStub;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
+import org.eclipse.basyx.testsuite.support.vab.stub.AASRegistryStub;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
@@ -39,11 +41,7 @@
* */
ConnectedAssetAdministrationShellManager manager;
- /**
- * Required by the connected aas manager
- */
- VABConnectionManager connectionManager;
-
+ AASRegistryStub registry;
/**
* Makes sure Tomcat Server is started
*/
@@ -55,14 +53,20 @@
*/
@Before
public void build() {
- // Create directory stub
- DirectoryServiceStub directory = new DirectoryServiceStub();
- directory.addMapping(SetupAAS.aasid, "http://localhost:8080/basys.sdk/Testsuite/coilcar/");
- directory.addMapping(SetupAAS.submodelid, "http://localhost:8080/basys.sdk/Testsuite/coilcar/");
-
- // Create manager using the directory stub an the HTTPConnectorProvider
- connectionManager = new VABConnectionManager(directory, new HTTPConnectorProvider());
- manager = new ConnectedAssetAdministrationShellManager(connectionManager);
+ // Create registry for aas
+ registry = new AASRegistryStub();
+
+ // Create aas descriptor with meta-information of the aas
+ ModelUrn coilcarUrn = new ModelUrn("coilcar");
+ AASDescriptor ccDescriptor = new AASDescriptor("coilcar", IdentifierType.URI,
+ "http://localhost:8080/basys.components/Testsuite/Processengine/coilcar/");
+ SubmodelDescriptor smDescriptor = new SubmodelDescriptor("submodel1", IdentifierType.URI,
+ "http://localhost:8080/basys.components/Testsuite/Processengine/coilcar/");
+ ccDescriptor.addSubmodelDescriptor(smDescriptor);
+
+ // registra the aas
+ registry.register(coilcarUrn, ccDescriptor);
+ manager = new ConnectedAssetAdministrationShellManager(registry, new HTTPConnectorProvider());
}
@@ -100,7 +104,8 @@
variables.put("coilposition", 2);
// Set the service executor to the java-delegate
- DeviceServiceDelegate.setDeviceServiceExecutor(new CoilcarServiceExecutor(connectionManager));
+ DeviceServiceDelegate
+ .setDeviceServiceExecutor(new CoilcarServiceExecutor(manager));
// Start a process instance
@SuppressWarnings("unused")
diff --git a/components/basys.components/src/test/java/org/eclipse/basyx/regression/support/processengine/executor/CoilcarServiceExecutor.java b/components/basys.components/src/test/java/org/eclipse/basyx/regression/support/processengine/executor/CoilcarServiceExecutor.java
index d175ee6..55ce533 100644
--- a/components/basys.components/src/test/java/org/eclipse/basyx/regression/support/processengine/executor/CoilcarServiceExecutor.java
+++ b/components/basys.components/src/test/java/org/eclipse/basyx/regression/support/processengine/executor/CoilcarServiceExecutor.java
@@ -2,9 +2,11 @@
import java.util.List;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
+import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.components.processengine.connector.DeviceServiceExecutor;
import org.eclipse.basyx.regression.support.processengine.SetupAAS;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
+import org.eclipse.basyx.vab.core.IConnectorProvider;
/**
* Service executor used by the process engine, defined for the coilcar test case
@@ -18,8 +20,12 @@
*
* @param connectionmanager for VAB Connection
*/
- public CoilcarServiceExecutor(VABConnectionManager connectionmanager) {
- super(connectionmanager);
+ public CoilcarServiceExecutor(IAASRegistryService registry, IConnectorProvider provider) {
+ super(registry, provider);
+ }
+
+ public CoilcarServiceExecutor(ConnectedAssetAdministrationShellManager manager) {
+ super(manager);
}
/**
diff --git a/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/support/directory/ExampleAASRegistry.java b/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/support/directory/ExampleAASRegistry.java
new file mode 100644
index 0000000..08112ef
--- /dev/null
+++ b/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/support/directory/ExampleAASRegistry.java
@@ -0,0 +1,39 @@
+package org.eclipse.basyx.examples.support.directory;
+
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
+import org.eclipse.basyx.testsuite.support.vab.stub.AASRegistryStub;
+
+public class ExampleAASRegistry extends AASRegistryStub {
+
+ @Override
+ public ExampleAASRegistry addAASMapping(String rawUrn, String endpoint) {
+ AASDescriptor aasDescriptor = new AASDescriptor(rawUrn, IdentifierType.URI, endpoint);
+ ModelUrn aasUrn = new ModelUrn(rawUrn);
+ register(aasUrn, aasDescriptor);
+
+ return this;
+ }
+
+
+
+ public ExampleAASRegistry addSubmodelMapping(String rawurn, String submodelid, String endpoint) {
+ AASDescriptor aasDescriptor;
+ ModelUrn aasUrn = new ModelUrn(rawurn);
+ SubmodelDescriptor smDes = new SubmodelDescriptor(submodelid, IdentifierType.URI, endpoint);
+
+ if (descriptorMap.keySet().contains(aasUrn)) {
+ aasDescriptor = descriptorMap.get(aasUrn);
+ } else {
+ aasDescriptor = new AASDescriptor(rawurn, IdentifierType.URI, endpoint);
+ }
+ aasDescriptor.addSubmodelDescriptor(smDes);
+
+ register(aasUrn, aasDescriptor);
+ return this;
+ }
+
+
+}
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/application/ReceiveDeviceDashboardStatusApplication.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/application/ReceiveDeviceDashboardStatusApplication.java
index 8c0f596..b732ba9 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/application/ReceiveDeviceDashboardStatusApplication.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/application/ReceiveDeviceDashboardStatusApplication.java
@@ -1,13 +1,13 @@
package org.eclipse.basyx.examples.mockup.application;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.AASHTTPRegistryProxy;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
import org.eclipse.basyx.aas.metamodel.hashmap.VABModelMap;
-import org.eclipse.basyx.components.proxy.registry.AASHTTPRegistryProxy;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
import org.eclipse.basyx.components.service.BaseBaSyxService;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.aasdescriptor.SubmodelDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/application/ReceiveDeviceMaintenanceApplication.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/application/ReceiveDeviceMaintenanceApplication.java
index 33efa39..3edfba0 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/application/ReceiveDeviceMaintenanceApplication.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/application/ReceiveDeviceMaintenanceApplication.java
@@ -1,13 +1,13 @@
package org.eclipse.basyx.examples.mockup.application;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.AASHTTPRegistryProxy;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
import org.eclipse.basyx.aas.metamodel.hashmap.VABModelMap;
-import org.eclipse.basyx.components.proxy.registry.AASHTTPRegistryProxy;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
import org.eclipse.basyx.components.service.BaseBaSyxService;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.aasdescriptor.SubmodelDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/device/SmartBaSyxTCPDeviceMockup.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/device/SmartBaSyxTCPDeviceMockup.java
index 2fe53ee..af80cbe 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/device/SmartBaSyxTCPDeviceMockup.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/device/SmartBaSyxTCPDeviceMockup.java
@@ -1,15 +1,15 @@
package org.eclipse.basyx.examples.mockup.device;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.AASHTTPRegistryProxy;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
import org.eclipse.basyx.aas.backend.provider.VirtualPathModelProvider;
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.descriptor.AASDescriptor;
import org.eclipse.basyx.components.device.BaseSmartDevice;
-import org.eclipse.basyx.components.proxy.registry.AASHTTPRegistryProxy;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
import org.eclipse.basyx.models.controlcomponent.ExecutionState;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.backend.server.basyx.BaSyxTCPServer;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/BaSyxTCPControlManufacturingDeviceManager.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/BaSyxTCPControlManufacturingDeviceManager.java
index 78a3a3c..9f8bc29 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/BaSyxTCPControlManufacturingDeviceManager.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/BaSyxTCPControlManufacturingDeviceManager.java
@@ -3,16 +3,16 @@
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.AASHTTPRegistryProxy;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
import org.eclipse.basyx.aas.backend.provider.VirtualPathModelProvider;
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.descriptor.AASDescriptor;
import org.eclipse.basyx.components.devicemanager.TCPControllableDeviceManagerComponent;
-import org.eclipse.basyx.components.proxy.registry.AASHTTPRegistryProxy;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
import org.eclipse.basyx.models.controlcomponent.ControlComponentChangeListener;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.backend.server.basyx.BaSyxTCPServer;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/ManufacturingDeviceActiveAASManager.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/ManufacturingDeviceActiveAASManager.java
index 6648aa8..3048dcd 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/ManufacturingDeviceActiveAASManager.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/ManufacturingDeviceActiveAASManager.java
@@ -2,10 +2,10 @@
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.SubModel;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
import org.eclipse.basyx.tools.aas.active.HTTPGetter;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.provider.lambda.VABLambdaProviderHelper;
@@ -35,6 +35,7 @@
/**
* Create the device AAS and sub model structure
*/
+ @Override
protected void createDeviceAASAndSubModels() {
// Invoke base implementation
super.createDeviceAASAndSubModels();
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/ManufacturingDeviceManager.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/ManufacturingDeviceManager.java
index b147576..e0ea9b2 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/ManufacturingDeviceManager.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/mockup/devicemanager/ManufacturingDeviceManager.java
@@ -3,15 +3,15 @@
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.AASHTTPRegistryProxy;
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.descriptor.AASDescriptor;
import org.eclipse.basyx.components.configuration.CFGBaSyxProtocolType;
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.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
@@ -60,6 +60,7 @@
configure()
.registryURL("http://localhost:8080/basys.examples/Components/Directory/SQL")
.connectionManagerType(CFGBaSyxProtocolType.HTTP)
+ .directoryService(new ExamplesPreconfiguredDirectory())
.end();
// configure()
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/active/tasks/InfluxDBTask.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/active/tasks/InfluxDBTask.java
index 83e2da0..c37a460 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/active/tasks/InfluxDBTask.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/active/tasks/InfluxDBTask.java
@@ -5,6 +5,7 @@
import java.net.HttpURLConnection;
import java.net.URL;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceRawClient;
import org.eclipse.basyx.tools.aas.active.VABModelTask;
import org.eclipse.basyx.vab.core.IModelProvider;
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/device/DeviceAASDeployment.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/device/DeviceAASDeployment.java
index 03c3379..683e934 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/device/DeviceAASDeployment.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/device/DeviceAASDeployment.java
@@ -2,17 +2,19 @@
import static org.junit.Assert.assertTrue;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.aas.backend.connector.basyx.BaSyxConnectorProvider;
import org.eclipse.basyx.aas.backend.provider.VABMultiSubmodelProvider;
import org.eclipse.basyx.aas.backend.provider.VirtualPathModelProvider;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.AssetAdministrationShell;
-import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
+import org.eclipse.basyx.examples.support.directory.ExampleAASRegistry;
import org.eclipse.basyx.vab.backend.server.basyx.BaSyxTCPServer;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.junit.Test;
+
+
/**
* Code snippet that illustrates the deployment of an AAS to a device, and connects to that AAS
*
@@ -23,6 +25,7 @@
*/
public class DeviceAASDeployment {
+
/**
* Run code snippet. Connect to AAS on server, access AAS properties.
*/
@@ -45,26 +48,20 @@
server.start();
- // Create connection manager to connect with the dynamic server
- // - We pre-register the connection endpoint to the dynamic BaSyx server
- VABConnectionManager connManager = new VABConnectionManager(
- // Add example specific mappings
- new ExamplesPreconfiguredDirectory()
- // - SDK connectors encapsulate relative path Asset Administration Shell
- .addMapping("dynamicAAS", "basyx://localhost:9998"),
+
+ // - We pre-register the aas endpoints to the dynamic BaSyx server
+ ExampleAASRegistry registry = new ExampleAASRegistry();
+ registry.addAASMapping("dynamicAAS", "basyx://localhost:9998");
+
+ // Create connected aas manager to connect with the dynamic server
+ ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(registry,
// We connect via BaSyx TCP protocol
new BaSyxConnectorProvider());
-
- // Create manager using the directory stub an the HTTPConnectorProvider
- // - Connect to VAB object by ID. The connection manager looks up this ID in
- // its directory
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connManager);
-
// Retrieve the AAS with ID "dynamicAAS" from the AAS server with SDK connector
// - IAssetAdministrationShell is the interface for the local AAS proxy
- IAssetAdministrationShell shell = manager.retrieveAAS("dynamicAAS");
+ IAssetAdministrationShell shell = manager.retrieveAAS(new ModelUrn("dynamicAAS"));
// - Retrieve AAS values and compare to expected values
Object propertyId = shell.getId();
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/device/DeviceSubModelDeployment.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/device/DeviceSubModelDeployment.java
index bf7ed90..7ca784c 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/device/DeviceSubModelDeployment.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/device/DeviceSubModelDeployment.java
@@ -2,6 +2,7 @@
import static org.junit.Assert.assertTrue;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.ISingleProperty;
import org.eclipse.basyx.aas.api.resources.ISubModel;
import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
@@ -11,9 +12,8 @@
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.submodelelement.property.Property;
-import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
+import org.eclipse.basyx.examples.support.directory.ExampleAASRegistry;
import org.eclipse.basyx.vab.backend.server.basyx.BaSyxTCPServer;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.junit.Test;
@@ -57,26 +57,19 @@
server.start();
- // Create connection manager to connect with the dynamic server
- // - We pre-register the connection endpoint to the dynamic BaSyx server
- VABConnectionManager connManager = new VABConnectionManager(
- // Add example specific mappings
- new ExamplesPreconfiguredDirectory()
- // - SDK connectors encapsulate relative path Asset Administration Shell
- // - The dynamic deployed sub model receives a unique URN, as it needs to be locatable
- // - In most cases, the discovery server will provide the endpoint of the sub model
- .addMapping("urn:de.FHG:devices.es.iese:SampleSM:1.0:3:x-509#003", "basyx://localhost:9998"),
- // We connect via BaSyx TCP protocol
- new BaSyxConnectorProvider());
-
+ // Create connected aas manager to connect with the dynamic server
+ // We pre-register the aas endpoints to the dynamic BaSyx server
+ ExampleAASRegistry registry = new ExampleAASRegistry();
+ registry.addSubmodelMapping("", "urn:de.FHG:devices.es.iese:SampleSM:1.0:3:x-509#003", "basyx://localhost:9998");
// Create manager using the directory stub an the HTTPConnectorProvider
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connManager);
-
+ ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(registry,
+ // We connect via BaSyx TCP protocol
+ new BaSyxConnectorProvider());
// Create and connect SDK connector
// - Retrieve sub model
- ISubModel subModel = manager.retrieveSM("urn:de.FHG:devices.es.iese:SampleSM:1.0:3:x-509#003");
+ ISubModel subModel = manager.retrieveSM("urn:de.FHG:devices.es.iese:SampleSM:1.0:3:x-509#003", new ModelUrn(""));
// Retrieve sub model values and compare to expected values
String submodelId = subModel.getId();
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/http/ConnectToRemoteAAS.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/http/ConnectToRemoteAAS.java
index a5a4e9a..57c95d0 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/http/ConnectToRemoteAAS.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/deployment/http/ConnectToRemoteAAS.java
@@ -2,6 +2,7 @@
import static org.junit.Assert.assertTrue;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
@@ -9,8 +10,7 @@
import org.eclipse.basyx.components.servlet.submodel.AASServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_Empty;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
-import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
+import org.eclipse.basyx.examples.support.directory.ExampleAASRegistry;
import org.junit.ClassRule;
import org.junit.Test;
@@ -50,22 +50,6 @@
/**
- * Create VAB connection manager backend
- *
- * The connection manager uses a preconfigured directory for resolving IDs to
- * network addresses, and a HTTP connector to connect to VAB objects.
- */
- protected VABConnectionManager connManager = new VABConnectionManager(
- // Add example specific mappings
- new ExamplesPreconfiguredDirectory()
- // - SDK connectors encapsulate relative path Asset Administration Shell
- .addMapping("aas-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleAAS"),
- // We connect via HTTP
- new HTTPConnectorProvider());
-
-
-
- /**
* The BaSyx Deployment instantiates and starts context elements for this example.
*
* This example instantiates the BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory
@@ -89,14 +73,22 @@
*/
@Test
public void connectToAAS() throws Exception {
+ // Create AAS Registry to store meta-infomation using aas descriptor
+ // This is a pre-configured aas registry that resolves urn to aas-descriptor
+ ExampleAASRegistry registry = new ExampleAASRegistry();
+ registry.addAASMapping("aas-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleAAS");
+
// Create manager using the directory stub an the HTTPConnectorProvider
// - Connect to VAB object by ID. The connection manager looks up this ID in
// its directory
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connManager);
+ ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(registry,
+ // We connect via HTTP
+ new HTTPConnectorProvider());
// Retrieve the AAS from the AAS server with SDK connector
// - IAssetAdministrationShell is the interface for the local AAS proxy
- IAssetAdministrationShell shell = manager.retrieveAAS("aas-001");
+ IAssetAdministrationShell shell = manager
+ .retrieveAAS(new ModelUrn("aas-001"));
// - Retrieve AAS values and compare to expected values
Object propertyId = shell.getId();
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/ConnectToAASEndpoints.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/ConnectToAASEndpoints.java
index 7e2f9da..4846c7f 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/ConnectToAASEndpoints.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/ConnectToAASEndpoints.java
@@ -4,18 +4,18 @@
import java.util.HashMap;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.AASHTTPRegistryProxy;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
+import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.aas.backend.connected.aas.ConnectedAssetAdministrationShell;
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.descriptor.AASDescriptor;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
-import org.eclipse.basyx.components.proxy.registry.AASHTTPRegistryProxy;
-import org.eclipse.basyx.components.proxy.registry.AASRegistryProxyIF;
import org.eclipse.basyx.components.servlet.submodel.DynamicModelProviderServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
-import org.eclipse.basyx.tools.aas.connManager.AASConnectionManager;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
import org.eclipse.basyx.vab.core.tools.VABPathTools;
import org.junit.ClassRule;
@@ -42,7 +42,7 @@
* The connection manager uses a preconfigured directory for resolving IDs to
* network addresses, and a HTTP connector to connect to VAB objects.
*/
- protected AASConnectionManager connManager = new AASConnectionManager(
+ protected ConnectedAssetAdministrationShellManager connManager = new ConnectedAssetAdministrationShellManager(
new AASHTTPRegistryProxy("http://localhost:8080/basys.examples/Components/Directory/SQL"),
new HTTPConnectorProvider());
@@ -84,14 +84,18 @@
// Register AAS and sub model descriptors in directory (push AAS descriptor to server)
// - Connect to AAS registry
- AASRegistryProxyIF regProxy = new AASHTTPRegistryProxy("http://localhost:8080/basys.examples/Components/Directory/SQL");
+ IAASRegistryService regProxy = new AASHTTPRegistryProxy("http://localhost:8080/basys.examples/Components/Directory/SQL");
// - Register AAS descriptor with AAS and sub model endpoints in registry
regProxy.register(aasURN, aasDescriptor);
+ // Connect to AAS using BaSyx connector
+ // - Connect to VAB object by ID. The connection manager looks up this ID in
+ // its directory
+ ConnectedAssetAdministrationShell shell = this.connManager.retrieveAAS(aasURN);
// Server connections
// - Connect AAS
- VABElementProxy connSubModel1 = this.connManager.connectToAAS(aasURN);
+ VABElementProxy connSubModel1 = shell.getProxy();
// Create AAS
@@ -105,11 +109,8 @@
// - This call transfers the AAS to urn:de.FHG:devices.es.iese:aas:1.0:3:x-509#001/aas on server
connSubModel1.createElement("aas", aas);
- // Connect to AAS using BaSyx connector
- // - Connect to VAB object by ID. The connection manager looks up this ID in
- // its directory
- ConnectedAssetAdministrationShell shell = new ConnectedAssetAdministrationShell("aas", connSubModel1, connManager);
+
// Retrieve the AAS from the AAS server with SDK connector
// - IAssetAdministrationShell is the interface for the local AAS proxy
// - Retrieve AAS values and compare to expected values
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/ConnectToSubModelEndpoints.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/ConnectToSubModelEndpoints.java
index b93df69..2575be2 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/ConnectToSubModelEndpoints.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/ConnectToSubModelEndpoints.java
@@ -4,22 +4,22 @@
import java.util.HashMap;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.AASHTTPRegistryProxy;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
import org.eclipse.basyx.aas.api.resources.ISingleProperty;
import org.eclipse.basyx.aas.backend.connected.aas.ConnectedSubModel;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
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.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.submodelelement.property.Property;
-import org.eclipse.basyx.components.proxy.registry.AASHTTPRegistryProxy;
-import org.eclipse.basyx.components.proxy.registry.AASRegistryProxyIF;
import org.eclipse.basyx.components.servlet.submodel.DynamicModelProviderServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
import org.eclipse.basyx.tools.aas.connManager.AASConnectionManager;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.aasdescriptor.SubmodelDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
import org.eclipse.basyx.vab.core.tools.VABPathTools;
import org.junit.ClassRule;
@@ -94,7 +94,8 @@
// Register AAS and sub model descriptors in directory (push AAS descriptor to server)
// - Connect to AAS registry
- AASRegistryProxyIF regProxy = new AASHTTPRegistryProxy("http://localhost:8080/basys.examples/Components/Directory/SQL");
+ IAASRegistryService regProxy = new AASHTTPRegistryProxy(
+ "http://localhost:8080/basys.examples/Components/Directory/SQL");
// - Register AAS descriptor with AAS and sub model endpoints in registry
regProxy.register(aasURN, aasDescriptor);
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/RegisterRetrieveAASEndpoints.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/RegisterRetrieveAASEndpoints.java
index c8764e4..ebecaf8 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/RegisterRetrieveAASEndpoints.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/RegisterRetrieveAASEndpoints.java
@@ -2,16 +2,16 @@
import static org.junit.Assert.assertTrue;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.AASHTTPRegistryProxy;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
-import org.eclipse.basyx.components.proxy.registry.AASHTTPRegistryProxy;
-import org.eclipse.basyx.components.proxy.registry.AASRegistryProxyIF;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.aasdescriptor.SubmodelDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.tools.VABPathTools;
import org.junit.ClassRule;
@@ -38,9 +38,7 @@
* The connection manager uses a preconfigured directory for resolving IDs to
* network addresses, and a HTTP connector to connect to VAB objects.
*/
- protected VABConnectionManager connManager = new VABConnectionManager(
- new ExamplesPreconfiguredDirectory(),
- new HTTPConnectorProvider());
+ protected VABConnectionManager connManager = new VABConnectionManager(new ExamplesPreconfiguredDirectory(), new HTTPConnectorProvider());
/**
@@ -83,7 +81,7 @@
// Register AAS and sub model descriptors in directory (push AAS descriptor to server)
// - Connect to AAS registry
- AASRegistryProxyIF regProxy = new AASHTTPRegistryProxy("http://localhost:8080/basys.examples/Components/Directory/SQL");
+ IAASRegistryService regProxy = new AASHTTPRegistryProxy("http://localhost:8080/basys.examples/Components/Directory/SQL");
// - Register AAS descriptor with AAS and sub model endpoints in registry
regProxy.register(aasURN, aasDescriptor);
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/ConnectToAASSubModelSDK.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/ConnectToAASSubModelSDK.java
index 7435d1c..0895aaa 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/ConnectToAASSubModelSDK.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/ConnectToAASSubModelSDK.java
@@ -5,6 +5,7 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IContainerProperty;
import org.eclipse.basyx.aas.api.resources.ISingleProperty;
import org.eclipse.basyx.aas.api.resources.ISubModel;
@@ -18,8 +19,7 @@
import org.eclipse.basyx.components.servlet.submodel.SubmodelServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_Empty;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
-import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
+import org.eclipse.basyx.examples.support.directory.ExampleAASRegistry;
import org.junit.ClassRule;
import org.junit.Test;
@@ -83,23 +83,6 @@
/**
- * Create VAB connection manager backend
- *
- * The connection manager uses a preconfigured directory for resolving IDs to
- * network addresses, and a HTTP connector to connect to VAB objects.
- */
- protected VABConnectionManager connManager = new VABConnectionManager(
- // Add example specific mappings
- new ExamplesPreconfiguredDirectory()
- // - SDK connectors encapsulate relative path to sub model (/aas/submodels/sm-001)
- .addMapping("aas-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
- .addMapping("sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel"),
- // We connect via HTTP
- new HTTPConnectorProvider());
-
-
-
- /**
* The BaSyx Deployment instantiates and starts context elements for this example.
*
* This example instantiates the BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory
@@ -122,14 +105,20 @@
*/
@Test
public void accessSubModel() throws Exception {
+ // Create the AAS registry
+ ExampleAASRegistry registry = new ExampleAASRegistry();
+ registry.addSubmodelMapping("", "sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel").addAASMapping("aas-001",
+ "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel");
// Create manager using the directory stub and the HTTPConnectorProvider
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connManager);
+ ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(registry,
+ // We connect via HTTP
+ new HTTPConnectorProvider());
// Retrieve sub model (created by factory) with SDK connector
{
// Create and connect SDK connector
- ISubModel subModel = manager.retrieveSM("sm-001");
+ ISubModel subModel = manager.retrieveSM("sm-001", new ModelUrn(""));
// - Retrieve sub model values and compare to expected values
String smID = subModel.getId();
String prop1Id = subModel.getProperties().get("prop1").getId();
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/ConnectToAASSubModelVAB.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/ConnectToAASSubModelVAB.java
index 2607e40..78f8f35 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/ConnectToAASSubModelVAB.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/ConnectToAASSubModelVAB.java
@@ -5,6 +5,7 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.ISubModel;
import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
@@ -16,6 +17,7 @@
import org.eclipse.basyx.components.servlet.submodel.SubmodelServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_Empty;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
+import org.eclipse.basyx.examples.support.directory.ExampleAASRegistry;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
@@ -97,6 +99,12 @@
// We connect via HTTP
new HTTPConnectorProvider());
+ protected ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(
+ new ExampleAASRegistry()
+ .addAASMapping("aas-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
+ .addSubmodelMapping("aas-001", "sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel"),
+ // We connect via HTTP
+ new HTTPConnectorProvider());
/**
@@ -122,42 +130,36 @@
*/
@Test @SuppressWarnings("unchecked")
public void accessSubModel() throws Exception {
- // Create manager using the directory stub and the HTTPConnectorProvider
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connManager);
-
-
// Retrieve sub model (created by factory) with SDK connector
- {
- // Connect to sub model using lower-level VAB interface
- VABElementProxy connSubModel1 = this.connManager.connectToVABElement("sm-001VAB");
+ // Connect to sub model using lower-level VAB interface
+ VABElementProxy connSubModel1 = this.connManager.connectToVABElement("sm-001VAB");
- // - Read properties
- String prop1Id = (String) ((Map<String, Object>) connSubModel1.readElementValue("dataElements/prop1")).get("idShort");
- int prop1Val = (int) connSubModel1.readElementValue("dataElements/prop1/value");
- int prop3Val = (int) connSubModel1.readElementValue("dataElements/prop3/value");
- String prop2Id = (String) ((Map<String, Object>) connSubModel1.readElementValue("dataElements/prop2")).get("idShort");
- int prop211 = (int) connSubModel1.readElementValue("dataElements/prop2/dataElements/prop11/value");
- // - Change property value using VAB primitive
- connSubModel1.updateElementValue("dataElements/prop1/value", 456);
- // - Read value back using VAB primitive
- int changedProp = (int) connSubModel1.readElementValue("dataElements/prop1/value");
+ // - Read properties
+ String prop1Id = (String) ((Map<String, Object>) connSubModel1.readElementValue("dataElements/prop1"))
+ .get("idShort");
+ int prop1Val = (int) connSubModel1.readElementValue("dataElements/prop1/value");
+ int prop3Val = (int) connSubModel1.readElementValue("dataElements/prop3/value");
+ String prop2Id = (String) ((Map<String, Object>) connSubModel1.readElementValue("dataElements/prop2"))
+ .get("idShort");
+ int prop211 = (int) connSubModel1.readElementValue("dataElements/prop2/dataElements/prop11/value");
+ // - Change property value using VAB primitive
+ connSubModel1.updateElementValue("dataElements/prop1/value", 456);
+ // - Read value back using VAB primitive
+ int changedProp = (int) connSubModel1.readElementValue("dataElements/prop1/value");
-
- // Create and connect SDK connector
- ISubModel subModel = manager.retrieveSM("sm-001");
- // - Retrieve sub model values and compare to expected values
- String smID = subModel.getId();
+ // Create and connect SDK connector
+ ISubModel subModel = manager.retrieveSM("sm-001", new ModelUrn("aas-001"));
+ // - Retrieve sub model values and compare to expected values
+ String smID = subModel.getId();
-
- // Check results
- assertTrue(smID.equals("sm-001"));
- assertTrue(prop1Id.equals("prop1"));
- assertTrue(prop1Val == 234);
- assertTrue(prop3Val == 17);
- assertTrue(prop2Id.equals("prop2"));
- assertTrue(prop211 == 123);
- assertTrue(changedProp == 456);
- }
+ // Check results
+ assertTrue(smID.equals("sm-001"));
+ assertTrue(prop1Id.equals("prop1"));
+ assertTrue(prop1Val == 234);
+ assertTrue(prop3Val == 17);
+ assertTrue(prop2Id.equals("prop2"));
+ assertTrue(prop211 == 123);
+ assertTrue(changedProp == 456);
}
}
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/DynamicSubModelDeployment.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/DynamicSubModelDeployment.java
index 1498a7b..9964865 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/DynamicSubModelDeployment.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/DynamicSubModelDeployment.java
@@ -2,6 +2,7 @@
import static org.junit.Assert.assertTrue;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.ISingleProperty;
import org.eclipse.basyx.aas.api.resources.ISubModel;
import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
@@ -12,8 +13,7 @@
import org.eclipse.basyx.components.servlet.submodel.DynamicModelProviderServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
-import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
+import org.eclipse.basyx.examples.support.directory.ExampleAASRegistry;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
import org.junit.ClassRule;
import org.junit.Test;
@@ -36,13 +36,19 @@
* The connection manager uses a preconfigured directory for resolving IDs to
* network addresses, and a HTTP connector to connect to VAB objects.
*/
- protected VABConnectionManager connManager = new VABConnectionManager(
- new ExamplesPreconfiguredDirectory()
- // Add example specific mappings
- .addMapping(STATUS_SM, "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/dynamicModelRepository"),
- new HTTPConnectorProvider());
+// protected VABConnectionManager connManager = new VABConnectionManager(
+// new ExamplesPreconfiguredDirectory()
+// // Add example specific mappings
+// .addMapping(STATUS_SM, "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/dynamicModelRepository"),
+// new HTTPConnectorProvider());
+ protected ConnectedAssetAdministrationShellManager aasManager = new ConnectedAssetAdministrationShellManager(
+ new ExampleAASRegistry()
+ // Ass Example specific mappings
+ .addSubmodelMapping("", STATUS_SM, "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/dynamicModelRepository"),
+ new HTTPConnectorProvider());
+
/**
* The BaSyx Deployment instantiates and starts context elements for this example.
*
@@ -77,7 +83,7 @@
// directly to sub models, the registry needs to support this, and unique identifies (as here)
// must be used. For portability, users should connect to sub models instead via an AAS ID and
// sub model ID tuple, as illustrated in the registry examples.
- VABElementProxy connSubModel1 = this.connManager.connectToVABElement(STATUS_SM);
+ VABElementProxy connSubModel1 = this.aasManager.retrieveSM(STATUS_SM, new ModelUrn("")).getProxy();
// Create factory that helps with property creation
// - This factory creates sub model properties and ensures presence of all meta data
@@ -96,10 +102,9 @@
// Retrieve sub model with SDK connector
{
- // Create and connect SDK connector
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connManager);
+
// - Retrieve sub model
- ISubModel subModel = manager.retrieveSM(STATUS_SM);
+ ISubModel subModel = aasManager.retrieveSM(STATUS_SM, new ModelUrn(""));
// Read sub model properties
String smId = subModel.getId();
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/DynamicSubModelDeploymentHTTP.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/DynamicSubModelDeploymentHTTP.java
index 365110b..213a8a2 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/DynamicSubModelDeploymentHTTP.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/DynamicSubModelDeploymentHTTP.java
@@ -4,6 +4,7 @@
import java.util.Map;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceJSONClient;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
import org.eclipse.basyx.aas.metamodel.factory.MetaModelElementFactory;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.SubModel;
@@ -12,7 +13,6 @@
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceJSONClient;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
import org.junit.ClassRule;
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/InvokeSubModelOperationSDK.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/InvokeSubModelOperationSDK.java
index 9dc1742..c3115c1 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/InvokeSubModelOperationSDK.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/submodels/InvokeSubModelOperationSDK.java
@@ -5,6 +5,7 @@
import java.util.Map;
import java.util.function.Function;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IOperation;
import org.eclipse.basyx.aas.api.resources.ISubModel;
import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
@@ -15,8 +16,7 @@
import org.eclipse.basyx.components.servlet.submodel.SubmodelServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_Empty;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
-import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
+import org.eclipse.basyx.examples.support.directory.ExampleAASRegistry;
import org.junit.ClassRule;
import org.junit.Test;
@@ -90,14 +90,14 @@
* The connection manager uses a preconfigured directory for resolving IDs to
* network addresses, and a HTTP connector to connect to VAB objects.
*/
- protected VABConnectionManager connManager = new VABConnectionManager(
+ protected ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(
// Add example specific mappings
- new ExamplesPreconfiguredDirectory()
- // - SDK connectors encapsulate relative path to sub model (/aas/submodels/sm-001)
- .addMapping("sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel"),
+ new ExampleAASRegistry()
+ // - SDK connectors encapsulate relative path to sub model
+ // (/aas/submodels/sm-001)
+ .addSubmodelMapping("", "sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel"),
// We connect via HTTP
new HTTPConnectorProvider());
-
/**
@@ -123,14 +123,10 @@
*/
@Test
public void accessSubModel() throws Exception {
- // Create manager using the directory stub and the HTTPConnectorProvider
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connManager);
-
-
// Retrieve sub model (created by factory) with SDK connector
{
// Create and connect SDK connector
- ISubModel subModel = manager.retrieveSM("sm-001");
+ ISubModel subModel = manager.retrieveSM("sm-001", new ModelUrn(""));
// Sub model operations
Map<String, IOperation> operations = subModel.getOperations();
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASServletConnection.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASServletConnection.java
index be88a2a..142282a 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASServletConnection.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASServletConnection.java
@@ -5,6 +5,7 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
import org.eclipse.basyx.aas.api.resources.IContainerProperty;
import org.eclipse.basyx.aas.api.resources.ISingleProperty;
@@ -20,6 +21,7 @@
import org.eclipse.basyx.components.servlet.submodel.SubmodelServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_Empty;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
+import org.eclipse.basyx.examples.support.directory.ExampleAASRegistry;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
@@ -120,7 +122,22 @@
}
}
-
+ /**
+ * Create manager using the directory stub an the HTTPConnectorProvider
+ */
+ ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(
+ // Add example specific mappings
+ new ExampleAASRegistry()
+ // - SDK connectors encapsulate relative path to sub model
+ // (/aas/submodels/sm-001)
+ .addAASMapping("aas-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
+ .addSubmodelMapping("aas-001", "sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
+ // - SDK connectors encapsulate relative path to sub model
+ // (/aas/submodels/sm-001)
+ .addAASMapping("aas-001M", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual")
+ .addSubmodelMapping("aas-001M", "sm-001M", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual"),
+ // We connect via HTTP
+ new HTTPConnectorProvider());
@@ -130,14 +147,8 @@
protected VABConnectionManager connManager = new VABConnectionManager(
// Add example specific mappings
new ExamplesPreconfiguredDirectory()
- // - SDK connectors encapsulate relative path to sub model (/aas/submodels/sm-001)
- .addMapping("aas-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
- .addMapping("sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
// - VAB needs to know the relative path of the sub model that is defined by AAS meta model
.addMapping("sm-001VAB", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel/aas/submodels/sm-001")
- // - SDK connectors encapsulate relative path to sub model (/aas/submodels/sm-001)
- .addMapping("aas-001M", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual")
- .addMapping("sm-001M", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual")
// - VAB needs to know the relative path of the sub model that is defined by AAS meta model
.addMapping("sm-001MVAB", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual/aas/submodels/sm-001M"),
// We connect via HTTP
@@ -164,14 +175,13 @@
*/
@Test @SuppressWarnings("unchecked")
public void accessSubModel() throws Exception {
- // Create manager using the directory stub an the HTTPConnectorProvider
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connManager);
+
// First example - Retrieve sub model (created by factory) with SDK connector
{
// Create and connect SDK connector
- ISubModel subModel = manager.retrieveSM("sm-001");
+ ISubModel subModel = manager.retrieveSM("sm-001", new ModelUrn("aas-001"));
// - Retrieve sub model values and compare to expected values
assertTrue(subModel.getId().equals("sm-001"));
assertTrue(subModel.getProperties().get("prop1").getId().equals("prop1"));
@@ -181,7 +191,7 @@
assertTrue((int) ((ISingleProperty) ((IContainerProperty) subModel.getProperties().get("prop2")).getProperties().get("prop11")).get() == 123);
// Retrieve dummy AAS (created by factory) with SDK connector
- IAssetAdministrationShell shell = manager.retrieveAAS("aas-001");
+ IAssetAdministrationShell shell = manager.retrieveAAS(new ModelUrn("aas-001"));
// - Retrieve AAS values and compare to expected values
assertTrue(shell.getId().equals("---"));
@@ -207,7 +217,7 @@
// Second example - Retrieve sub model (created manually) with SDK connector
{
// Create and connect SDK connector
- ISubModel subModel = manager.retrieveSM("sm-001M");
+ ISubModel subModel = manager.retrieveSM("sm-001M", new ModelUrn("aas-001M"));
// - Retrieve sub model values and compare to expected values
assertTrue(subModel.getId().equals("sm-001M"));
assertTrue(subModel.getProperties().get("prop1").getId().equals("prop1"));
@@ -217,7 +227,7 @@
assertTrue((int) ((ISingleProperty) ((IContainerProperty) subModel.getProperties().get("prop2")).getProperties().get("prop11")).get() == 123);
// Retrieve dummy AAS (created by factory) with SDK connector
- IAssetAdministrationShell shell = manager.retrieveAAS("aas-001");
+ IAssetAdministrationShell shell = manager.retrieveAAS(new ModelUrn("aas-001"));
// - Retrieve AAS values and compare to expected values
assertTrue(shell.getId().equals("---"));
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASServletConnectionFull.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASServletConnectionFull.java
index 43077ac..c0907b9 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASServletConnectionFull.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASServletConnectionFull.java
@@ -5,6 +5,7 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
import org.eclipse.basyx.aas.api.resources.IContainerProperty;
import org.eclipse.basyx.aas.api.resources.ISingleProperty;
@@ -20,6 +21,7 @@
import org.eclipse.basyx.components.servlet.submodel.SubmodelServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_Empty;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
+import org.eclipse.basyx.examples.support.directory.ExampleAASRegistry;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
@@ -120,26 +122,36 @@
}
}
-
-
-
-
/**
* VAB connection manager backend
*/
protected VABConnectionManager connManager = new VABConnectionManager(
// Add example specific mappings
new ExamplesPreconfiguredDirectory()
+ // - VAB needs to know the relative path of the sub model that is defined by AAS
+ // meta model
+ .addMapping("sm-001VAB", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel/aas/submodels/sm-001")
+ // - VAB needs to know the relative path of the sub model that is defined by AAS
+ // meta model
+ .addMapping("sm-001MVAB", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual/aas/submodels/sm-001M"),
+ // We connect via HTTP
+ new HTTPConnectorProvider());
+
+
+
+ /**
+ * VAB connection manager backend
+ */
+ protected ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(
+ // Add example specific mappings
+ new ExampleAASRegistry()
// - SDK connectors encapsulate relative path to sub model (/aas/submodels/sm-001)
- .addMapping("aas-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
- .addMapping("sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
- // - VAB needs to know the relative path of the sub model that is defined by AAS meta model
- .addMapping("sm-001VAB", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel/aas/submodels/sm-001")
+ .addAASMapping("aas-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
+ .addSubmodelMapping("aas-001", "sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
+
// - SDK connectors encapsulate relative path to sub model (/aas/submodels/sm-001)
- .addMapping("aas-001M", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual")
- .addMapping("sm-001M", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual")
- // - VAB needs to know the relative path of the sub model that is defined by AAS meta model
- .addMapping("sm-001MVAB", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual/aas/submodels/sm-001M"),
+ .addAASMapping("aas-001M", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual")
+ .addSubmodelMapping("aas-001M", "sm-001M", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModelManual"),
// We connect via HTTP
new HTTPConnectorProvider());
@@ -164,14 +176,11 @@
*/
@Test @SuppressWarnings("unchecked")
public void accessSubModel() throws Exception {
- // Create manager using the directory stub an the HTTPConnectorProvider
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connManager);
-
-
// First example - Retrieve sub model (created by factory) with SDK connector
{
// Create and connect SDK connector
- ISubModel subModel = manager.retrieveSM("sm-001");
+ ISubModel subModel = manager
+ .retrieveSM("sm-001", new ModelUrn("aas-001"));
// - Retrieve sub model values and compare to expected values
assertTrue(subModel.getId().equals("sm-001"));
assertTrue(subModel.getProperties().get("prop1").getId().equals("prop1"));
@@ -181,7 +190,7 @@
assertTrue((int) ((ISingleProperty) ((IContainerProperty) subModel.getProperties().get("prop2")).getProperties().get("prop11")).get() == 123);
// Retrieve dummy AAS (created by factory) with SDK connector
- IAssetAdministrationShell shell = manager.retrieveAAS("aas-001");
+ IAssetAdministrationShell shell = manager.retrieveAAS(new ModelUrn("aas-001"));
// - Retrieve AAS values and compare to expected values
assertTrue(shell.getId().equals("---"));
@@ -207,7 +216,8 @@
// Second example - Retrieve sub model (created manually) with SDK connector
{
// Create and connect SDK connector
- ISubModel subModel = manager.retrieveSM("sm-001M");
+ ISubModel subModel = manager
+ .retrieveSM("sm-001M", new ModelUrn("aas-001M"));
// - Retrieve sub model values and compare to expected values
assertTrue(subModel.getId().equals("sm-001M"));
assertTrue(subModel.getProperties().get("prop1").getId().equals("prop1"));
@@ -217,7 +227,7 @@
assertTrue((int) ((ISingleProperty) ((IContainerProperty) subModel.getProperties().get("prop2")).getProperties().get("prop11")).get() == 123);
// Retrieve dummy AAS (created by factory) with SDK connector
- IAssetAdministrationShell shell = manager.retrieveAAS("aas-001");
+ IAssetAdministrationShell shell = manager.retrieveAAS(new ModelUrn("aas-001"));
// - Retrieve AAS values and compare to expected values
assertTrue(shell.getId().equals("---"));
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASSubModelServletConnectorConnection.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASSubModelServletConnectorConnection.java
index eae033e..7d0235c 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASSubModelServletConnectorConnection.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/connection/servlet/AASSubModelServletConnectorConnection.java
@@ -5,6 +5,7 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
import org.eclipse.basyx.aas.api.resources.IContainerProperty;
import org.eclipse.basyx.aas.api.resources.ISingleProperty;
@@ -19,6 +20,7 @@
import org.eclipse.basyx.components.servlet.submodel.SubmodelServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_Empty;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
+import org.eclipse.basyx.examples.support.directory.ExampleAASRegistry;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.junit.ClassRule;
@@ -74,18 +76,25 @@
}
}
}
+
+ /**
+ * Create manager using the directory stub an the HTTPConnectorProvider
+ */
+ ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(
+ // Add example specific mappings
+ new ExampleAASRegistry()
+ // - SDK connectors encapsulate relative path to sub model (/aas/submodels/sm-001)
+ .addAASMapping("aas-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
+ .addSubmodelMapping("aas-001", "sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel"),
+ // We connect via HTTP
+ new HTTPConnectorProvider());
-
-
/**
* VAB connection manager backend
*/
protected VABConnectionManager connManager = new VABConnectionManager(
// Add example specific mappings
new ExamplesPreconfiguredDirectory()
- // - SDK connectors encapsulate relative path to sub model (/aas/submodels/sm-001)
- .addMapping("aas-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
- .addMapping("sm-001", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel")
// - VAB needs to know the relative path of the sub model that is defined by AAS meta model
.addMapping("sm-001VAB", "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/SampleModel/aas/submodels/sm-001"),
// We connect via HTTP
@@ -111,12 +120,9 @@
*/
@Test
public void accessSubModel() throws Exception {
- // Create manager using the directory stub an the HTTPConnectorProvider
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connManager);
-
// Create and connect SDK connector
- ISubModel subModel = manager.retrieveSM("sm-001");
+ ISubModel subModel = manager.retrieveSM("sm-001", new ModelUrn("aas-001"));
// - Retrieve sub model values and compare to expected values
assertTrue(subModel.getId().equals("sm-001"));
@@ -127,7 +133,7 @@
assertTrue((int) ((ISingleProperty) ((IContainerProperty) subModel.getProperties().get("prop2")).getProperties().get("prop11")).get() == 123);
// Retrieve dummy AAS (created by factory) with SDK connector
- IAssetAdministrationShell shell = manager.retrieveAAS("aas-001");
+ IAssetAdministrationShell shell = manager.retrieveAAS(new ModelUrn("aas-001"));
// - Retrieve AAS values and compare to expected values
assertTrue(shell.getId().equals("---"));
}
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/dynamic/RunAASManualHTTPOperationsSnippet.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/dynamic/RunAASManualHTTPOperationsSnippet.java
index 34c224d..81c1fa8 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/dynamic/RunAASManualHTTPOperationsSnippet.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/aas/dynamic/RunAASManualHTTPOperationsSnippet.java
@@ -4,6 +4,7 @@
import java.util.Map;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceJSONClient;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
import org.eclipse.basyx.aas.metamodel.factory.MetaModelElementFactory;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.SubModel;
@@ -12,7 +13,6 @@
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceJSONClient;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
import org.junit.ClassRule;
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/vab/connection/RunAASManualHTTPOperationsSnippet.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/vab/connection/RunAASManualHTTPOperationsSnippet.java
index 6fb8a3b..099bac1 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/vab/connection/RunAASManualHTTPOperationsSnippet.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/undoc/vab/connection/RunAASManualHTTPOperationsSnippet.java
@@ -5,12 +5,12 @@
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceJSONClient;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
import org.eclipse.basyx.components.servlet.submodel.EmptyVABLambdaElementServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceJSONClient;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
import org.junit.ClassRule;
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/urn/ConstructURNs.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/urn/ConstructURNs.java
index eea2343..e821a27 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/urn/ConstructURNs.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/urn/ConstructURNs.java
@@ -2,7 +2,7 @@
import static org.junit.Assert.assertTrue;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.junit.Test;
diff --git a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/vab/ManualHTTPCalls.java b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/vab/ManualHTTPCalls.java
index 9f93eae..11a0ee2 100644
--- a/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/vab/ManualHTTPCalls.java
+++ b/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/vab/ManualHTTPCalls.java
@@ -5,12 +5,12 @@
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceJSONClient;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
import org.eclipse.basyx.components.servlet.submodel.EmptyVABLambdaElementServlet;
import org.eclipse.basyx.examples.contexts.BaSyxExamplesContext_1MemoryAASServer_1SQLDirectory;
import org.eclipse.basyx.examples.deployment.BaSyxDeployment;
import org.eclipse.basyx.examples.support.directory.ExamplesPreconfiguredDirectory;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceJSONClient;
import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
import org.junit.ClassRule;
diff --git a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/manager/IAssetAdministrationShellManager.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/manager/IAssetAdministrationShellManager.java
index 32e9796..5775e23 100644
--- a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/manager/IAssetAdministrationShellManager.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/manager/IAssetAdministrationShellManager.java
@@ -2,6 +2,7 @@
import java.util.Collection;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
@@ -31,7 +32,7 @@
* @return
* @throws Exception
*/
- public IAssetAdministrationShell retrieveAAS(String id) throws Exception;
+ public IAssetAdministrationShell retrieveAAS(ModelUrn aasUrn) throws Exception;
/**
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/tools/modelurn/ModelUrn.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/modelurn/ModelUrn.java
similarity index 97%
rename from components/basys.components/src/main/java/org/eclipse/basyx/tools/modelurn/ModelUrn.java
rename to sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/modelurn/ModelUrn.java
index a8dbf3a..8d4e0b2 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/tools/modelurn/ModelUrn.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/modelurn/ModelUrn.java
@@ -1,116 +1,116 @@
-package org.eclipse.basyx.tools.modelurn;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-
-/**
- * Create URNs with the format urn:<legalEntity>:<subUnit>:<subModel>:<version>:<revision>:<elementID>#<elementInstance>
- *
- * @author kuhn
- *
- */
-public class ModelUrn {
-
-
- /**
- * URN string
- */
- protected String urnString = null;
-
-
-
- /**
- * Constructor that accepts a single, raw URN
- */
- public ModelUrn(String rawURN) {
- urnString = rawURN;
- }
-
-
- /**
- * Constructor that build a URN
- */
- public ModelUrn(String legalEntity, String subUnit, String subModel, String version, String revision, String elementId, String elementInstance) {
- // Goal is: urn:<legalEntity>:<subUnit>:<subModel>:<version>:<revision>:<elementID>#<elementInstance>
- StringBuffer urnBuilder = new StringBuffer();
-
- // Start with header
- urnBuilder.append("urn:");
- // - Add URN components until instance
- if (legalEntity != null) urnBuilder.append(legalEntity); urnBuilder.append(":");
- if (subUnit != null) urnBuilder.append(subUnit); urnBuilder.append(":");
- if (subModel != null) urnBuilder.append(subModel); urnBuilder.append(":");
- if (version != null) urnBuilder.append(version); urnBuilder.append(":");
- if (revision != null) urnBuilder.append(revision); urnBuilder.append(":");
- if (elementId != null) urnBuilder.append(elementId);
- // - Add element instance, prefix with '#'
- if (elementInstance != null) urnBuilder.append("#"+elementInstance);
-
- // Build URN
- urnString = urnBuilder.toString();
- }
-
-
-
- /**
- * Get URN as string
- */
- public String getURN() {
- return urnString;
- }
-
-
- /**
- * Get URL encoded URN as string
- */
- public String getEncodedURN() {
- try {
- // Try to encode urn string
- return URLEncoder.encode(urnString, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- // Catch block
- e.printStackTrace(); return null;
- }
- }
-
-
- /**
- * Convert to string
- */
- @Override
- public String toString() {
- return getEncodedURN();
- }
-
-
- /**
- * Create a new ModelUrn by appending a String to the URN string, e.g. to create a new element instance
- */
- public ModelUrn append(String suffix) {
- // Append suffix
- return new ModelUrn(urnString + suffix);
- }
-
-
- /**
- * HashCode method - required to be able to use this class as hashmap key
- */
- @Override
- public int hashCode() {
- return urnString.hashCode();
- }
-
-
- /**
- * Check equality - required to be able to use this class as hashmap key
- */
- @Override
- public boolean equals(Object obj) {
- // Type check
- if (!(obj instanceof ModelUrn)) return false;
-
- // Check values
- return urnString.equals(((ModelUrn) obj).urnString);
- }
-}
-
+package org.eclipse.basyx.aas.api.modelurn;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+/**
+ * Create URNs with the format urn:<legalEntity>:<subUnit>:<subModel>:<version>:<revision>:<elementID>#<elementInstance>
+ *
+ * @author kuhn
+ *
+ */
+public class ModelUrn {
+
+
+ /**
+ * URN string
+ */
+ protected String urnString = null;
+
+
+
+ /**
+ * Constructor that accepts a single, raw URN
+ */
+ public ModelUrn(String rawURN) {
+ urnString = rawURN;
+ }
+
+
+ /**
+ * Constructor that build a URN
+ */
+ public ModelUrn(String legalEntity, String subUnit, String subModel, String version, String revision, String elementId, String elementInstance) {
+ // Goal is: urn:<legalEntity>:<subUnit>:<subModel>:<version>:<revision>:<elementID>#<elementInstance>
+ StringBuffer urnBuilder = new StringBuffer();
+
+ // Start with header
+ urnBuilder.append("urn:");
+ // - Add URN components until instance
+ if (legalEntity != null) urnBuilder.append(legalEntity); urnBuilder.append(":");
+ if (subUnit != null) urnBuilder.append(subUnit); urnBuilder.append(":");
+ if (subModel != null) urnBuilder.append(subModel); urnBuilder.append(":");
+ if (version != null) urnBuilder.append(version); urnBuilder.append(":");
+ if (revision != null) urnBuilder.append(revision); urnBuilder.append(":");
+ if (elementId != null) urnBuilder.append(elementId);
+ // - Add element instance, prefix with '#'
+ if (elementInstance != null) urnBuilder.append("#"+elementInstance);
+
+ // Build URN
+ urnString = urnBuilder.toString();
+ }
+
+
+
+ /**
+ * Get URN as string
+ */
+ public String getURN() {
+ return urnString;
+ }
+
+
+ /**
+ * Get URL encoded URN as string
+ */
+ public String getEncodedURN() {
+ try {
+ // Try to encode urn string
+ return URLEncoder.encode(urnString, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ // Catch block
+ e.printStackTrace(); return null;
+ }
+ }
+
+
+ /**
+ * Convert to string
+ */
+ @Override
+ public String toString() {
+ return getEncodedURN();
+ }
+
+
+ /**
+ * Create a new ModelUrn by appending a String to the URN string, e.g. to create a new element instance
+ */
+ public ModelUrn append(String suffix) {
+ // Append suffix
+ return new ModelUrn(urnString + suffix);
+ }
+
+
+ /**
+ * HashCode method - required to be able to use this class as hashmap key
+ */
+ @Override
+ public int hashCode() {
+ return urnString.hashCode();
+ }
+
+
+ /**
+ * Check equality - required to be able to use this class as hashmap key
+ */
+ @Override
+ public boolean equals(Object obj) {
+ // Type check
+ if (!(obj instanceof ModelUrn)) return false;
+
+ // Check values
+ return urnString.equals(((ModelUrn) obj).urnString);
+ }
+}
+
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/components/proxy/registry/AASHTTPRegistryProxy.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/registry/AASHTTPRegistryProxy.java
similarity index 78%
rename from components/basys.components/src/main/java/org/eclipse/basyx/components/proxy/registry/AASHTTPRegistryProxy.java
rename to sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/registry/AASHTTPRegistryProxy.java
index 147fb3d..69ab11e 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/components/proxy/registry/AASHTTPRegistryProxy.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/registry/AASHTTPRegistryProxy.java
@@ -1,16 +1,16 @@
-package org.eclipse.basyx.components.proxy.registry;
+package org.eclipse.basyx.aas.api.registry;
import java.net.URLEncoder;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.webserviceclient.WebServiceRawClient;
import org.eclipse.basyx.aas.backend.connector.MetaprotocolHandler;
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.descriptor.AASDescriptor;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
-import org.eclipse.basyx.tools.aasdescriptor.AASDescriptor;
-import org.eclipse.basyx.tools.modelurn.ModelUrn;
-import org.eclipse.basyx.tools.webserviceclient.WebServiceRawClient;
-import org.eclipse.basyx.vab.core.IDirectoryService;
+import org.eclipse.basyx.vab.core.IVABDirectoryService;
@@ -21,7 +21,7 @@
* @author kuhn
*
*/
-public class AASHTTPRegistryProxy implements AASRegistryProxyIF {
+public class AASHTTPRegistryProxy implements IAASRegistryService, IVABDirectoryService {
/**
@@ -72,6 +72,7 @@
client.post(aasRegistryURL+"/api/v1/registry", serializer.serialize(deviceAASDescriptor));
}
+
/**
* Register AAS descriptor in registry
@@ -122,7 +123,7 @@
* This function creates an AAS descriptor and registers it in the directory
*/
@Override
- public IDirectoryService addMapping(String key, String value) {
+ public IAASRegistryService addAASMapping(String key, String value) {
// Create AAS descriptor and set ID, ID type, and endpoint
AASDescriptor aasDescriptor = new AASDescriptor(key, IdentifierType.URI, value);
@@ -153,7 +154,7 @@
String jsonData = client.get(aasRegistryURL+"/api/v1/registry/"+id);
// Deserialize AAS descriptor
- // AASDescriptor aasDescriptor = new AASDescriptor((Map<String, Object>) serializer.deserialize(jsonData));
+ AASDescriptor aasDescriptor = new AASDescriptor((Map<String, Object>) serializer.deserialize(jsonData));
// Return endpoint
return jsonData;
@@ -170,18 +171,11 @@
}
- /**
- * Register hacked aas descriptor
- */
@Override
- public void register(ModelUrn aasID,
- org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor deviceAASDescriptor) {
- // Invoke delete operation of AAS registry
- try {client.delete(aasRegistryURL+"/api/v1/registry/"+URLEncoder.encode(aasID.getURN(), "UTF-8"));} catch (Exception e) {e.printStackTrace();}
-
- // Perform web service call to registry
- client.post(aasRegistryURL+"/api/v1/registry", serializer.serialize(deviceAASDescriptor));
-
+ public IVABDirectoryService addMapping(String key, String value) {
+ // Currently not implemented
+ return null;
}
+
}
diff --git a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/registry/IAASRegistryService.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/registry/IAASRegistryService.java
new file mode 100644
index 0000000..547b3ed
--- /dev/null
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/registry/IAASRegistryService.java
@@ -0,0 +1,40 @@
+package org.eclipse.basyx.aas.api.registry;
+
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+
+
+
+
+/**
+ * BaSys registry interface
+ *
+ * @author kuhn
+ *
+ */
+public interface IAASRegistryService {
+
+ public IAASRegistryService addAASMapping(String key, String value);
+ /**
+ * Register AAS descriptor in registry, delete old registration
+ */
+ public void register(ModelUrn aasID, AASDescriptor deviceAASDescriptor);
+
+ /**
+ * Only register AAS descriptor in registry
+ */
+ public void registerOnly(AASDescriptor deviceAASDescriptor);
+
+
+ /**
+ * Delete AAS descriptor from registry
+ */
+ public void delete(ModelUrn aasID);
+
+
+ /**
+ * Lookup device AAS
+ */
+ public AASDescriptor lookupAAS(ModelUrn aasID);
+}
+
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/tools/webserviceclient/WebServiceJSONClient.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/webserviceclient/WebServiceJSONClient.java
similarity index 97%
rename from components/basys.components/src/main/java/org/eclipse/basyx/tools/webserviceclient/WebServiceJSONClient.java
rename to sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/webserviceclient/WebServiceJSONClient.java
index 926390c..b0678c5 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/tools/webserviceclient/WebServiceJSONClient.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/webserviceclient/WebServiceJSONClient.java
@@ -1,4 +1,6 @@
-package org.eclipse.basyx.tools.webserviceclient;
+package org.eclipse.basyx.aas.api.webserviceclient;
+
+import java.util.Map;
import org.eclipse.basyx.aas.api.exception.ServerException;
import org.eclipse.basyx.aas.backend.http.tools.GSONTools;
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/tools/webserviceclient/WebServiceRawClient.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/webserviceclient/WebServiceRawClient.java
similarity index 98%
rename from components/basys.components/src/main/java/org/eclipse/basyx/tools/webserviceclient/WebServiceRawClient.java
rename to sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/webserviceclient/WebServiceRawClient.java
index 698016c..29dd368 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/tools/webserviceclient/WebServiceRawClient.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/api/webserviceclient/WebServiceRawClient.java
@@ -1,140 +1,140 @@
-package org.eclipse.basyx.tools.webserviceclient;
-
-import java.io.Serializable;
-
-import javax.ws.rs.ServerErrorException;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.glassfish.jersey.client.HttpUrlConnectorProvider;
-
-
-
-/**
- * Helper class that supports invocation of remote web services. The class sets up JSON parameter types for input and output parameter, but does not implement the coding.
- *
- * @author kuhn
- *
- */
-public class WebServiceRawClient implements Serializable {
-
-
- /**
- * Version of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Web service client instance for invoking service calls via web services
- */
- protected Client client = ClientBuilder.newClient();
-
-
-
-
- /**
- * Execute a web service, return JSON string
- */
- protected Builder buildRequest(Client client, String wsURL) {
- // Called URL
- WebTarget resource = client.target(wsURL);
-
- // Build request, set JSON encoding
- Builder request = resource.request();
- request.accept(MediaType.APPLICATION_JSON);
-
- // Return JSON request
- return request;
- }
-
-
- /**
- * Execute a web service, return deserialized object
- */
- public String get(String wsURL) {
- // Build web service URL
- Builder request = buildRequest(client, wsURL);
-
- // Perform request, return response
- String result = request.get(String.class);
-
- // Return result
- return result;
- }
-
-
- /**
- * Execute a web service put operation, return JSON string
- */
- public String put(String wsURL, String jsonParameter) {
- // Build web service URL
- Builder request = buildRequest(client, wsURL);
-
- // Perform request
- Response rsp = request.put(Entity.entity(jsonParameter.toString(), MediaType.APPLICATION_JSON));
-
- // Throw exception that indicates an error
- if (!((rsp.getStatus() == 0) || (rsp.getStatus() == 200) || (rsp.getStatus() == 201))) throw new ServerErrorException(rsp);
-
- // Return result
- return rsp.readEntity(String.class);
- }
-
-
-
- /**
- * Execute a web service post operation, return JSON string
- */
- public String post(String wsURL, String jsonParameter) {
- // Build web service URL
- Builder request = buildRequest(client, wsURL);
-
- // Perform request
- Response rsp = request.post(Entity.entity(jsonParameter, MediaType.APPLICATION_JSON));
-
- // Throw exception that indicates an error
- if (!((rsp.getStatus() == 0) || (rsp.getStatus() == 200) || (rsp.getStatus() == 201))) throw new ServerErrorException(rsp);
-
- // Return result
- return rsp.readEntity(String.class);
- }
-
-
-
- /**
- * Execute a web service post operation, return JSON string
- */
- public String patch(String wsURL, String action, String jsonParameter) {
- // Build and perform patch request
- Response rsp = client.target(wsURL).queryParam("action", action).request().build("PATCH", Entity.text(jsonParameter.toString())).property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true).invoke();
-
- // Throw exception that indicates an error
- if (!((rsp.getStatus() == 0) || (rsp.getStatus() == 200) || (rsp.getStatus() == 201))) throw new ServerErrorException(rsp);
-
- // Return result
- return rsp.readEntity(String.class);
- }
-
-
-
- /**
- * Execute a web service delete operation, return JSON string
- */
- public String delete(String wsURL) {
- // Build web service URL
- Builder request = buildRequest(client, wsURL);
-
- // Perform request
- String result = request.delete(String.class);
-
- // Return result
- return result;
- }
-
-}
+package org.eclipse.basyx.aas.api.webserviceclient;
+
+import java.io.Serializable;
+
+import javax.ws.rs.ServerErrorException;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.Invocation.Builder;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.glassfish.jersey.client.HttpUrlConnectorProvider;
+
+
+
+/**
+ * Helper class that supports invocation of remote web services. The class sets up JSON parameter types for input and output parameter, but does not implement the coding.
+ *
+ * @author kuhn
+ *
+ */
+public class WebServiceRawClient implements Serializable {
+
+
+ /**
+ * Version of serialized instances
+ */
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * Web service client instance for invoking service calls via web services
+ */
+ protected Client client = ClientBuilder.newClient();
+
+
+
+
+ /**
+ * Execute a web service, return JSON string
+ */
+ protected Builder buildRequest(Client client, String wsURL) {
+ // Called URL
+ WebTarget resource = client.target(wsURL);
+
+ // Build request, set JSON encoding
+ Builder request = resource.request();
+ request.accept(MediaType.APPLICATION_JSON);
+
+ // Return JSON request
+ return request;
+ }
+
+
+ /**
+ * Execute a web service, return deserialized object
+ */
+ public String get(String wsURL) {
+ // Build web service URL
+ Builder request = buildRequest(client, wsURL);
+
+ // Perform request, return response
+ String result = request.get(String.class);
+
+ // Return result
+ return result;
+ }
+
+
+ /**
+ * Execute a web service put operation, return JSON string
+ */
+ public String put(String wsURL, String jsonParameter) {
+ // Build web service URL
+ Builder request = buildRequest(client, wsURL);
+
+ // Perform request
+ Response rsp = request.put(Entity.entity(jsonParameter.toString(), MediaType.APPLICATION_JSON));
+
+ // Throw exception that indicates an error
+ if (!((rsp.getStatus() == 0) || (rsp.getStatus() == 200) || (rsp.getStatus() == 201))) throw new ServerErrorException(rsp);
+
+ // Return result
+ return rsp.readEntity(String.class);
+ }
+
+
+
+ /**
+ * Execute a web service post operation, return JSON string
+ */
+ public String post(String wsURL, String jsonParameter) {
+ // Build web service URL
+ Builder request = buildRequest(client, wsURL);
+
+ // Perform request
+ Response rsp = request.post(Entity.entity(jsonParameter, MediaType.APPLICATION_JSON));
+
+ // Throw exception that indicates an error
+ if (!((rsp.getStatus() == 0) || (rsp.getStatus() == 200) || (rsp.getStatus() == 201))) throw new ServerErrorException(rsp);
+
+ // Return result
+ return rsp.readEntity(String.class);
+ }
+
+
+
+ /**
+ * Execute a web service post operation, return JSON string
+ */
+ public String patch(String wsURL, String action, String jsonParameter) {
+ // Build and perform patch request
+ Response rsp = client.target(wsURL).queryParam("action", action).request().build("PATCH", Entity.text(jsonParameter.toString())).property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true).invoke();
+
+ // Throw exception that indicates an error
+ if (!((rsp.getStatus() == 0) || (rsp.getStatus() == 200) || (rsp.getStatus() == 201))) throw new ServerErrorException(rsp);
+
+ // Return result
+ return rsp.readEntity(String.class);
+ }
+
+
+
+ /**
+ * Execute a web service delete operation, return JSON string
+ */
+ public String delete(String wsURL) {
+ // Build web service URL
+ Builder request = buildRequest(client, wsURL);
+
+ // Perform request
+ String result = request.delete(String.class);
+
+ // Return result
+ return result;
+ }
+
+}
diff --git a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/backend/connected/ConnectedAssetAdministrationShellManager.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/backend/connected/ConnectedAssetAdministrationShellManager.java
index 92af568..ec88298 100644
--- a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/backend/connected/ConnectedAssetAdministrationShellManager.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/backend/connected/ConnectedAssetAdministrationShellManager.java
@@ -7,11 +7,16 @@
import org.eclipse.basyx.aas.api.exception.FeatureNotImplementedException;
import org.eclipse.basyx.aas.api.manager.IAssetAdministrationShellManager;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
-import org.eclipse.basyx.aas.api.resources.ISubModel;
import org.eclipse.basyx.aas.backend.connected.aas.ConnectedAssetAdministrationShell;
import org.eclipse.basyx.aas.backend.connected.aas.ConnectedSubModel;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
+import org.eclipse.basyx.vab.core.IConnectorProvider;
+import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
+import org.eclipse.basyx.vab.core.tools.VABPathTools;
/**
* Implement a AAS manager backend that communicates via HTTP/REST<br />
@@ -22,14 +27,18 @@
*/
public class ConnectedAssetAdministrationShellManager implements IAssetAdministrationShellManager {
- private VABConnectionManager manager;
+ protected IAASRegistryService aasDirectory;
+
+ protected IConnectorProvider providerProvider;
/**
* @param networkDirectoryService
* @param providerProvider
*/
- public ConnectedAssetAdministrationShellManager(VABConnectionManager manager) {
- this.manager = manager;
+ public ConnectedAssetAdministrationShellManager(IAASRegistryService directory,
+ IConnectorProvider provider) {
+ this.aasDirectory = directory;
+ this.providerProvider = provider;
}
@Override
@@ -37,13 +46,34 @@
throw new FeatureNotImplementedException();
}
- public ISubModel retrieveSM(String id) {
- return new ConnectedSubModel("/aas/submodels/" + id, manager.connectToVABElement(id));
+ public ConnectedSubModel retrieveSM(String smid, ModelUrn aasUrn) {
+ // look up AAS descriptor in the registry
+ AASDescriptor aasDescriptor = aasDirectory.lookupAAS(aasUrn);
+
+ // Get submodel descriptor from the aas descriptor
+ SubmodelDescriptor smDescriptor = aasDescriptor.getSubModelDescriptor(smid);
+
+ // get address of the submodel descriptor
+ String addr = smDescriptor.getFirstEndpoint();
+
+ // Return a new VABElementProxy
+ VABElementProxy proxy = new VABElementProxy(VABPathTools.removeAddressEntry(addr),
+ providerProvider.getConnector(addr));
+ return new ConnectedSubModel("/aas/submodels/" + smid, proxy);
}
@Override
- public ConnectedAssetAdministrationShell retrieveAAS(String id) throws Exception {
- return new ConnectedAssetAdministrationShell("/aas", manager.connectToVABElement(id), manager);
+ public ConnectedAssetAdministrationShell retrieveAAS(ModelUrn aasUrn) throws Exception {
+ // Lookup AAS descriptor
+ AASDescriptor aasDescriptor = aasDirectory.lookupAAS(aasUrn);
+
+ // Get AAD address from AAS descriptor
+ String addr = aasDescriptor.getFirstEndpoint();
+
+ // Return a new VABElementProxy
+ VABElementProxy proxy = new VABElementProxy(VABPathTools.removeAddressEntry(addr),
+ providerProvider.getConnector(addr));
+ return new ConnectedAssetAdministrationShell("/aas", proxy, this);
}
@Override
diff --git a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/backend/connected/aas/ConnectedAssetAdministrationShell.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/backend/connected/aas/ConnectedAssetAdministrationShell.java
index da8616a..f925b2c 100644
--- a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/backend/connected/aas/ConnectedAssetAdministrationShell.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/backend/connected/aas/ConnectedAssetAdministrationShell.java
@@ -13,25 +13,26 @@
import org.eclipse.basyx.aas.api.metamodel.aas.qualifier.IAdministrativeInformation;
import org.eclipse.basyx.aas.api.metamodel.aas.reference.IReference;
import org.eclipse.basyx.aas.api.metamodel.aas.security.ISecurity;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
import org.eclipse.basyx.aas.api.resources.ISubModel;
+import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.aas.backend.connected.ConnectedVABModelMap;
import org.eclipse.basyx.aas.backend.connected.facades.ConnectedHasDataSpecificationFacade;
import org.eclipse.basyx.aas.backend.connected.facades.ConnectedIdentifiableFacade;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.AssetAdministrationShell;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.Referable;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.reference.Reference;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.submodelelement.property.Property;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.eclipse.basyx.vab.core.proxy.VABElementProxy;
+
/**
* "Connected" implementation of IAssetAdministrationShell
- * @author rajashek
+ *
+ * @author rajashek, Zai Zhang
*
*/
public class ConnectedAssetAdministrationShell extends ConnectedVABModelMap<Object> implements IAssetAdministrationShell {
- VABConnectionManager manager;
+ ConnectedAssetAdministrationShellManager manager;
/**
* Constructor creating a ConnectedAAS pointing to the AAS represented by proxy
@@ -41,7 +42,8 @@
* @param proxy
* @param manager
*/
- public ConnectedAssetAdministrationShell(String path, VABElementProxy proxy, VABConnectionManager manager) {
+ public ConnectedAssetAdministrationShell(String path, VABElementProxy proxy,
+ ConnectedAssetAdministrationShellManager manager) {
super(path, proxy);
this.manager = manager;
}
@@ -54,8 +56,6 @@
*/
public ConnectedAssetAdministrationShell(ConnectedAssetAdministrationShell shell) {
super(shell.getPath(), shell.getProxy());
- this.manager = shell.manager;
-
}
@Override
@@ -162,7 +162,7 @@
@Override
public String getId() {
- return (String)getProxy().readElementValue(constructPath(Referable.IDSHORT));
+ return (String) getProxy().readElementValue(constructPath(Referable.IDSHORT));
}
@Override
@@ -180,21 +180,19 @@
try {
// Java getSubmodels
- refs = (Set<Map<?, ?>>) getProxy().readElementValue(constructPath(AssetAdministrationShell.SUBMODEL));
+ refs = (Set<Map<?, ?>>) getProxy().readElementValue(constructPath("submodel"));
for (Map<?, ?> key : refs) {
- String id = (String) ((Map<?, ?>) ((List<?>) key.get(Reference.KEY)).get(0)).get(Property.VALUE);
- VABElementProxy elem = manager.connectToVABElement(id);
- ISubModel sm = new ConnectedSubModel("/aas/submodels/" + id, elem);
+ String id = (String) ((Map<?, ?>) ((List<?>) key.get("keys")).get(0)).get("value");
+ ISubModel sm = manager.retrieveSM(id, new ModelUrn(getId()));
ret.put(id, sm);
}
} catch (ClassCastException e) {
System.out.println("Cast failed... trying c# get submodels");
// c# getSubmodels
- refs = (Set<Map<?, ?>>) getProxy().readElementValue(constructPath(AssetAdministrationShell.SUBMODELS));
+ refs = (Set<Map<?, ?>>) getProxy().readElementValue(constructPath("submodels"));
for (Map<?, ?> key : refs) {
- String id = (String) key.get(Referable.IDSHORT);
- VABElementProxy elem = manager.connectToVABElement(id);
- ISubModel sm = new ConnectedSubModel("/aas/submodels/" + id, elem);
+ String id = (String) key.get("idShort");
+ ISubModel sm = manager.retrieveSM(id, new ModelUrn(getId()));
ret.put(id, sm);
}
}
diff --git a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/impl/services/PreconfiguredDirectory.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/impl/services/PreconfiguredDirectory.java
index 68f0b0e..1676494 100644
--- a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/impl/services/PreconfiguredDirectory.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/impl/services/PreconfiguredDirectory.java
@@ -3,7 +3,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.basyx.vab.core.IDirectoryService;
+import org.eclipse.basyx.vab.core.IVABDirectoryService;
@@ -13,7 +13,7 @@
* @author kuhn
*
*/
-public class PreconfiguredDirectory implements IDirectoryService {
+public class PreconfiguredDirectory implements IVABDirectoryService {
/**
@@ -45,7 +45,7 @@
* Add a mapping to directory
*/
@Override
- public IDirectoryService addMapping(String key, String value) {
+ public IVABDirectoryService addMapping(String key, String value) {
keyToValue.put(key, value);
// Return 'this' instance
diff --git a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/AASDescriptor.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/AASDescriptor.java
index 5ff3818..8aa3140 100644
--- a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/AASDescriptor.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/AASDescriptor.java
@@ -8,10 +8,13 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+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.Identifier;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.Identifiable;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.Referable;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.parts.Asset;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.AdministrativeInformation;
/**
@@ -37,19 +40,19 @@
// Invoke default constructor
- put(Referable.IDSHORT, aas.getId());
- put(AssetAdministrationShell.SUBMODELS, new LinkedList<SubmodelDescriptor>());
+ put("idShort", aas.getId());
+ put("submodels", new LinkedList<SubmodelDescriptor>());
// Add identification and end point information
Identifier identifier = new Identifier();
identifier.setIdType(aas.getIdentification().getIdType());
identifier.setId(aas.getIdentification().getId());
- put(Identifiable.IDENTIFICATION, identifier);
+ put("identification", identifier);
HashMap<String, String> endpointWrapper = new HashMap<String, String>();
- endpointWrapper.put(AssetAdministrationShell.TYPE, endpointType);
- endpointWrapper.put(AssetAdministrationShell.ADDRESS, endpoint + "/aas");
+ endpointWrapper.put("type", endpointType);
+ endpointWrapper.put("address", endpoint + "/aas");
put("endpoints", Arrays.asList(endpointWrapper));
}
@@ -61,20 +64,26 @@
// Invoke default constructor
- put(Referable.IDSHORT, aas.getId());
- put(AssetAdministrationShell.SUBMODELS, new LinkedList<SubmodelDescriptor>());
+ put("idShort", aas.getId());
+ put("submodels", new LinkedList<SubmodelDescriptor>());
// Add identification and end point information
Identifier identifier = new Identifier();
identifier.setIdType(aas.getIdentification().getIdType());
identifier.setId(aas.getIdentification().getId());
- put(Identifiable.IDENTIFICATION, identifier);
+ put("identification", identifier);
- put(AssetAdministrationShell.ENDPOINTS, aas.getEndpoints());
+ put("endpoints", aas.getEndpoints());
}
-
+ /**
+ * Create a new AAS descriptor with minimal information
+ */
+ public AASDescriptor(ModelUrn urn, String aasSrvURL) {
+ // Invoke default constructor
+ this(urn.getURN(), IdentifierType.URI, aasSrvURL + "/aas/submodels/aasRepository/" + urn.getEncodedURN());
+ }
/**
* Create AAS descriptor from existing hash map
@@ -84,15 +93,44 @@
this.putAll(map);
}
+ /**
+ * Default constructor
+ */
+ public AASDescriptor() {
+ // Add members
+ put("identification", new Identifier());
+ put("metaData", new HashMap<String, Object>());
+ put("administration", new AdministrativeInformation());
+ put("idShort", new String(""));
+ put("category", new String(""));
+ put("descriptions", new LinkedList<Description>());
+ put("asset", new Asset());
+ put("submodels", new LinkedList<SubmodelDescriptor>());
+ put("endpoints", new LinkedList<String>());
+ }
+ /**
+ * Create a new AAS descriptor with minimal information
+ */
+ @SuppressWarnings("unchecked")
+ public AASDescriptor(String id, String idType, String endpoint) {
+ // Invoke default constructor
+ this();
+
+ // Add identification and end point information
+ ((Identifier) get("identification")).setIdType(idType);
+ ((Identifier) get("identification")).setId(id);
+ ((List<String>) get("endpoints")).add(endpoint);
+ }
+
/**
* Return AAS ID
*/
@SuppressWarnings("unchecked")
public String getId() {
- return new Identifier((Map<String, Object>) get(Identifiable.IDENTIFICATION)).getId();
+ return new Identifier((Map<String, Object>) get("identification")).getId();
}
@@ -101,7 +139,7 @@
*/
@SuppressWarnings("unchecked")
public String getIdType() {
- return new Identifier((Map<String, Object>) get(Identifiable.IDENTIFICATION)).getIdType();
+ return new Identifier((Map<String, Object>) get("identification")).getIdType();
}
@@ -110,25 +148,16 @@
*/
@SuppressWarnings("unchecked")
public String getFirstEndpoint() {
- Object e = get(AssetAdministrationShell.ENDPOINTS);
+
+ Object e = get("endpoints");
// Extract String from endpoint in set and list representation
String endpoint = null;
if (e instanceof List<?>) {
- List<String> list = (List<String>) e;
- if (list.size() == 0) {
- return null;
- } else {
- return list.get(0);
- }
+ endpoint = ((List<String>) e).get(0);
} else if (e instanceof HashSet<?>) {
- HashSet<Map<String, Object>> set = (HashSet<Map<String, Object>>) e;
- if (set.size() == 0) {
- return null;
- } else {
- return (String) set.iterator().next().get(AssetAdministrationShell.ADDRESS);
- }
+ endpoint = (String) ((HashSet<VABModelMap<Object>>) e).iterator().next().getPath("address");
} else {
- endpoint = null;
+ endpoint = "not found";
}
return endpoint;
@@ -141,7 +170,7 @@
@SuppressWarnings("unchecked")
public AASDescriptor addSubmodelDescriptor(SubmodelDescriptor desc) {
// Sub model descriptors are stored in a list
- Collection<Map<String, Object>> submodelDescriptors = (Collection<Map<String, Object>>) get(AssetAdministrationShell.SUBMODELS);
+ Collection<Map<String, Object>> submodelDescriptors = (Collection<Map<String, Object>>) get("submodels");
// Add new sub model descriptor to list
submodelDescriptors.add(desc);
@@ -150,8 +179,25 @@
return this;
}
+ /**
+ * Add a sub model descriptor - simplified operation with default fields
+ *
+ * @param urn URN of sub model
+ */
+ public AASDescriptor addSubmodelDescriptor(ModelUrn urn, String aasSrvURL) {
+ // Add sub model descriptor
+ addSubmodelDescriptor(new SubmodelDescriptor(urn.getURN(), IdentifierType.URI, aasSrvURL+"/aas/submodels/aasRepository/"+urn.getEncodedURN()));
+
+ // Return 'this' reference
+ return this;
+ }
-
+ /**
+ * Get a specific sub model descriptor
+ */
+ public SubmodelDescriptor getSubModelDescriptor(ModelUrn subModelId) {
+ return getSubModelDescriptor(subModelId.getURN());
+ }
/**
* Get a specific sub model descriptor
@@ -159,7 +205,7 @@
@SuppressWarnings("unchecked")
public SubmodelDescriptor getSubModelDescriptor(String subModelId) {
// Sub model descriptors are stored in a list
- Collection<Map<String, Object>> submodelDescriptorMaps = (Collection<Map<String, Object>>) get(AssetAdministrationShell.SUBMODELS);
+ Collection<Map<String, Object>> submodelDescriptorMaps = (Collection<Map<String, Object>>) get("submodels");
System.out.println("Checking submodel desc");
@@ -183,7 +229,7 @@
public String getAASId() {
- return (String) get(Referable.IDSHORT);
+ return (String) get("idShort");
}
}
diff --git a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aasdescriptor/Description.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/Description.java
similarity index 84%
rename from components/basys.components/src/main/java/org/eclipse/basyx/tools/aasdescriptor/Description.java
rename to sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/Description.java
index 3d90e25..8b46c93 100644
--- a/components/basys.components/src/main/java/org/eclipse/basyx/tools/aasdescriptor/Description.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/Description.java
@@ -1,31 +1,31 @@
-package org.eclipse.basyx.tools.aasdescriptor;
-
-import java.util.HashMap;
-
-
-
-/**
- * AAS description class
- *
- * @author kuhn
- *
- */
-public class Description extends HashMap<String, Object> {
-
-
- /**
- * Version of serialized instances
- */
- private static final long serialVersionUID = 1L;
-
-
-
- /**
- * Constructor
- */
- public Description() {
- // Add qualifiers
- put("language", "");
- put("text", "");
- }
-}
+package org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor;
+
+import java.util.HashMap;
+
+
+
+/**
+ * AAS description class
+ *
+ * @author kuhn
+ *
+ */
+public class Description extends HashMap<String, Object> {
+
+
+ /**
+ * Version of serialized instances
+ */
+ private static final long serialVersionUID = 1L;
+
+
+
+ /**
+ * Constructor
+ */
+ public Description() {
+ // Add qualifiers
+ put("language", "");
+ put("text", "");
+ }
+}
diff --git a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/SubmodelDescriptor.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/SubmodelDescriptor.java
index e3c1c6e..91bc27a 100644
--- a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/SubmodelDescriptor.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/aas/metamodel/hashmap/aas/descriptor/SubmodelDescriptor.java
@@ -2,14 +2,14 @@
import java.util.Arrays;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-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.Identifier;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.Identifiable;
-import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.Referable;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.AdministrativeInformation;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.qualifier.haskind.Kind;
@@ -31,25 +31,56 @@
/**
+ * Default constructor
+ */
+ public SubmodelDescriptor() {
+ // Add members
+ put("identification", new Identifier());
+ put("metaData", new HashMap<String, Object>());
+ put("administration", new AdministrativeInformation());
+ put("idShort", new String(""));
+ put("category", new String(""));
+ put("descriptions", new LinkedList<Description>());
+ put("semanticId", new Identifier());
+ put("kind", Kind.Instance);
+ put("endpoints", new LinkedList<String>());
+ }
+
+
+ /**
+ * Create a new sub model descriptor with minimal information
+ */
+ @SuppressWarnings("unchecked")
+ public SubmodelDescriptor(String id, String idType, String endpoint) {
+ // Invoke default constructor
+ this();
+
+ // Add identification and end point information
+ ((Identifier) get("identification")).setIdType(idType);
+ ((Identifier) get("identification")).setId(id);
+ ((List<String>) get("endpoints")).add(endpoint);
+ }
+
+ /**
* Create a new sub model descriptor with minimal information
*/
public SubmodelDescriptor(SubModel submodel, String endpoint, String endpointType) {
// Invoke default constructor
//this();
- put(Referable.IDSHORT, submodel.getId());
+ put("idShort", submodel.getId());
// Add identification and end point information
Identifier identifier = new Identifier();
identifier.setIdType(submodel.getIdentification().getIdType());
identifier.setId(submodel.getIdentification().getId());
- put(Identifiable.IDENTIFICATION, identifier);
+ put("identification", identifier);
HashMap<String, String> endpointWrapper = new HashMap<String, String>();
- endpointWrapper.put(AssetAdministrationShell.TYPE, endpointType);
- endpointWrapper.put(AssetAdministrationShell.ADDRESS, endpoint);
+ endpointWrapper.put("type", endpointType);
+ endpointWrapper.put("address", endpoint);
- put(AssetAdministrationShell.ENDPOINTS, Arrays.asList(endpointWrapper));
+ put("endpoints", Arrays.asList(endpointWrapper));
}
/**
@@ -64,15 +95,7 @@
* Return sub model ID
*/
public String getId() {
- return (String) get(Referable.IDSHORT);
- }
-
- /**
- * Return sub model identification ID
- */
- @SuppressWarnings("unchecked")
- public String getIdentificationId() {
- return new Identifier((Map<String, Object>) get(Identifiable.IDENTIFICATION)).getId();
+ return new Identifier((Map<String, Object>) get("identification")).getId();
}
@@ -81,7 +104,7 @@
*/
@SuppressWarnings("unchecked")
public String getIdType() {
- return new Identifier((Map<String, Object>) get(Identifiable.IDENTIFICATION)).getIdType();
+ return new Identifier((Map<String, Object>) get("identification")).getIdType();
}
@@ -90,7 +113,7 @@
*/
@SuppressWarnings("unchecked")
public String getFirstEndpoint() {
- return ((List<String>) get(AssetAdministrationShell.ENDPOINTS)).get(0);
+ return ((List<String>) get("endpoints")).get(0);
}
}
diff --git a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/vab/core/IDirectoryService.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/vab/core/IVABDirectoryService.java
similarity index 80%
rename from sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/vab/core/IDirectoryService.java
rename to sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/vab/core/IVABDirectoryService.java
index c6bb43d..122f5b5 100644
--- a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/vab/core/IDirectoryService.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/vab/core/IVABDirectoryService.java
@@ -10,13 +10,13 @@
* @author kuhn
*
*/
-public interface IDirectoryService {
+public interface IVABDirectoryService {
/**
* Add a mapping to directory
*/
- public IDirectoryService addMapping(String key, String value);
+ public IVABDirectoryService addMapping(String key, String value);
/**
diff --git a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/vab/core/VABConnectionManager.java b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/vab/core/VABConnectionManager.java
index 9e95074..1ffc280 100644
--- a/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/vab/core/VABConnectionManager.java
+++ b/sdks/java/basys.sdk/src/main/java/org/eclipse/basyx/vab/core/VABConnectionManager.java
@@ -17,7 +17,7 @@
/**
* Directory service reference
*/
- protected IDirectoryService directoryService = null;
+ protected IVABDirectoryService directoryService = null;
/**
@@ -35,7 +35,7 @@
* @param providerProvider
* used to get the appropriate connector for the selected address
*/
- public VABConnectionManager(IDirectoryService networkDirectoryService, IConnectorProvider providerProvider) {
+ public VABConnectionManager(IVABDirectoryService networkDirectoryService, IConnectorProvider providerProvider) {
// Set directory service reference
directoryService = networkDirectoryService;
diff --git a/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/regression/aas/backend/connected/TestConnectedAssetAdministrationShell.java b/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/regression/aas/backend/connected/TestConnectedAssetAdministrationShell.java
index b789d70..c211edb 100644
--- a/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/regression/aas/backend/connected/TestConnectedAssetAdministrationShell.java
+++ b/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/regression/aas/backend/connected/TestConnectedAssetAdministrationShell.java
@@ -8,6 +8,8 @@
import java.util.HashSet;
import java.util.Set;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
import org.eclipse.basyx.aas.api.resources.ISingleProperty;
import org.eclipse.basyx.aas.api.resources.ISubModel;
@@ -18,8 +20,12 @@
import org.eclipse.basyx.aas.metamodel.factory.MetaModelElementFactory;
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.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
import org.eclipse.basyx.aas.metamodel.hashmap.aas.submodelelement.property.Property;
-import org.eclipse.basyx.testsuite.support.vab.stub.VABConnectionManagerStub;
+import org.eclipse.basyx.testsuite.support.vab.stub.AASRegistryStub;
+import org.eclipse.basyx.testsuite.support.vab.stub.ConnectorProviderStub;
import org.junit.Before;
import org.junit.Test;
@@ -63,16 +69,28 @@
provider.addSubmodel(smId, new VirtualPathModelProvider(TypeDestroyer.destroyType(sm)));
provider.setAssetAdministrationShell(new VirtualPathModelProvider(TypeDestroyer.destroyType(aas)));
- // Add the AAS provider to the ConnectionManagerStub
- VABConnectionManagerStub connectionStub = new VABConnectionManagerStub();
- connectionStub.addProvider(aasId,"", provider);
- connectionStub.addProvider(smId, "", provider);
-
- // Create connection manager using the dummy
- ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(connectionStub);
+ // Create AAS registry
+ IAASRegistryService registry = new AASRegistryStub();
+ // Create AAS Descriptor
+ AASDescriptor aasDescriptor = new AASDescriptor(aasId, IdentifierType.URI, "");
+ // Create Submodel Descriptor
+ SubmodelDescriptor smDescriptor = new SubmodelDescriptor(smId, IdentifierType.URI, "");
+ // Add Submodel descriptor to aas descriptor
+ aasDescriptor.addSubmodelDescriptor(smDescriptor);
- // Create ConnectedAssetAdministrationShell
- connectedAAS = manager.retrieveAAS(aasId);
+ registry.register(new ModelUrn(aasId), aasDescriptor);
+
+ // Create connector provider stub, map address to provider
+ ConnectorProviderStub connectorProvider = new ConnectorProviderStub();
+ connectorProvider.addMapping(aasDescriptor.getFirstEndpoint(), provider);
+ connectorProvider.addMapping(smDescriptor.getFirstEndpoint(), provider);
+
+ // Create connection manager using the dummy
+ ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(registry,
+ connectorProvider);
+
+ // Create ConnectedAssetAdministrationShell
+ connectedAAS = manager.retrieveAAS(new ModelUrn(aasId));
}
/**
diff --git a/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/regression/aas/backend/http/TestAASHTTP.java b/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/regression/aas/backend/http/TestAASHTTP.java
index 1af0ead..916e45e 100644
--- a/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/regression/aas/backend/http/TestAASHTTP.java
+++ b/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/regression/aas/backend/http/TestAASHTTP.java
@@ -5,6 +5,7 @@
import java.util.Map;
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
import org.eclipse.basyx.aas.api.resources.IAssetAdministrationShell;
import org.eclipse.basyx.aas.api.resources.IOperation;
import org.eclipse.basyx.aas.api.resources.IProperty;
@@ -12,11 +13,14 @@
import org.eclipse.basyx.aas.api.resources.ISubModel;
import org.eclipse.basyx.aas.backend.connected.ConnectedAssetAdministrationShellManager;
import org.eclipse.basyx.aas.backend.connector.http.HTTPConnectorProvider;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.SubmodelDescriptor;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.identifier.IdentifierType;
import org.eclipse.basyx.testsuite.support.backend.http.tools.stubs.servlets.StubAASServlet;
import org.eclipse.basyx.testsuite.support.backend.servers.AASHTTPServerResource;
import org.eclipse.basyx.testsuite.support.backend.servers.context.SdkRegressionContext;
+import org.eclipse.basyx.testsuite.support.vab.stub.AASRegistryStub;
import org.eclipse.basyx.testsuite.support.vab.stub.DirectoryServiceStub;
-import org.eclipse.basyx.vab.core.VABConnectionManager;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
@@ -48,8 +52,24 @@
directory.addMapping(StubAASServlet.aasId, "http://localhost:8080/basys.sdk/Testsuite/StubAAS/");
directory.addMapping(StubAASServlet.smId, "http://localhost:8080/basys.sdk/Testsuite/StubAAS/");
+ AASRegistryStub registry = new AASRegistryStub();
+
+ // Create aas descriptor for the aas registry
+ AASDescriptor aasDesriptor = new AASDescriptor(StubAASServlet.aasId, IdentifierType.URI,
+ "http://localhost:8080/basys.sdk/Testsuite/StubAAS/");
+
+ // Create the submodel descriptor
+ SubmodelDescriptor submodelDescriptor = new SubmodelDescriptor(StubAASServlet.smId, IdentifierType.URI,
+ "http://localhost:8080/basys.sdk/Testsuite/StubAAS/");
+
+ // add submodel descriptor to the aas descriptor
+ aasDesriptor.addSubmodelDescriptor(submodelDescriptor);
+
+ // register the aas in the registry
+ registry.register(new ModelUrn(StubAASServlet.aasId), aasDesriptor);
+
// Create manager using the directory stub an the HTTPConnectorProvider
- manager = new ConnectedAssetAdministrationShellManager(new VABConnectionManager(directory, new HTTPConnectorProvider()));
+ manager = new ConnectedAssetAdministrationShellManager(registry, new HTTPConnectorProvider());
}
/**
@@ -60,7 +80,7 @@
@Test
public void testAAS() throws Exception {
// Retrieve AAS
- IAssetAdministrationShell shell = manager.retrieveAAS(StubAASServlet.aasId);
+ IAssetAdministrationShell shell = manager.retrieveAAS(new ModelUrn(StubAASServlet.aasId));
// Check id
assertEquals(StubAASServlet.aasId, shell.getId());
@@ -81,7 +101,7 @@
@Test
public void testSubModel() throws Exception {
// Retrieve SubModel
- ISubModel sm = manager.retrieveSM(StubAASServlet.smId);
+ ISubModel sm = manager.retrieveSM(StubAASServlet.smId, new ModelUrn(StubAASServlet.aasId));
// Check id
assertEquals(StubAASServlet.smId, sm.getId());
diff --git a/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/support/vab/stub/AASRegistryStub.java b/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/support/vab/stub/AASRegistryStub.java
new file mode 100644
index 0000000..35f061e
--- /dev/null
+++ b/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/support/vab/stub/AASRegistryStub.java
@@ -0,0 +1,45 @@
+package org.eclipse.basyx.testsuite.support.vab.stub;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.basyx.aas.api.modelurn.ModelUrn;
+import org.eclipse.basyx.aas.api.registry.IAASRegistryService;
+import org.eclipse.basyx.aas.metamodel.hashmap.aas.descriptor.AASDescriptor;
+
+public class AASRegistryStub implements IAASRegistryService {
+ protected Map<String, AASDescriptor> descriptorMap = new HashMap<>();
+
+ @Override
+ public IAASRegistryService addAASMapping(String key, String value) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void register(ModelUrn aasID, AASDescriptor deviceAASDescriptor) {
+ if (descriptorMap.containsKey(aasID.getEncodedURN())) {
+ descriptorMap.remove(aasID.getEncodedURN());
+ }
+
+ descriptorMap.put(aasID.getEncodedURN(), deviceAASDescriptor);
+ }
+
+ @Override
+ public void registerOnly(AASDescriptor deviceAASDescriptor) {
+ descriptorMap.put(deviceAASDescriptor.getId(), deviceAASDescriptor);
+ }
+
+ @Override
+ public void delete(ModelUrn aasID) {
+ descriptorMap.remove(aasID.getEncodedURN());
+
+ }
+
+ @Override
+ public AASDescriptor lookupAAS(ModelUrn aasID) {
+
+ return descriptorMap.get(aasID.getEncodedURN());
+ }
+
+}
diff --git a/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/support/vab/stub/DirectoryServiceStub.java b/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/support/vab/stub/DirectoryServiceStub.java
index 22144f9..0450eb6 100644
--- a/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/support/vab/stub/DirectoryServiceStub.java
+++ b/sdks/java/basys.sdk/src/test/java/org/eclipse/basyx/testsuite/support/vab/stub/DirectoryServiceStub.java
@@ -3,7 +3,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.basyx.vab.core.IDirectoryService;
+import org.eclipse.basyx.vab.core.IVABDirectoryService;
/**
* A simple Directory Service stub providing a mapping based on a Map
@@ -11,7 +11,7 @@
* @author schnicke
*
*/
-public class DirectoryServiceStub implements IDirectoryService {
+public class DirectoryServiceStub implements IVABDirectoryService {
private Map<String, String> addressMap = new HashMap<>();
@Override
@@ -30,7 +30,7 @@
}
@Override
- public IDirectoryService addMapping(String key, String value) {
+ public IVABDirectoryService addMapping(String key, String value) {
addressMap.put(key, value);
// Return 'this' referenced