From 69b7f1c64255f58cff5ff7629f72321dda983864 Mon Sep 17 00:00:00 2001 From: Patient NTUMBA <pntumba@inria.fr> Date: Thu, 20 Jul 2017 14:03:28 +0200 Subject: [PATCH] Update project architecture --- bc-generators/artifact-generators/pom.xml | 29 +- .../vsb/artifact/generators/Generator.java | 5 +- .../vsb/artifact/generators/JarGenerator.java | 427 ++++++++------- .../vsb/artifact/generators/WarGenerator.java | 7 +- .../src/main/webapp/config/example.json | 0 bc-manager/pom.xml | 5 + .../vsb/bc/manager/BcManagerRestService.java | 2 +- .../{ => eclipse}/BindingComponent.java | 22 +- bc-manager/src/main/resources/bridge.gidl | 2 +- .../main/resources/config_block1_interface_1 | 0 .../main/resources/config_block2_interface_1 | 1 + .../src/main/resources/template-config.json | 4 + .../examples/bc-gui/.gitignore | 0 .../examples/bc-gui/pom.xml | 0 .../vsb/bcs/gui/ConversionWindow.java | 0 .../chorevolution/vsb/bcs/bc_gui/AppTest.java | 0 .../binding-components}/examples/pom.xml | 0 .../examples/rest-bc/.gitignore | 0 .../examples/rest-bc/pom.xml | 0 .../src/main/java/org/rest/bc/BCStarter.java | 0 .../src/test/java/org/rest/bc/AppTest.java | 0 .../examples/weather-bc/pom.xml | 0 .../vsb/bcs/weather/BCStarter.java | 0 .../vsb/bcs/weather/StarterMain.java | 0 .../vsb/bcs/weather/bc/BindingComponent.java | 0 .../vsb/bcs/weather/bc/Location.java | 0 .../vsb/bcs/weather/bc/RestServer.java | 0 .../vsb/bcs/weather/bc/RootClass.java | 0 .../vsb/bcs/weather/bc/WeatherType.java | 0 .../one-way-bc/Californium.properties | 0 .../binding-components}/one-way-bc/pom.xml | 0 .../BcCoapToDpwsSubcomponentEndpoint.java | 0 .../vsb/coap_to_dpws/BindingComponent.java | 0 .../vsb/coap_to_dpws/CoapSendRequest.java | 0 .../BcCoapToMqttSubcomponentEndpoint.java | 0 .../vsb/coap_to_mqtt/BindingComponent.java | 0 .../vsb/coap_to_mqtt/Publisher.java | 0 .../BcCoapToRestSubcomponentEndpoint.java | 0 .../vsb/coap_to_rest/BindingComponent.java | 0 ...BcCoapToWebSocketSubcomponentEndpoint.java | 0 .../coap_to_websocket/BindingComponent.java | 0 .../BCDpwsSubcomponentEndpoint.java | 0 .../vsb/dpws_to_coap/BindingComponent.java | 0 .../BCDpwsToMqttSubcomponentEndpoint.java | 0 .../vsb/dpws_to_mqtt/BindingComponent.java | 0 .../BCDpwsToRestSubcomponentEndpoint.java | 0 .../vsb/dpws_to_rest/BindingComponent.java | 0 .../BCMqttToCoapSubcomponentEndpoint.java | 0 .../vsb/mqtt_to_coap/BindingComponent.java | 0 .../BCMqttToDpwsSubcomponentEndpoint.java | 0 .../vsb/mqtt_to_dpws/BindingComponent.java | 0 .../BCMqttToRestSubcomponentEndpoint.java | 0 .../vsb/mqtt_to_rest/BindingComponent.java | 0 ...BcMqttToWebsocketSubcomponentEndpoint.java | 0 .../mqtt_to_websocket/BindingComponent.java | 0 .../vsb/rest_to_coap/BindingComponent.java | 0 .../RestToCoapSubcomponentEndpoint.java | 0 .../vsb/rest_to_dpws/BindingComponent.java | 0 .../RestToDpwsSubcomponentEndpoint.java | 0 .../vsb/rest_to_mqtt/BindingComponent.java | 0 .../RestToMqttSubcomponentEndpoint.java | 0 ...BcMqttToWebsocketSubcomponentEndpoint.java | 0 .../rest_to_websocket/BindingComponent.java | 0 ...BcWebsocketToCoapSubcomponentEndpoint.java | 0 .../websocket_to_coap/BindingComponent.java | 0 ...BcWebsocketToDpwsSubcomponentEndpoint.java | 0 .../websocket_to_dpws/BindingComponent.java | 0 ...BcWebsocketToMqttSubcomponentEndpoint.java | 0 .../websocket_to_mqtt/BindingComponent.java | 0 ...BcWebsocketToRestSubcomponentEndpoint.java | 0 .../websocket_to_rest/BindingComponent.java | 0 .../resources/Coapconfig_block1_interface_1 | 0 .../resources/Coapconfig_block2_interface_1 | 1 + .../CoapserviceDescription-800bytes.gxdl | 0 .../resources/CoapserviceDescription.gidl | 0 .../resources/CoapserviceDescription.gxdl | 0 .../CoapserviceDescription284bytes.gxdl | 0 .../resources/Dpwsconfig_block1_interface_1 | 0 .../resources/Dpwsconfig_block2_interface_1 | 0 .../resources/DpwsserviceDescription.gxdl | 0 .../resources/Mqttconfig_block1_interface_1 | 0 .../resources/Mqttconfig_block2_interface_1 | 0 .../MqttserviceDescription-284bytes.gxdl | 0 .../MqttserviceDescription-800bytes.gxdl | 0 .../resources/MqttserviceDescription.gidl | 0 .../resources/MqttserviceDescription.gxdl | 0 .../resources/Restconfig_block1_interface_1 | 0 .../resources/Restconfig_block2_interface_1 | 0 .../RestserviceDescription-800bytes.gxdl | 0 .../resources/RestserviceDescription.gidl | 0 .../resources/RestserviceDescription.gxdl | 0 .../RestserviceDescription284bytes.gxdl | 0 .../WebSocketconfig_block1_interface_1 | 0 .../WebSocketconfig_block2_interface_1 | 0 .../WebSocketserviceDescription-5000.gxdl | 0 .../WebSocketserviceDescription.gxdl | 0 .../manual/binding/components/AppTest.java | 0 .../binding-components}/pom.xml | 8 +- examples-for-test/pom.xml | 4 +- .../scenarios-end-to-end-test/pom.xml | 135 +++++ .../stinvaddress/SetInvAddressClient.java | 29 + .../trafficlight/BindingComponentManager.java | 33 ++ .../trafficlight/bc/BindingComponent.java | 46 ++ .../test/trafficlight/bc/TrafficLight.java | 48 ++ .../mock/RestLegacyServiceMock.java | 38 ++ .../trafficlight/mock/SoapClientMock.java | 5 + .../JaxRsTrafficLightResource.java | 51 ++ .../mock/restservice/LightPersistence.java | 18 + .../RestTrafficLightService-GMDL.json | 66 +++ .../mock/restservice/TrafficLight.java | 25 + .../test/weather/BindingComponentManager.java | 34 ++ .../vsb/test/weather/bc/BindingComponent.java | 39 ++ .../vsb/test/weather/bc/ComplexType.java | 40 ++ .../vsb/test/weather/bc/Location.java | 40 ++ .../vsb/test/weather/bc/WeatherType.java | 178 +++++++ .../weather/restletclient/ComplexType.java | 40 ++ .../test/weather/restletclient/Location.java | 40 ++ .../weather/restletclient/RestClient.java | 104 ++++ .../weather/restletclient/WeatherType.java | 178 +++++++ .../src/main/resources/BaseService.wsdl | 56 ++ .../src/main/resources/wsdl-to-code.txt | 5 + .../vsb/gmdl/utils/PathResolver.java | 15 +- .../target2/localhost/KahaDB/db.data | Bin 49152 -> 49152 bytes .../target2/localhost/KahaDB/db.redo | Bin 45136 -> 45136 bytes .../target2/localhost/KahaDB/lock | Bin 8 -> 8 bytes .../str/websockets/WebSocketConsummer.java | 2 +- pom.xml | 56 +- .../gm/protocols/coap/BcCoapSubcomponent.java | 12 +- protocol-pool/gm-dpws/pom.xml | 2 - .../gm/protocols/dpws/BcDPWSSubcomponent.java | 13 +- .../vsb/gm/protocols/dpws/DPWSService.java | 6 +- .../vsb/gm/protocols/dpws/DpwsEvent.java | 10 +- protocol-pool/gm-mqtt/pom.xml | 2 +- .../gm/protocols/mqtt/BcMQTTSubcomponent.java | 7 +- .../vsb/gm/protocols/mqtt/MqttClientPost.java | 4 +- .../gm/protocols/rest/BcRestSubcomponent.java | 12 +- protocol-pool/gm-websocket/pom.xml | 5 - .../websocket/BcWebsocketSubcomponent.java | 14 +- .../websocket/WebSocketObserverThread.java | 8 +- .../websocket/WebSocketPushNotification.java | 15 +- .../vsb/monitor/util/MonitorConstant.java | 24 +- .../ServiceDescriptionParser.java | 2 +- .../tools/serviceparser/gidl/ParseGIDL.java | 7 - .../Copy of config_block1_interface_1 | 0 vsb-manager/{ => api}/install.txt | 0 vsb-manager/{ => api}/pom-vsb-manager.xml | 0 vsb-manager/api/pom.xml | 136 +++++ .../vsb/manager/api}/VsbManager.java | 503 ++++++++++++------ .../manager/api/client/VsbManagerClient.java | 0 .../manager/VsbManagerRestServiceClient.java | 0 .../vsb/manager/VsbManagerTest.java | 7 +- vsb-manager/api/src/test/java/test | 0 .../src/test/resources/pom-vsb-manager.xml | 0 vsb-manager/pom.xml | 150 +----- vsb-manager/service/pom.xml | 71 +++ .../managerservice/VsbManagerResource.java | 95 ++++ .../vsb/managerservice/VsbManagerServer.java | 27 + .../service/src/main/webapp/WEB-INF/web.xml | 34 ++ vsb-manager/service/src/main/webapp/index.jsp | 5 + .../vsb/manager/VsbManager$1.class | Bin 821 -> 0 bytes .../vsb/manager/VsbManager.class | Bin 15076 -> 0 bytes 161 files changed, 2368 insertions(+), 641 deletions(-) rename vsb-manager/src/test/java/test => bc-generators/artifact-generators/src/main/webapp/config/example.json (100%) rename bc-manager/src/main/java/eu/chorevolution/vsb/bindingcomponent/generated/{ => eclipse}/BindingComponent.java (67%) rename binding-components/one-way-bc/src/main/resources/Coapconfig_block2_interface_1 => bc-manager/src/main/resources/config_block1_interface_1 (100%) create mode 100644 bc-manager/src/main/resources/config_block2_interface_1 create mode 100644 bc-manager/src/main/resources/template-config.json rename {binding-components => examples-for-test/binding-components}/examples/bc-gui/.gitignore (100%) rename {binding-components => examples-for-test/binding-components}/examples/bc-gui/pom.xml (100%) rename {binding-components => examples-for-test/binding-components}/examples/bc-gui/src/main/java/eu/chorevolution/vsb/bcs/gui/ConversionWindow.java (100%) rename {binding-components => examples-for-test/binding-components}/examples/bc-gui/src/test/java/eu/chorevolution/vsb/bcs/bc_gui/AppTest.java (100%) rename {binding-components => examples-for-test/binding-components}/examples/pom.xml (100%) rename {binding-components => examples-for-test/binding-components}/examples/rest-bc/.gitignore (100%) rename {binding-components => examples-for-test/binding-components}/examples/rest-bc/pom.xml (100%) rename {binding-components => examples-for-test/binding-components}/examples/rest-bc/src/main/java/org/rest/bc/BCStarter.java (100%) rename {binding-components => examples-for-test/binding-components}/examples/rest-bc/src/test/java/org/rest/bc/AppTest.java (100%) rename {binding-components => examples-for-test/binding-components}/examples/weather-bc/pom.xml (100%) rename {binding-components => examples-for-test/binding-components}/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/BCStarter.java (100%) rename {binding-components => examples-for-test/binding-components}/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/StarterMain.java (100%) rename {binding-components => examples-for-test/binding-components}/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/Location.java (100%) rename {binding-components => examples-for-test/binding-components}/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/RestServer.java (100%) rename {binding-components => examples-for-test/binding-components}/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/RootClass.java (100%) rename {binding-components => examples-for-test/binding-components}/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/WeatherType.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/Californium.properties (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/pom.xml (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/BcCoapToDpwsSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/CoapSendRequest.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/BcCoapToMqttSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/Publisher.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_rest/BcCoapToRestSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_rest/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_websocket/BcCoapToWebSocketSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_websocket/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_coap/BCDpwsSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_coap/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_mqtt/BCDpwsToMqttSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_mqtt/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_rest/BCDpwsToRestSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_rest/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_coap/BCMqttToCoapSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_coap/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_dpws/BCMqttToDpwsSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_dpws/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_rest/BCMqttToRestSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_rest/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_websocket/BcMqttToWebsocketSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_websocket/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_coap/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_coap/RestToCoapSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_dpws/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_dpws/RestToDpwsSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_mqtt/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_mqtt/RestToMqttSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_websocket/BcMqttToWebsocketSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_websocket/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_coap/BcWebsocketToCoapSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_coap/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_dpws/BcWebsocketToDpwsSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_dpws/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_mqtt/BcWebsocketToMqttSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_mqtt/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_rest/BcWebsocketToRestSubcomponentEndpoint.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_rest/BindingComponent.java (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/Coapconfig_block1_interface_1 (100%) create mode 100644 examples-for-test/binding-components/one-way-bc/src/main/resources/Coapconfig_block2_interface_1 rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/CoapserviceDescription-800bytes.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/CoapserviceDescription.gidl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/CoapserviceDescription.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/CoapserviceDescription284bytes.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/Dpwsconfig_block1_interface_1 (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/Dpwsconfig_block2_interface_1 (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/DpwsserviceDescription.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/Mqttconfig_block1_interface_1 (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/Mqttconfig_block2_interface_1 (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/MqttserviceDescription-284bytes.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/MqttserviceDescription-800bytes.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/MqttserviceDescription.gidl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/MqttserviceDescription.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/Restconfig_block1_interface_1 (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/Restconfig_block2_interface_1 (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/RestserviceDescription-800bytes.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/RestserviceDescription.gidl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/RestserviceDescription.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/RestserviceDescription284bytes.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/WebSocketconfig_block1_interface_1 (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/WebSocketconfig_block2_interface_1 (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/WebSocketserviceDescription-5000.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/main/resources/WebSocketserviceDescription.gxdl (100%) rename {binding-components => examples-for-test/binding-components}/one-way-bc/src/test/java/eu/chorevolution/vsb/manual/binding/components/AppTest.java (100%) rename {binding-components => examples-for-test/binding-components}/pom.xml (79%) create mode 100644 examples-for-test/scenarios-end-to-end-test/pom.xml create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/stinvaddress/SetInvAddressClient.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/BindingComponentManager.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/bc/BindingComponent.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/bc/TrafficLight.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/RestLegacyServiceMock.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/SoapClientMock.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/JaxRsTrafficLightResource.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/LightPersistence.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/RestTrafficLightService-GMDL.json create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/TrafficLight.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/BindingComponentManager.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/BindingComponent.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/ComplexType.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/Location.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/WeatherType.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/ComplexType.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/Location.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/RestClient.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/WeatherType.java create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/resources/BaseService.wsdl create mode 100644 examples-for-test/scenarios-end-to-end-test/src/main/resources/wsdl-to-code.txt rename vsb-manager/{ => api}/Copy of config_block1_interface_1 (100%) rename vsb-manager/{ => api}/install.txt (100%) rename vsb-manager/{ => api}/pom-vsb-manager.xml (100%) create mode 100644 vsb-manager/api/pom.xml rename vsb-manager/{src/main/java/eu/chorevolution/vsb/manager => api/src/main/java/eu/chorevolution/vsb/manager/api}/VsbManager.java (64%) rename vsb-manager/{ => api}/src/main/java/eu/chorevolution/vsb/manager/api/client/VsbManagerClient.java (100%) rename vsb-manager/{ => api}/src/test/java/eu/chorevolution/vsb/manager/VsbManagerRestServiceClient.java (100%) rename vsb-manager/{ => api}/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java (64%) create mode 100644 vsb-manager/api/src/test/java/test rename vsb-manager/{ => api}/src/test/resources/pom-vsb-manager.xml (100%) create mode 100644 vsb-manager/service/pom.xml create mode 100644 vsb-manager/service/src/main/java/eu/chorevolution/vsb/managerservice/VsbManagerResource.java create mode 100644 vsb-manager/service/src/main/java/eu/chorevolution/vsb/managerservice/VsbManagerServer.java create mode 100644 vsb-manager/service/src/main/webapp/WEB-INF/web.xml create mode 100644 vsb-manager/service/src/main/webapp/index.jsp delete mode 100644 vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager$1.class delete mode 100644 vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager.class diff --git a/bc-generators/artifact-generators/pom.xml b/bc-generators/artifact-generators/pom.xml index 40e821db..cc01df18 100644 --- a/bc-generators/artifact-generators/pom.xml +++ b/bc-generators/artifact-generators/pom.xml @@ -27,6 +27,7 @@ <spring.version>3.2.3.RELEASE</spring.version> <cxf.version>3.1.4</cxf.version> <jax.ws.rs>2.0.1</jax.ws.rs> + <version.shrinkwrap.resolvers>2.2.6</version.shrinkwrap.resolvers> </properties> <build> @@ -59,7 +60,6 @@ <artifactId>gm-api</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> - <dependency> <groupId>eu.chorevolution.vsb</groupId> <artifactId>gm-dpws</artifactId> @@ -70,7 +70,6 @@ <artifactId>gm-websocket</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> - <dependency> <groupId>eu.chorevolution.vsb</groupId> <artifactId>compiler</artifactId> @@ -95,18 +94,31 @@ <dependency> <groupId>org.jboss.shrinkwrap</groupId> <artifactId>shrinkwrap-api</artifactId> - <version>1.2.3</version> + <version>1.2.6</version> </dependency> <dependency> <groupId>org.jboss.shrinkwrap</groupId> <artifactId>shrinkwrap-impl-base</artifactId> - <version>1.2.3</version> + <version>1.2.6</version> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-impl-maven</artifactId> - <version>2.1.1</version> + <version>2.2.6</version> + </dependency> + <dependency> + <groupId>org.jboss.shrinkwrap.resolver</groupId> + <artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId> + <version>2.2.6</version> + </dependency> + <dependency> + <groupId>org.jboss.shrinkwrap.resolver</groupId> + <artifactId>shrinkwrap-resolver-depchain</artifactId> + <version>2.2.6</version> + <scope>test</scope> + <type>pom</type> </dependency> + <!-- jackson --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> @@ -173,10 +185,7 @@ <artifactId>commons-logging</artifactId> <version>1.2</version> </dependency> - <!-- <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-transport-http</artifactId> - <version>1.7.5</version> - </dependency> --> + <!-- <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-transport-http</artifactId> + <version>1.7.5</version> </dependency> --> </dependencies> </project> \ No newline at end of file diff --git a/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/Generator.java b/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/Generator.java index c7a86af3..0a7b216f 100644 --- a/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/Generator.java +++ b/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/Generator.java @@ -9,10 +9,7 @@ import eu.chorevolution.vsb.gmdl.utils.enums.ProtocolType; public class Generator { - public Generator(){ - - - } + public Generator(){} public void compileGeratedClasses(Class[] classesOptions){ diff --git a/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/JarGenerator.java b/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/JarGenerator.java index 27af169a..07d8ae16 100644 --- a/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/JarGenerator.java +++ b/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/JarGenerator.java @@ -3,21 +3,21 @@ package eu.chorevolution.vsb.artifact.generators; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; -import java.io.InputStream; +import java.util.HashMap; import java.util.jar.Attributes; import java.util.jar.JarFile; import java.util.jar.Manifest; +import org.jboss.shrinkwrap.api.ArchivePaths; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.Asset; import org.jboss.shrinkwrap.api.asset.ByteArrayAsset; +import org.jboss.shrinkwrap.api.importer.ExplodedImporter; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; +import org.jboss.shrinkwrap.resolver.api.maven.Maven; -import eu.chorevolution.vsb.bc.manager.VsbOutput; import eu.chorevolution.vsb.gmdl.utils.Constants; import eu.chorevolution.vsb.gmdl.utils.PathResolver; -import eu.chorevolution.vsb.gmdl.utils.enums.OneWayType; import eu.chorevolution.vsb.gmdl.utils.enums.ProtocolType; /* TODO @@ -26,245 +26,272 @@ import eu.chorevolution.vsb.gmdl.utils.enums.ProtocolType; * @see https://github.com/shrinkwrap * @see http://arquillian.org/guides/shrinkwrap_introduction/ * */ -public class JarGenerator { +public class JarGenerator{ private JavaArchive archive = null; private ProtocolType serviceProtocol = null; private ProtocolType busProtocol = null; - private OneWayType oneWayType = null; - - public JarGenerator() { + private HashMap<String, String> hmapPomXml = null; - archive = ShrinkWrap.create(JavaArchive.class,Constants.service_name+".jar"); + public JarGenerator(HashMap<String, String> hmapPomXml) { + this.hmapPomXml = hmapPomXml; + archive = ShrinkWrap.create(JavaArchive.class, Constants.service_name + ".jar"); + } - - public byte[] generate(){ - - PathResolver.setClassPath(Constants.generatedCodePath); + public byte[] generate() { + addPackage(); - Class<?> bc = null; - try { - bc = Class.forName(Constants.target_namespace+".BindingComponentMain"); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - + JavaArchive archiveTmp = ShrinkWrap.create(JavaArchive.class, Constants.service_name + ".jar"); + archiveTmp.as(ExplodedImporter.class) + .importDirectory(new File(Constants.webapp_src_artifact + File.separator + "config")); + archive.merge(archiveTmp, ArchivePaths.create("config")); + Manifest manifest = new Manifest(); manifest.getMainAttributes().put(new Attributes.Name("Manifest-Version"), "1.0"); manifest.getMainAttributes().put(new Attributes.Name("Created-By"), "VsbManager"); - manifest.getMainAttributes().put(new Attributes.Name("Main-Class"), "eu.chorevolution.vsb.bindingcomponent.generated.BindingComponentMain"); - archive.addPackage(bc.getPackage()); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - try { + manifest.getMainAttributes().put(new Attributes.Name("Main-Class"), + "eu.chorevolution.vsb.bindingcomponent.generated.BindingComponentMain"); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + try { + manifest.write(out); + } catch (IOException e) { + // TODO Auto-generated catch block e.printStackTrace(); } - ByteArrayAsset byteArrayAsset = new ByteArrayAsset(out.toByteArray()); - archive.add(byteArrayAsset, JarFile.MANIFEST_NAME); - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ByteArrayAsset byteArrayManifestAsset = new ByteArrayAsset(out.toByteArray()); + archive.add(byteArrayManifestAsset, JarFile.MANIFEST_NAME); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); new ZipExporterImpl(archive).exportTo(bos); - new ZipExporterImpl(archive).exportTo(new File(Constants.generatedCodePath+File.separator+Constants.service_name+".jar"), true); + new ZipExporterImpl(archive).exportTo( + new File(Constants.generatedCodePath + File.separator + Constants.service_name + ".jar"), true); return bos.toByteArray(); - } - public ProtocolType getServiceProtocol() { return serviceProtocol; } - public void setServiceProtocol(ProtocolType serviceProtocol) { this.serviceProtocol = serviceProtocol; } - public ProtocolType getBusProtocol() { return busProtocol; } - public void setBusProtocol(ProtocolType busProtocol) { - + this.busProtocol = busProtocol; } + private void addPackage() { + + PathResolver.setClassPath(Constants.generatedCodePath); + + Class<?> bc = null; + try { + + bc = Class.forName(Constants.target_namespace + ".BindingComponentMain"); + + } catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + archive.addPackage(bc.getPackage()); + archive.addPackage(eu.chorevolution.vsb.bc.manager.BcManagerRestService.class.getPackage()); + archive.addPackage(eu.chorevolution.vsb.gm.protocols.Manageable.class.getPackage()); + archive.addPackage(eu.chorevolution.vsb.gm.protocols.primitives.BcGmSubcomponent.class.getPackage()); + archive.addPackage(eu.chorevolution.vsb.gmdl.utils.PathResolver.class.getPackage()); + archive.addPackage(eu.chorevolution.vsb.gmdl.utils.enums.OperationType.class.getPackage()); + archive.addPackage(eu.chorevolution.vsb.gmdl.tools.serviceparser.ServiceDescriptionParser.class.getPackage()); + archive.addPackage(eu.chorevolution.vsb.gmdl.tools.serviceparser.gidl.ParseGIDL.class.getPackage()); + archive.addPackage(eu.chorevolution.modelingnotations.gidl.impl.GIDLModelImpl.class.getPackage()); + archive.addPackage("eu.chorevolution.modelingnotations.gidl"); + archive.addPackage("eu.chorevolution.vsb.agent"); + archive.addPackage("eu.chorevolution.vsb.mbeans"); + archive.addPackage("eu.chorevolution.vsb.monitor.util"); + archive.addPackage("org.eclipse.emf.ecore"); + archive.addPackage("org.eclipse.emf.ecore.plugin"); + archive.addPackage("org.eclipse.emf.ecore.util"); + archive.addPackage("org.eclipse.emf.ecore.impl"); + archive.addPackage("org.eclipse.emf.ecore.xmi"); + archive.addPackage("org.eclipse.emf.ecore.resource"); + archive.addPackage("org.eclipse.emf.ecore.resource.impl"); + archive.addPackage("org.eclipse.emf.ecore.xmi.impl"); + archive.addPackage("org.eclipse.emf.ecore.xml"); + archive.addPackage("org.eclipse.emf.ecore.xml.type"); + archive.addPackage("org.eclipse.emf.ecore.xml.type.impl"); + archive.addPackage("org.eclipse.emf.ecore.xml.type.internal"); + archive.addPackage("org.eclipse.emf.common"); + archive.addPackage("org.eclipse.emf.common.util"); + archive.addPackage("org.eclipse.emf.common.notify"); + archive.addPackage("org.eclipse.emf.common.util.impl"); + archive.addPackage("org.eclipse.emf.common.notify.impl"); + archive.addPackage("org.json.simple"); + archive.addPackage("org.json.simple.parser"); + + if (busProtocol == ProtocolType.COAP || serviceProtocol == ProtocolType.COAP) { + + archive.addPackage("org.eclipse.californium.elements"); + archive.addPackage("org.eclipse.californium.core"); + archive.addPackage("org.eclipse.californium.core.observe"); + archive.addPackage("org.eclipse.californium.core.coap"); + archive.addPackage("org.eclipse.californium.core.server"); + archive.addPackage("org.eclipse.californium.core.network"); + archive.addPackage("org.eclipse.californium.core.network.serialization"); + archive.addPackage("org.eclipse.californium.core.network.deduplication"); + archive.addPackage("org.eclipse.californium.core.network.config"); + archive.addPackage("org.eclipse.californium.core.network.stack"); + archive.addPackage("org.eclipse.californium.core.server.resources"); + archive.addPackage(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class.getPackage()); + } + + if (busProtocol == ProtocolType.REST || serviceProtocol == ProtocolType.REST) { + + archive.addPackage("org.restlet"); + archive.addPackage("org.restlet.data"); + archive.addPackage("org.restlet.engine"); + archive.addPackage("org.restlet.engine.header"); + archive.addPackage("org.restlet.engine.connector"); + archive.addPackage("org.restlet.engine.util"); + archive.addPackage("org.restlet.engine.log"); + archive.addPackage("org.restlet.engine.local"); + archive.addPackage("org.restlet.engine.adapter"); + archive.addPackage("org.restlet.engine.security"); + archive.addPackage("org.restlet.engine.converter"); + archive.addPackage("org.restlet.engine.resource"); + archive.addPackage("org.restlet.engine.component"); + archive.addPackage("org.restlet.engine.application"); + archive.addPackage("org.restlet.service"); + archive.addPackage("org.restlet.routing"); + archive.addPackage("org.restlet.representation"); + archive.addPackage("org.restlet.resource"); + archive.addPackage("org.restlet.util"); + archive.addPackage(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class.getPackage()); + } + + if (busProtocol == ProtocolType.MQTT || serviceProtocol == ProtocolType.MQTT) { + + JavaArchive[] libs = Maven.resolver().offline() + .loadPomFromFile(hmapPomXml.get("mqtt")) + .resolve("org.apache.activemq:activemq-all:5.13.3").withTransitivity().as(JavaArchive.class); + for (JavaArchive lib : libs) { + + archive = archive.merge(lib); - private void addPackage(){ - - switch (busProtocol) { - case COAP: - - switch (serviceProtocol){ - - case REST: - - archive.addPackage(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class.getPackage()); - - break; - - case MQTT: - - archive.addPackage(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class.getPackage()); - - break; - - case WEB_SOCKETS: - - archive.addPackage(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent.class.getPackage()); - - break; - - case DPWS: - - archive.addPackage(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class.getPackage()); - - break; - - } - - break; - - case REST: - - switch (serviceProtocol){ - case COAP: - - archive.addPackage(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class.getPackage()); - - break; - - case MQTT: - - archive.addPackage(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class.getPackage()); - - break; - - case WEB_SOCKETS: - - archive.addPackage(eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class.getPackage()); - - break; - - case DPWS: - - archive.addPackage(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class.getPackage()); - - break; - - } - - - break; - - case MQTT: - - switch (serviceProtocol){ - case COAP: - - archive.addPackage(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class.getPackage()); - - break; - - case REST: - archive.addPackage(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class.getPackage()); - - break; - - case WEB_SOCKETS: - archive.addPackage(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent.class.getPackage()); - - break; - - case DPWS: - archive.addPackage(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class.getPackage()); - - break; - } - - break; - - case WEB_SOCKETS: - - switch (serviceProtocol){ - case COAP: - - archive.addPackage(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent.class.getPackage()); - - break; - - case REST: - archive.addPackage(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent.class.getPackage()); - break; - - case MQTT: - archive.addPackage(eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class.getPackage()); - break; - - - case DPWS: - archive.addPackage(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent.class.getPackage()); - break; - + libs = Maven.resolver().offline() + .loadPomFromFile(hmapPomXml.get("mqtt")) + .resolve("org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2").withTransitivity().as(JavaArchive.class); + for (JavaArchive lib : libs) { + + archive = archive.merge(lib); + } - - break; - - case DPWS: - - switch (serviceProtocol){ - - case COAP: - archive.addPackage(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class.getPackage()); - break; - - case REST: - archive.addPackage(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class.getPackage()); - break; - - case MQTT: - archive.addPackage(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class.getPackage()); - break; - - case WEB_SOCKETS: - - archive.addPackage(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class.getPackage()); - archive.addPackage(eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent.class.getPackage()); - break; - - + libs = Maven.resolver().offline() + .loadPomFromFile(hmapPomXml.get("mqtt")) + .resolve("org.fusesource.mqtt-client:mqtt-client:1.10").withTransitivity().as(JavaArchive.class); + for (JavaArchive lib : libs) { + + archive = archive.merge(lib); + } - - break; - + archive.addPackages(true, "javax.jms"); + archive.addPackages(true, "org.slf4j"); + archive.addPackage(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class.getPackage()); + + } + + if (busProtocol == ProtocolType.WEB_SOCKETS || serviceProtocol == ProtocolType.WEB_SOCKETS) { + + archive.addPackage("org.apache.activemq.broker"); + archive.addPackage("org.java_websocket.handshake"); + archive.addPackage("org.java_websocket"); + archive.addPackage("org.java_websocket.client"); + archive.addPackage("org.java_websocket.framing"); + archive.addPackage("org.java_websocket.drafts"); + archive.addPackage("org.java_websocket.exceptions"); + archive.addPackage("org.java_websocket.util"); + archive.addPackage(eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent.class.getPackage()); } + + if (busProtocol == ProtocolType.DPWS || serviceProtocol == ProtocolType.DPWS) { + + archive.addPackage("org.ws4d.java"); + archive.addPackage("org.ws4d.java.communication"); + archive.addPackage("org.ws4d.java.communication.structures"); + archive.addPackage("org.ws4d.java.communication.filter"); + archive.addPackage("org.ws4d.java.communication.callback"); + archive.addPackage("org.ws4d.java.communication.listener"); + archive.addPackage("org.ws4d.java.communication.receiver"); + archive.addPackage("org.ws4d.java.communication.connection.udp"); + archive.addPackage("org.ws4d.java.communication.protocol.soap"); + archive.addPackage("org.ws4d.java.communication.protocol.soap.server"); + archive.addPackage("org.ws4d.java.communication.protocol.soap.generator"); + archive.addPackage("org.ws4d.java.communication.protocol.http"); + archive.addPackage("org.ws4d.java.communication.protocol.http.server"); + archive.addPackage("org.ws4d.java.communication.protocol.mime"); + archive.addPackage("org.ws4d.java.eventing"); + archive.addPackage("org.ws4d.java.service"); + archive.addPackage("org.ws4d.java.types"); + archive.addPackage("org.ws4d.java.client"); + archive.addPackage("org.ws4d.java.message"); + archive.addPackage("org.ws4d.java.message.discovery"); + archive.addPackage("org.ws4d.java.message.eventing"); + archive.addPackage("org.ws4d.java.message.metadata"); + archive.addPackage("org.ws4d.java.security"); + archive.addPackage("org.ws4d.java.service.parameter"); + archive.addPackage("org.ws4d.java.service.reference"); + archive.addPackage("org.ws4d.java.structures"); + archive.addPackage("org.ws4d.java.configuration"); + archive.addPackage("org.ws4d.java.schema"); + archive.addPackage("org.ws4d.java.service.listener"); + archive.addPackage("org.ws4d.java.util"); + archive.addPackage("org.ws4d.java.constants"); + archive.addPackage("org.ws4d.java.attachment"); + archive.addPackage("org.ws4d.java.attachment.interfaces"); + archive.addPackage("org.ws4d.java.attachment.interfaces.outgoing"); + archive.addPackage("org.ws4d.java.attachment.interfaces.incoming"); + archive.addPackage("org.ws4d.java.platform.util"); + archive.addPackage("org.ws4d.java.io.buffered"); + archive.addPackage("org.ws4d.java.description.wsdl"); + archive.addPackage("org.ws4d.java.description.wsdl.soap12"); + archive.addPackage("org.ws4d.java.concurrency"); + archive.addPackage("org.ws4d.java.description"); + archive.addPackage("org.ws4d.java.constants"); + archive.addPackage("org.ws4d.java.constants.general"); + archive.addPackage("org.ws4d.java.constants.DPWS2011"); + archive.addPackage("org.ws4d.java.constants.DPWS2009"); + archive.addPackage("org.ws4d.java.constants.DPWS2006"); + archive.addPackage("org.ws4d.java.dispatch"); + archive.addPackage("org.ws4d.java.communication.connection.tcp"); + archive.addPackage("org.ws4d.java.communication.connection.ip"); + archive.addPackage("org.ws4d.java.communication.connection.ip.listener"); + archive.addPackage("org.ws4d.java.communication.connection.ip.exception"); + archive.addPackage("org.ws4d.java.communication.monitor"); + archive.addPackage("org.ws4d.java.authorization"); + archive.addPackage("org.ws4d.java.io"); + archive.addPackage("org.ws4d.java.io.xml"); + archive.addPackage("org.ws4d.java.io.fs"); + archive.addPackage("org.ws4d.java.xmlpull"); + archive.addPackage("org.ws4d.java.xmlpull.v1"); + archive.addPackage("org.ws4d.java.xmlpull.mxp1"); + archive.addPackage("org.ws4d.java.xmlpull.mxp1_serializer"); + archive.addPackage("org.ws4d.java.communication.protocol.http.server.responses"); + archive.addPackage("org.ws4d.java.presentation"); + archive.addPackage("org.ws4d.java.communication.protocol.http.credentialInfo"); + archive.addPackage("org.ws4d.java.communication.protocol.http.header"); + archive.addPackage("org.ws4d.java.html"); + archive.addPackage(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class.getPackage()); + } + } } \ No newline at end of file diff --git a/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/WarGenerator.java b/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/WarGenerator.java index ae9480a1..986899b2 100644 --- a/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/WarGenerator.java +++ b/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/WarGenerator.java @@ -59,18 +59,15 @@ public class WarGenerator { if(f.getName().equals("setinvaddr-context.xml")){ - archive.addAsWebResource(f, "WEB-INF" + "/" + f.getName()); - + archive.addAsWebResource(f, "WEB-INF" + "/" + f.getName()); } } for (File f : new File(Constants.generatedCodePath + File.separator + Constants.target_namespace_path).listFiles()) { - - + archive.addAsWebResource(f, "WEB-INF" +"/"+ "classes" + "/"+ Constants.target_namespace_path + "/"+ f.getName()); - } diff --git a/vsb-manager/src/test/java/test b/bc-generators/artifact-generators/src/main/webapp/config/example.json similarity index 100% rename from vsb-manager/src/test/java/test rename to bc-generators/artifact-generators/src/main/webapp/config/example.json diff --git a/bc-manager/pom.xml b/bc-manager/pom.xml index c0a9b3a7..0a8bac07 100644 --- a/bc-manager/pom.xml +++ b/bc-manager/pom.xml @@ -47,6 +47,11 @@ <artifactId>gm-coap</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>gm-websocket</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> diff --git a/bc-manager/src/main/java/eu/chorevolution/vsb/bc/manager/BcManagerRestService.java b/bc-manager/src/main/java/eu/chorevolution/vsb/bc/manager/BcManagerRestService.java index f4d64436..29826f69 100644 --- a/bc-manager/src/main/java/eu/chorevolution/vsb/bc/manager/BcManagerRestService.java +++ b/bc-manager/src/main/java/eu/chorevolution/vsb/bc/manager/BcManagerRestService.java @@ -20,7 +20,7 @@ import org.restlet.representation.StringRepresentation; import org.restlet.resource.ResourceException; import org.restlet.resource.ServerResource; -import eu.chorevolution.vsb.bindingcomponent.generated.BindingComponent; +import eu.chorevolution.vsb.bindingcomponent.generated.eclipse.BindingComponent; import eu.chorevolution.vsb.gm.protocols.Manageable; public class BcManagerRestService implements Manageable { diff --git a/bc-manager/src/main/java/eu/chorevolution/vsb/bindingcomponent/generated/BindingComponent.java b/bc-manager/src/main/java/eu/chorevolution/vsb/bindingcomponent/generated/eclipse/BindingComponent.java similarity index 67% rename from bc-manager/src/main/java/eu/chorevolution/vsb/bindingcomponent/generated/BindingComponent.java rename to bc-manager/src/main/java/eu/chorevolution/vsb/bindingcomponent/generated/eclipse/BindingComponent.java index f9bb034e..88b6d886 100644 --- a/bc-manager/src/main/java/eu/chorevolution/vsb/bindingcomponent/generated/BindingComponent.java +++ b/bc-manager/src/main/java/eu/chorevolution/vsb/bindingcomponent/generated/eclipse/BindingComponent.java @@ -1,18 +1,18 @@ -package eu.chorevolution.vsb.bindingcomponent.generated; +package eu.chorevolution.vsb.bindingcomponent.generated.eclipse; import java.io.File; -import eu.chorevolution.vsb.bc.manager.BcManagerRestService; -import eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent; import eu.chorevolution.vsb.gm.protocols.primitives.BcGmSubcomponent; import eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent; import eu.chorevolution.vsb.gmdl.tools.serviceparser.ServiceDescriptionParser; import eu.chorevolution.vsb.gmdl.utils.BcConfiguration; import eu.chorevolution.vsb.gmdl.utils.GmServiceRepresentation; import eu.chorevolution.vsb.gmdl.utils.Interface; +import eu.chorevolution.vsb.gmdl.utils.PathResolver; import eu.chorevolution.vsb.gmdl.utils.enums.RoleType; +import eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent; -public class BindingComponent { +public class BindingComponent{ BcGmSubcomponent[][] subcomponent; GmServiceRepresentation gmServiceRepresentation = null; @@ -24,8 +24,10 @@ public class BindingComponent { intOne = Integer.parseInt("1"); java.lang.Integer intNine; intNine = Integer.parseInt("9"); + PathResolver pathResolver = new PathResolver(); String interfaceDescFilePath; - interfaceDescFilePath = ((((new File(BcManagerRestService.class.getClassLoader().getResource("example.json").toExternalForm().substring(intNine)).getParentFile().getParentFile().getParentFile().getParentFile().getAbsolutePath()+ File.separator)+ new String("config"))+ File.separator)+ new String("serviceDescription.gxdl")); + interfaceDescFilePath = pathResolver.myFilePath(BindingComponent.class, ((new String("config")+ File.separator)+ new String("serviceDescription.gxdl"))); + System.out.println(interfaceDescFilePath); gmServiceRepresentation = ServiceDescriptionParser.getRepresentationFromGIDL(interfaceDescFilePath); int num_interfaces = gmServiceRepresentation.getInterfaces().size(); subcomponent = new BcGmSubcomponent[num_interfaces][2]; @@ -43,9 +45,13 @@ public class BindingComponent { BcConfiguration bcConfiguration2 = new BcConfiguration(); bcConfiguration1 .setSubcomponentRole(inter.getRole()); bcConfiguration2 .setSubcomponentRole(busRole); - bcConfiguration1 .parseFromJSON(gmServiceRepresentation, (((((new File(BcManagerRestService.class.getClassLoader().getResource("example.json").toExternalForm().substring(intNine)).getParentFile().getParentFile().getParentFile().getParentFile().getAbsolutePath()+ File.separator)+ new String("config"))+ File.separator)+ new String("config_block1_interface_"))+ String.valueOf((i + intOne)))); - bcConfiguration2 .parseFromJSON(gmServiceRepresentation, (((((new File(BcManagerRestService.class.getClassLoader().getResource("example.json").toExternalForm().substring(intNine)).getParentFile().getParentFile().getParentFile().getParentFile().getAbsolutePath()+ File.separator)+ new String("config"))+ File.separator)+ new String("config_block2_interface_"))+ String.valueOf((i + intOne)))); - subcomponent[i][0] = new BcCoapSubcomponent(bcConfiguration1, gmServiceRepresentation); + String config_block1_interfacePath; + config_block1_interfacePath = pathResolver.myFilePath(BindingComponent.class, (((new String("config")+ File.separator)+ new String("config_block1_interface_"))+ String.valueOf((i + intOne)))); + bcConfiguration1 .parseFromJSON(gmServiceRepresentation, new String(config_block1_interfacePath)); + String config_block2_interfacePath; + config_block2_interfacePath = pathResolver.myFilePath(BindingComponent.class, (((new String("config")+ File.separator)+ new String("config_block2_interface_"))+ String.valueOf((i + intOne)))); + bcConfiguration2 .parseFromJSON(gmServiceRepresentation, new String(config_block2_interfacePath)); + subcomponent[i][0] = new BcWebsocketSubcomponent(bcConfiguration1, gmServiceRepresentation); subcomponent[i][1] = new BcRestSubcomponent(bcConfiguration2, gmServiceRepresentation); BcGmSubcomponent block1Component = subcomponent[i][0]; BcGmSubcomponent block2Component = subcomponent[i][1]; diff --git a/bc-manager/src/main/resources/bridge.gidl b/bc-manager/src/main/resources/bridge.gidl index 84318beb..947218e0 100644 --- a/bc-manager/src/main/resources/bridge.gidl +++ b/bc-manager/src/main/resources/bridge.gidl @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<gidl:GIDLModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gidl="http://eu.chorevolution/modelingnotations/gidl" hostAddress="http://jinx.viktoria.chalmers.se:3001/" protocol="CoAP"> +<gidl:GIDLModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gidl="http://eu.chorevolution/modelingnotations/gidl" hostAddress="http://jinx.viktoria.chalmers.se:3001/" protocol="REST"> <hasInterfaces role="provider"> <hasOperations name="bridgeNextClosure" type="two_way_sync" qos="reliable"> <hasScope name="bridgeNextClosure" verb="POST" uri="bridgeNextClosure"/> diff --git a/binding-components/one-way-bc/src/main/resources/Coapconfig_block2_interface_1 b/bc-manager/src/main/resources/config_block1_interface_1 similarity index 100% rename from binding-components/one-way-bc/src/main/resources/Coapconfig_block2_interface_1 rename to bc-manager/src/main/resources/config_block1_interface_1 diff --git a/bc-manager/src/main/resources/config_block2_interface_1 b/bc-manager/src/main/resources/config_block2_interface_1 new file mode 100644 index 00000000..211b71dc --- /dev/null +++ b/bc-manager/src/main/resources/config_block2_interface_1 @@ -0,0 +1 @@ +{"invocation_address":"128.93.64.90","service_port":"9129", "subcomponent_port":"9129","subcomponent_address":"128.93.64.90"} diff --git a/bc-manager/src/main/resources/template-config.json b/bc-manager/src/main/resources/template-config.json new file mode 100644 index 00000000..0b0b05ec --- /dev/null +++ b/bc-manager/src/main/resources/template-config.json @@ -0,0 +1,4 @@ +{ + "subcomponent_address": "", + "subcomponent_port": "", +} diff --git a/binding-components/examples/bc-gui/.gitignore b/examples-for-test/binding-components/examples/bc-gui/.gitignore similarity index 100% rename from binding-components/examples/bc-gui/.gitignore rename to examples-for-test/binding-components/examples/bc-gui/.gitignore diff --git a/binding-components/examples/bc-gui/pom.xml b/examples-for-test/binding-components/examples/bc-gui/pom.xml similarity index 100% rename from binding-components/examples/bc-gui/pom.xml rename to examples-for-test/binding-components/examples/bc-gui/pom.xml diff --git a/binding-components/examples/bc-gui/src/main/java/eu/chorevolution/vsb/bcs/gui/ConversionWindow.java b/examples-for-test/binding-components/examples/bc-gui/src/main/java/eu/chorevolution/vsb/bcs/gui/ConversionWindow.java similarity index 100% rename from binding-components/examples/bc-gui/src/main/java/eu/chorevolution/vsb/bcs/gui/ConversionWindow.java rename to examples-for-test/binding-components/examples/bc-gui/src/main/java/eu/chorevolution/vsb/bcs/gui/ConversionWindow.java diff --git a/binding-components/examples/bc-gui/src/test/java/eu/chorevolution/vsb/bcs/bc_gui/AppTest.java b/examples-for-test/binding-components/examples/bc-gui/src/test/java/eu/chorevolution/vsb/bcs/bc_gui/AppTest.java similarity index 100% rename from binding-components/examples/bc-gui/src/test/java/eu/chorevolution/vsb/bcs/bc_gui/AppTest.java rename to examples-for-test/binding-components/examples/bc-gui/src/test/java/eu/chorevolution/vsb/bcs/bc_gui/AppTest.java diff --git a/binding-components/examples/pom.xml b/examples-for-test/binding-components/examples/pom.xml similarity index 100% rename from binding-components/examples/pom.xml rename to examples-for-test/binding-components/examples/pom.xml diff --git a/binding-components/examples/rest-bc/.gitignore b/examples-for-test/binding-components/examples/rest-bc/.gitignore similarity index 100% rename from binding-components/examples/rest-bc/.gitignore rename to examples-for-test/binding-components/examples/rest-bc/.gitignore diff --git a/binding-components/examples/rest-bc/pom.xml b/examples-for-test/binding-components/examples/rest-bc/pom.xml similarity index 100% rename from binding-components/examples/rest-bc/pom.xml rename to examples-for-test/binding-components/examples/rest-bc/pom.xml diff --git a/binding-components/examples/rest-bc/src/main/java/org/rest/bc/BCStarter.java b/examples-for-test/binding-components/examples/rest-bc/src/main/java/org/rest/bc/BCStarter.java similarity index 100% rename from binding-components/examples/rest-bc/src/main/java/org/rest/bc/BCStarter.java rename to examples-for-test/binding-components/examples/rest-bc/src/main/java/org/rest/bc/BCStarter.java diff --git a/binding-components/examples/rest-bc/src/test/java/org/rest/bc/AppTest.java b/examples-for-test/binding-components/examples/rest-bc/src/test/java/org/rest/bc/AppTest.java similarity index 100% rename from binding-components/examples/rest-bc/src/test/java/org/rest/bc/AppTest.java rename to examples-for-test/binding-components/examples/rest-bc/src/test/java/org/rest/bc/AppTest.java diff --git a/binding-components/examples/weather-bc/pom.xml b/examples-for-test/binding-components/examples/weather-bc/pom.xml similarity index 100% rename from binding-components/examples/weather-bc/pom.xml rename to examples-for-test/binding-components/examples/weather-bc/pom.xml diff --git a/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/BCStarter.java b/examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/BCStarter.java similarity index 100% rename from binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/BCStarter.java rename to examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/BCStarter.java diff --git a/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/StarterMain.java b/examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/StarterMain.java similarity index 100% rename from binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/StarterMain.java rename to examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/StarterMain.java diff --git a/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/BindingComponent.java b/examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/BindingComponent.java similarity index 100% rename from binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/BindingComponent.java rename to examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/BindingComponent.java diff --git a/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/Location.java b/examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/Location.java similarity index 100% rename from binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/Location.java rename to examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/Location.java diff --git a/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/RestServer.java b/examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/RestServer.java similarity index 100% rename from binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/RestServer.java rename to examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/RestServer.java diff --git a/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/RootClass.java b/examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/RootClass.java similarity index 100% rename from binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/RootClass.java rename to examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/RootClass.java diff --git a/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/WeatherType.java b/examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/WeatherType.java similarity index 100% rename from binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/WeatherType.java rename to examples-for-test/binding-components/examples/weather-bc/src/main/java/eu/chorevolution/vsb/bcs/weather/bc/WeatherType.java diff --git a/binding-components/one-way-bc/Californium.properties b/examples-for-test/binding-components/one-way-bc/Californium.properties similarity index 100% rename from binding-components/one-way-bc/Californium.properties rename to examples-for-test/binding-components/one-way-bc/Californium.properties diff --git a/binding-components/one-way-bc/pom.xml b/examples-for-test/binding-components/one-way-bc/pom.xml similarity index 100% rename from binding-components/one-way-bc/pom.xml rename to examples-for-test/binding-components/one-way-bc/pom.xml diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/BcCoapToDpwsSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/BcCoapToDpwsSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/BcCoapToDpwsSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/BcCoapToDpwsSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/CoapSendRequest.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/CoapSendRequest.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/CoapSendRequest.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_dpws/CoapSendRequest.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/BcCoapToMqttSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/BcCoapToMqttSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/BcCoapToMqttSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/BcCoapToMqttSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/Publisher.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/Publisher.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/Publisher.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_mqtt/Publisher.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_rest/BcCoapToRestSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_rest/BcCoapToRestSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_rest/BcCoapToRestSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_rest/BcCoapToRestSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_rest/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_rest/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_rest/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_rest/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_websocket/BcCoapToWebSocketSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_websocket/BcCoapToWebSocketSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_websocket/BcCoapToWebSocketSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_websocket/BcCoapToWebSocketSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_websocket/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_websocket/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_websocket/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/coap_to_websocket/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_coap/BCDpwsSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_coap/BCDpwsSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_coap/BCDpwsSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_coap/BCDpwsSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_coap/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_coap/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_coap/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_coap/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_mqtt/BCDpwsToMqttSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_mqtt/BCDpwsToMqttSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_mqtt/BCDpwsToMqttSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_mqtt/BCDpwsToMqttSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_mqtt/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_mqtt/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_mqtt/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_mqtt/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_rest/BCDpwsToRestSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_rest/BCDpwsToRestSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_rest/BCDpwsToRestSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_rest/BCDpwsToRestSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_rest/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_rest/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_rest/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/dpws_to_rest/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_coap/BCMqttToCoapSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_coap/BCMqttToCoapSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_coap/BCMqttToCoapSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_coap/BCMqttToCoapSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_coap/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_coap/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_coap/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_coap/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_dpws/BCMqttToDpwsSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_dpws/BCMqttToDpwsSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_dpws/BCMqttToDpwsSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_dpws/BCMqttToDpwsSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_dpws/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_dpws/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_dpws/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_dpws/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_rest/BCMqttToRestSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_rest/BCMqttToRestSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_rest/BCMqttToRestSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_rest/BCMqttToRestSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_rest/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_rest/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_rest/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_rest/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_websocket/BcMqttToWebsocketSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_websocket/BcMqttToWebsocketSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_websocket/BcMqttToWebsocketSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_websocket/BcMqttToWebsocketSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_websocket/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_websocket/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_websocket/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/mqtt_to_websocket/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_coap/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_coap/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_coap/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_coap/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_coap/RestToCoapSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_coap/RestToCoapSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_coap/RestToCoapSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_coap/RestToCoapSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_dpws/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_dpws/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_dpws/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_dpws/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_dpws/RestToDpwsSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_dpws/RestToDpwsSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_dpws/RestToDpwsSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_dpws/RestToDpwsSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_mqtt/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_mqtt/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_mqtt/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_mqtt/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_mqtt/RestToMqttSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_mqtt/RestToMqttSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_mqtt/RestToMqttSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_mqtt/RestToMqttSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_websocket/BcMqttToWebsocketSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_websocket/BcMqttToWebsocketSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_websocket/BcMqttToWebsocketSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_websocket/BcMqttToWebsocketSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_websocket/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_websocket/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_websocket/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/rest_to_websocket/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_coap/BcWebsocketToCoapSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_coap/BcWebsocketToCoapSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_coap/BcWebsocketToCoapSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_coap/BcWebsocketToCoapSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_coap/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_coap/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_coap/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_coap/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_dpws/BcWebsocketToDpwsSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_dpws/BcWebsocketToDpwsSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_dpws/BcWebsocketToDpwsSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_dpws/BcWebsocketToDpwsSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_dpws/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_dpws/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_dpws/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_dpws/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_mqtt/BcWebsocketToMqttSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_mqtt/BcWebsocketToMqttSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_mqtt/BcWebsocketToMqttSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_mqtt/BcWebsocketToMqttSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_mqtt/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_mqtt/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_mqtt/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_mqtt/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_rest/BcWebsocketToRestSubcomponentEndpoint.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_rest/BcWebsocketToRestSubcomponentEndpoint.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_rest/BcWebsocketToRestSubcomponentEndpoint.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_rest/BcWebsocketToRestSubcomponentEndpoint.java diff --git a/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_rest/BindingComponent.java b/examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_rest/BindingComponent.java similarity index 100% rename from binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_rest/BindingComponent.java rename to examples-for-test/binding-components/one-way-bc/src/main/java/eu/chorevolution/vsb/websocket_to_rest/BindingComponent.java diff --git a/binding-components/one-way-bc/src/main/resources/Coapconfig_block1_interface_1 b/examples-for-test/binding-components/one-way-bc/src/main/resources/Coapconfig_block1_interface_1 similarity index 100% rename from binding-components/one-way-bc/src/main/resources/Coapconfig_block1_interface_1 rename to examples-for-test/binding-components/one-way-bc/src/main/resources/Coapconfig_block1_interface_1 diff --git a/examples-for-test/binding-components/one-way-bc/src/main/resources/Coapconfig_block2_interface_1 b/examples-for-test/binding-components/one-way-bc/src/main/resources/Coapconfig_block2_interface_1 new file mode 100644 index 00000000..211b71dc --- /dev/null +++ b/examples-for-test/binding-components/one-way-bc/src/main/resources/Coapconfig_block2_interface_1 @@ -0,0 +1 @@ +{"invocation_address":"128.93.64.90","service_port":"9129", "subcomponent_port":"9129","subcomponent_address":"128.93.64.90"} diff --git a/binding-components/one-way-bc/src/main/resources/CoapserviceDescription-800bytes.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/CoapserviceDescription-800bytes.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/CoapserviceDescription-800bytes.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/CoapserviceDescription-800bytes.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/CoapserviceDescription.gidl b/examples-for-test/binding-components/one-way-bc/src/main/resources/CoapserviceDescription.gidl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/CoapserviceDescription.gidl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/CoapserviceDescription.gidl diff --git a/binding-components/one-way-bc/src/main/resources/CoapserviceDescription.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/CoapserviceDescription.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/CoapserviceDescription.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/CoapserviceDescription.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/CoapserviceDescription284bytes.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/CoapserviceDescription284bytes.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/CoapserviceDescription284bytes.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/CoapserviceDescription284bytes.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/Dpwsconfig_block1_interface_1 b/examples-for-test/binding-components/one-way-bc/src/main/resources/Dpwsconfig_block1_interface_1 similarity index 100% rename from binding-components/one-way-bc/src/main/resources/Dpwsconfig_block1_interface_1 rename to examples-for-test/binding-components/one-way-bc/src/main/resources/Dpwsconfig_block1_interface_1 diff --git a/binding-components/one-way-bc/src/main/resources/Dpwsconfig_block2_interface_1 b/examples-for-test/binding-components/one-way-bc/src/main/resources/Dpwsconfig_block2_interface_1 similarity index 100% rename from binding-components/one-way-bc/src/main/resources/Dpwsconfig_block2_interface_1 rename to examples-for-test/binding-components/one-way-bc/src/main/resources/Dpwsconfig_block2_interface_1 diff --git a/binding-components/one-way-bc/src/main/resources/DpwsserviceDescription.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/DpwsserviceDescription.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/DpwsserviceDescription.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/DpwsserviceDescription.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/Mqttconfig_block1_interface_1 b/examples-for-test/binding-components/one-way-bc/src/main/resources/Mqttconfig_block1_interface_1 similarity index 100% rename from binding-components/one-way-bc/src/main/resources/Mqttconfig_block1_interface_1 rename to examples-for-test/binding-components/one-way-bc/src/main/resources/Mqttconfig_block1_interface_1 diff --git a/binding-components/one-way-bc/src/main/resources/Mqttconfig_block2_interface_1 b/examples-for-test/binding-components/one-way-bc/src/main/resources/Mqttconfig_block2_interface_1 similarity index 100% rename from binding-components/one-way-bc/src/main/resources/Mqttconfig_block2_interface_1 rename to examples-for-test/binding-components/one-way-bc/src/main/resources/Mqttconfig_block2_interface_1 diff --git a/binding-components/one-way-bc/src/main/resources/MqttserviceDescription-284bytes.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/MqttserviceDescription-284bytes.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/MqttserviceDescription-284bytes.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/MqttserviceDescription-284bytes.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/MqttserviceDescription-800bytes.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/MqttserviceDescription-800bytes.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/MqttserviceDescription-800bytes.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/MqttserviceDescription-800bytes.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/MqttserviceDescription.gidl b/examples-for-test/binding-components/one-way-bc/src/main/resources/MqttserviceDescription.gidl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/MqttserviceDescription.gidl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/MqttserviceDescription.gidl diff --git a/binding-components/one-way-bc/src/main/resources/MqttserviceDescription.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/MqttserviceDescription.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/MqttserviceDescription.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/MqttserviceDescription.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/Restconfig_block1_interface_1 b/examples-for-test/binding-components/one-way-bc/src/main/resources/Restconfig_block1_interface_1 similarity index 100% rename from binding-components/one-way-bc/src/main/resources/Restconfig_block1_interface_1 rename to examples-for-test/binding-components/one-way-bc/src/main/resources/Restconfig_block1_interface_1 diff --git a/binding-components/one-way-bc/src/main/resources/Restconfig_block2_interface_1 b/examples-for-test/binding-components/one-way-bc/src/main/resources/Restconfig_block2_interface_1 similarity index 100% rename from binding-components/one-way-bc/src/main/resources/Restconfig_block2_interface_1 rename to examples-for-test/binding-components/one-way-bc/src/main/resources/Restconfig_block2_interface_1 diff --git a/binding-components/one-way-bc/src/main/resources/RestserviceDescription-800bytes.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/RestserviceDescription-800bytes.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/RestserviceDescription-800bytes.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/RestserviceDescription-800bytes.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/RestserviceDescription.gidl b/examples-for-test/binding-components/one-way-bc/src/main/resources/RestserviceDescription.gidl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/RestserviceDescription.gidl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/RestserviceDescription.gidl diff --git a/binding-components/one-way-bc/src/main/resources/RestserviceDescription.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/RestserviceDescription.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/RestserviceDescription.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/RestserviceDescription.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/RestserviceDescription284bytes.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/RestserviceDescription284bytes.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/RestserviceDescription284bytes.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/RestserviceDescription284bytes.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/WebSocketconfig_block1_interface_1 b/examples-for-test/binding-components/one-way-bc/src/main/resources/WebSocketconfig_block1_interface_1 similarity index 100% rename from binding-components/one-way-bc/src/main/resources/WebSocketconfig_block1_interface_1 rename to examples-for-test/binding-components/one-way-bc/src/main/resources/WebSocketconfig_block1_interface_1 diff --git a/binding-components/one-way-bc/src/main/resources/WebSocketconfig_block2_interface_1 b/examples-for-test/binding-components/one-way-bc/src/main/resources/WebSocketconfig_block2_interface_1 similarity index 100% rename from binding-components/one-way-bc/src/main/resources/WebSocketconfig_block2_interface_1 rename to examples-for-test/binding-components/one-way-bc/src/main/resources/WebSocketconfig_block2_interface_1 diff --git a/binding-components/one-way-bc/src/main/resources/WebSocketserviceDescription-5000.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/WebSocketserviceDescription-5000.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/WebSocketserviceDescription-5000.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/WebSocketserviceDescription-5000.gxdl diff --git a/binding-components/one-way-bc/src/main/resources/WebSocketserviceDescription.gxdl b/examples-for-test/binding-components/one-way-bc/src/main/resources/WebSocketserviceDescription.gxdl similarity index 100% rename from binding-components/one-way-bc/src/main/resources/WebSocketserviceDescription.gxdl rename to examples-for-test/binding-components/one-way-bc/src/main/resources/WebSocketserviceDescription.gxdl diff --git a/binding-components/one-way-bc/src/test/java/eu/chorevolution/vsb/manual/binding/components/AppTest.java b/examples-for-test/binding-components/one-way-bc/src/test/java/eu/chorevolution/vsb/manual/binding/components/AppTest.java similarity index 100% rename from binding-components/one-way-bc/src/test/java/eu/chorevolution/vsb/manual/binding/components/AppTest.java rename to examples-for-test/binding-components/one-way-bc/src/test/java/eu/chorevolution/vsb/manual/binding/components/AppTest.java diff --git a/binding-components/pom.xml b/examples-for-test/binding-components/pom.xml similarity index 79% rename from binding-components/pom.xml rename to examples-for-test/binding-components/pom.xml index c26c06cd..ad16aa7e 100644 --- a/binding-components/pom.xml +++ b/examples-for-test/binding-components/pom.xml @@ -2,7 +2,7 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> - <artifactId>vsb</artifactId> + <artifactId>examples-for-test</artifactId> <groupId>eu.chorevolution.vsb</groupId> <version>0.0.1-SNAPSHOT</version> </parent> @@ -11,10 +11,6 @@ <description>Manual binding components for various services, using the VSB libraries</description> <packaging>pom</packaging> <modules> - <!-- <module>bc-gui</module> - <module>weather-bc</module> - <module>rest-bc</module> - <module>examples</module> --> <module>one-way-bc</module> </modules> -</project> \ No newline at end of file +</project> diff --git a/examples-for-test/pom.xml b/examples-for-test/pom.xml index 32a0a5e9..d6541b81 100644 --- a/examples-for-test/pom.xml +++ b/examples-for-test/pom.xml @@ -16,5 +16,7 @@ <module>set-inv-addr-webapp</module> <module>TestBindingComponentService</module> <module>monitor-test</module> + <module>scenarios-end-to-end-test</module> + </modules> -</project> \ No newline at end of file +</project> diff --git a/examples-for-test/scenarios-end-to-end-test/pom.xml b/examples-for-test/scenarios-end-to-end-test/pom.xml new file mode 100644 index 00000000..c5208344 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/pom.xml @@ -0,0 +1,135 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>examples-for-test</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>scenarios-end-to-end-test</artifactId> + <name>scenarios-end-to-end-test</name> + <description>Manual end-to-end scenario testing, using the VSB libraries and mocking binded systems</description> + <repositories> + <!-- REST library: Restlet --> + <repository> + <id>maven-restlet</id> + <name>Public online Restlet repository</name> + <url>http://maven.restlet.org</url> + </repository> + <repository> + <id>ow2-nexus-snapshots</id> + <url>http://repository.ow2.org/nexus/content/repositories/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + <repository> + <id>ow2-releases</id> + <url>http://repository.ow2.org/nexus/content/repositories/releases/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.2</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <!-- Chorevolution --> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>gm-rest</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>gm-soap</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>bc-manager</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + + + <dependency> + <groupId>eu.chorevolution.ee</groupId> + <artifactId>chorspec</artifactId> + <version>1.0.1-SNAPSHOT</version> + </dependency> + + <!-- + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>vsb-manager-with-dependencies</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + --> + <!-- REST: Jersey --> + <dependency> + <groupId>javax.ws.rs</groupId> + <artifactId>javax.ws.rs-api</artifactId> + <version>2.0.1</version> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.containers</groupId> + <artifactId>jersey-container-grizzly2-http</artifactId> + <version>2.22</version> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.core</groupId> + <artifactId>jersey-server</artifactId> + <version>2.22</version> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.media</groupId> + <artifactId>jersey-media-json-jackson</artifactId> + <version>2.22</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + <version>2.6.4</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <version>2.6.4</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-annotations</artifactId> + <version>2.6.4</version> + </dependency> + <!-- RestLet --> + <dependency> + <groupId>org.restlet.jse</groupId> + <artifactId>org.restlet</artifactId> + <version>2.3.1</version> + </dependency> + <!-- JSON parsing & Mapping --> + <dependency> + <groupId>com.sun.xml.bind</groupId> + <artifactId>jaxb-jxc</artifactId> + <version>2.2.11</version> + </dependency> + </dependencies> +</project> diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/stinvaddress/SetInvAddressClient.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/stinvaddress/SetInvAddressClient.java new file mode 100644 index 00000000..08d619dd --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/stinvaddress/SetInvAddressClient.java @@ -0,0 +1,29 @@ +package eu.chorevolution.vsb.test.stinvaddress; + +import java.util.ArrayList; +import java.util.List; +import eu.chorevolution.chors.BaseService; +import eu.chorevolution.chors.Base; + +public class SetInvAddressClient { + + + public static void main(String[] args){ + // TODO Auto-generated method stub + String wsdl = "http://localhost:8848/BaseService/setinvaddr?wsdl"; + String url = "http://localhost:8848/BaseService/setinvaddr"; + BaseService service; + List<String> endPoint = new ArrayList<String>(); + try { + + service = (BaseService)Base.getPort("Base", wsdl, url, BaseService.class); + endPoint.add("http://jinx.viktoria.chalmers.se:3004/getCongestion​"); + service.setInvocationAddress("SetInvAddress", "Congestion", endPoint); + + }catch (Exception e) { + // TODO: handle exception + } + + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/BindingComponentManager.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/BindingComponentManager.java new file mode 100644 index 00000000..5fe949d5 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/BindingComponentManager.java @@ -0,0 +1,33 @@ +package eu.chorevolution.vsb.test.trafficlight; + +import eu.chorevolution.vsb.bc.manager.BcManagerRestService; +import eu.chorevolution.vsb.gmdl.utils.BcConfiguration; + +public class BindingComponentManager { + public static void main(String[] args) { + + // Should parse the local config file and instantiate the + BcConfiguration configuration = new BcConfiguration(/*path/to/local/config/file*/); + + // test purpose: should be extract when parsing the config file +// configuration.setSubcomponentRole("SERVER"); + configuration.setServiceAddress("http://localhost:8282"); + configuration.setServiceName("BindingComponent"); + configuration.setTargetNamespace("eu.chorevolution.vsb.test.trafficlight.bc"); + // END test purpose + +// BcManager manager = new BcManager(configuration); + +// manager.setEndpointAddress("http://localhost:8888/BindingComponent"); // should be called remotely via Manager REST interface +// manager.start(); + + /*try { + Thread.sleep(10000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + manager.stop();*/ + } +} \ No newline at end of file diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/bc/BindingComponent.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/bc/BindingComponent.java new file mode 100644 index 00000000..fa9ea57f --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/bc/BindingComponent.java @@ -0,0 +1,46 @@ +package eu.chorevolution.vsb.test.trafficlight.bc; + +import java.util.ArrayList; +import java.util.List; + +import javax.jws.WebMethod; +import javax.jws.WebService; + +import eu.chorevolution.vsb.gm.protocols.builders.ResponseBuilder; +import eu.chorevolution.vsb.gm.protocols.primitives.BcGmSubcomponent; +import eu.chorevolution.vsb.gmdl.utils.Data; + +/** + * This class was generated by the CHOReVOLUTION BindingComponent Generator + * using com.sun.codemodel 2.6 + * + */ +@WebService(serviceName = "BindingComponent", targetNamespace = "eu.chorevolution.vsb.test.trafficlight.bc") +public class BindingComponent { + + private final BcGmSubcomponent apiRef; + + public BindingComponent(BcGmSubcomponent apiRef) { + this.apiRef = apiRef; + } + + @WebMethod + public TrafficLight getTrafficLight(Integer id) { + List<Data<?>> datas = new ArrayList<Data<?>>(); + datas.add(new Data<Integer>("id", "Integer", true, id, "PATH")); + String serializedlight = this.apiRef.mgetTwowaySync("/traffic-lights/{id}", + datas); + System.out.println("Answer from REST: " + serializedlight); + return ResponseBuilder.unmarshalObject("application/json", serializedlight, + TrafficLight.class); + } + + @WebMethod + public void postTrafficLight(TrafficLight light) { + List<Data<?>> datas = new ArrayList<Data<?>>(); + datas.add(new Data<TrafficLight>("light", "TrafficLight", false, light, + "BODY")); + this.apiRef.mgetOneway("/traffic-lights", datas); + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/bc/TrafficLight.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/bc/TrafficLight.java new file mode 100644 index 00000000..ffcf96c1 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/bc/TrafficLight.java @@ -0,0 +1,48 @@ +package eu.chorevolution.vsb.test.trafficlight.bc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + + +/** + * This class was generated by the CHOReVOLUTION BindingComponent Generator using com.sun.codemodel 2.6 + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "TrafficLight") +public class TrafficLight { + + @XmlElement(name = "id", required = true) + private Integer id; + @XmlElement(name = "status", required = true) + private String status; + @XmlElement(name = "address", required = true) + private String address; + + public Integer getid() { + return id; + } + + public void setid(Integer id) { + this.id = id; + } + + public String getstatus() { + return status; + } + + public void setstatus(String status) { + this.status = status; + } + + public String getaddress() { + return address; + } + + public void setaddress(String address) { + this.address = address; + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/RestLegacyServiceMock.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/RestLegacyServiceMock.java new file mode 100644 index 00000000..a073b367 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/RestLegacyServiceMock.java @@ -0,0 +1,38 @@ +package eu.chorevolution.vsb.test.trafficlight.mock; + +import java.io.IOException; +import java.net.URI; +import java.util.logging.Level; +import java.util.logging.Logger; + +//import org.glassfish.grizzly.http.server.HttpServer; +//import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; +//import org.glassfish.jersey.server.ResourceConfig; + +import eu.chorevolution.vsb.test.trafficlight.mock.restservice.JaxRsTrafficLightResource; + +public class RestLegacyServiceMock { + +// private static final URI BASE_URI = URI.create("http://localhost:8282/"); +// public static final String ROOT_PATH = "traffic-lights"; +// +// public static void main(String[] args) { +// try { +// final ResourceConfig resourceConfig = new ResourceConfig(JaxRsTrafficLightResource.class); +// final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, resourceConfig, false); +// Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { +// @Override +// public void run() { +// server.shutdownNow(); +// } +// })); +// server.start(); +// +// System.out.println(String.format("Application started.\nTry out %s%s\nStop the application using CTRL+C", BASE_URI, ROOT_PATH)); +// +// Thread.currentThread().join(); +// } catch (IOException | InterruptedException ex) { +// Logger.getLogger(RestLegacyServiceMock.class.getName()).log(Level.SEVERE,null, ex); +// } +// } +} \ No newline at end of file diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/SoapClientMock.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/SoapClientMock.java new file mode 100644 index 00000000..01690127 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/SoapClientMock.java @@ -0,0 +1,5 @@ +package eu.chorevolution.vsb.test.trafficlight.mock; + +public class SoapClientMock { + // use SoapUI instead +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/JaxRsTrafficLightResource.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/JaxRsTrafficLightResource.java new file mode 100644 index 00000000..2a496862 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/JaxRsTrafficLightResource.java @@ -0,0 +1,51 @@ +package eu.chorevolution.vsb.test.trafficlight.mock.restservice; + +import java.net.URI; +import java.net.URISyntaxException; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.GenericEntity; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +@Path("/traffic-lights") +public class JaxRsTrafficLightResource { + + @POST + @Consumes(MediaType.APPLICATION_JSON) + public Response postTrafficLight(TrafficLight light) { + LightPersistence.getInstance().put(light.getId(), light); + System.out.println("Resource created"); + try { + return Response + .status(Status.CREATED) + .contentLocation(new URI("http://localhost:8282/traffic-lights/"+light.getId())) + .build(); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + return null; + } + + @GET + @Path("{id}") + @Produces(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_JSON) + public Response getTrafficLight(@PathParam("id") Integer id) { + try { + if (LightPersistence.getInstance().containsKey(id)) { + GenericEntity<TrafficLight> light = new GenericEntity<TrafficLight>(LightPersistence.getInstance().get(id)) {}; + return Response.ok(light).build(); + } + } catch (Exception e) { + e.printStackTrace(); + } + return Response.status(Status.NO_CONTENT).build(); + } +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/LightPersistence.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/LightPersistence.java new file mode 100644 index 00000000..de5ee735 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/LightPersistence.java @@ -0,0 +1,18 @@ +package eu.chorevolution.vsb.test.trafficlight.mock.restservice; + +import java.util.HashMap; + +public class LightPersistence extends HashMap<Integer, TrafficLight> { + private static LightPersistence instance = null; + + private LightPersistence() {} + + public static LightPersistence getInstance() { + if (instance == null) { + instance = new LightPersistence(); + return instance; + } else { + return instance; + } + } +} \ No newline at end of file diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/RestTrafficLightService-GMDL.json b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/RestTrafficLightService-GMDL.json new file mode 100644 index 00000000..0d8c262c --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/RestTrafficLightService-GMDL.json @@ -0,0 +1,66 @@ +/* TrafficLights REST Service (Legacy) */ +{ + "host_address": "127.0.0.1:8282", + "protocol": "REST", + "operations": { + "operation_1": { + "operation_type": "one_way", + "role": "server", + "scope": { + "verb": "POST", + "name": "postTrafficLight", + "uri": "/traffic-lights" + }, + "get_data": [ + { + "data_name": "light", + "type": "object", + "$ref": "#/definitions/TrafficLight", + "context": "body" // could be body, path, query, form, header, multipart/url-encode (for files) + } + ] + }, + "operation_2": { + "operation_type": "two_way_sync", + "role": "server", + "scope": { + "verb": "GET", + "name": "getTrafficLight", + "uri": "/traffic-lights/{id}" + }, + "get_data": [ + { + "data_name": "id", + "type": "integer", + "context":"path" // could be body, path, query, form, header, multipart/url-encode (for files) + } + ], + "post_data": [ + { + "data_name": "light", + "type": "object", + "$ref": "#/definitions/TrafficLight" + } + ] + } + }, + "definitions": { + "TrafficLight": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + }, + "address": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/TrafficLight.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/TrafficLight.java new file mode 100644 index 00000000..511d5580 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/restservice/TrafficLight.java @@ -0,0 +1,25 @@ +package eu.chorevolution.vsb.test.trafficlight.mock.restservice; + +public class TrafficLight { + private int id; + private String address; + private String status; + + public TrafficLight() {} + + public Integer getId() { + return id; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + + public String getAddress() { + return address; + } +} \ No newline at end of file diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/BindingComponentManager.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/BindingComponentManager.java new file mode 100644 index 00000000..a85df385 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/BindingComponentManager.java @@ -0,0 +1,34 @@ +package eu.chorevolution.vsb.test.weather; + +import eu.chorevolution.vsb.test.trafficlight.*; +import eu.chorevolution.vsb.bc.manager.BcManagerRestService; +import eu.chorevolution.vsb.gmdl.utils.BcConfiguration; + +public class BindingComponentManager { + public static void main(String[] args) { + + // Should parse the local config file and instantiate the + BcConfiguration configuration = new BcConfiguration(/*path/to/local/config/file*/); + + // test purpose: should be extract when parsing the config file +// configuration.setSubcomponentRole("SERVER"); + configuration.setServiceAddress("http://93.62.202.227"); + configuration.setServiceName("BindingComponent"); + configuration.setTargetNamespace("eu.chorevolution.vsb.test.weather.bc"); + // END test purpose + +// BcManager manager = new BcManager(configuration); + +// manager.setEndpointAddress("http://localhost:8888/BindingComponent"); // should be called remotely via Manager REST interface +// manager.start(); + + /*try { + Thread.sleep(10000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + manager.stop();*/ + } +} \ No newline at end of file diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/BindingComponent.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/BindingComponent.java new file mode 100644 index 00000000..07d1c814 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/BindingComponent.java @@ -0,0 +1,39 @@ +package eu.chorevolution.vsb.test.weather.bc; + +import java.util.ArrayList; +import java.util.List; +import javax.jws.WebMethod; +import javax.jws.WebService; +import eu.chorevolution.vsb.gm.protocols.builders.ResponseBuilder; +import eu.chorevolution.vsb.gm.protocols.primitives.BcGmSubcomponent; +import eu.chorevolution.vsb.gmdl.utils.Data; + +/** + * This class was generated by the CHOReVOLUTION BindingComponent Generator + * using com.sun.codemodel 2.6 + * + */ +@WebService(serviceName = "BindingComponent", targetNamespace = "eu.chorevolution.vsb.test.weather.bc") +public class BindingComponent { + + private final BcGmSubcomponent apiRef; + + public BindingComponent(BcGmSubcomponent apiRef) { + this.apiRef = apiRef; + } + + @WebMethod + public ComplexType weatherInfoByAreaRequest(Integer period, Double latitude, Double longitude, Double radius) { + List<Data<?>> datas = new ArrayList<Data<?>>(); + datas.add(new Data<Integer>("period", "Integer", true, period, "PATH")); + datas.add(new Data<Double>("latitude", "Double", true, latitude, "PATH")); + datas.add(new Data<Double>("longitude", "Double", true, longitude, "PATH")); + datas.add(new Data<Double>("radius", "Double", true, radius, "PATH")); + String serializedcomplexType = this.apiRef.mgetTwowaySync( + "/mes/get_metadata_in_area?collection=weather&period={period}&lat={latitude}&lon={longitude}&radius={radius}", datas); + System.out.println("Answer from REST: " + serializedcomplexType); + + return ResponseBuilder.unmarshalObject("application/json", serializedcomplexType, ComplexType.class); + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/ComplexType.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/ComplexType.java new file mode 100644 index 00000000..4e60d2d3 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/ComplexType.java @@ -0,0 +1,40 @@ +package eu.chorevolution.vsb.test.weather.bc; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * This class was generated by the CHOReVOLUTION BindingComponent Generator + * using com.sun.codemodel 2.6 + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "ComplexType") +public class ComplexType { + + @XmlElement(name = "status", required = true) + private String status; + @XmlElement(name = "docs", required = true) + private List<WeatherType> docs; + + public String getstatus() { + return status; + } + + public void setstatus(String status) { + this.status = status; + } + + public List<WeatherType> getdocs() { + return docs; + } + + public void setdocs(List<WeatherType> docs) { + this.docs = docs; + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/Location.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/Location.java new file mode 100644 index 00000000..19c35bed --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/Location.java @@ -0,0 +1,40 @@ +package eu.chorevolution.vsb.test.weather.bc; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * This class was generated by the CHOReVOLUTION BindingComponent Generator + * using com.sun.codemodel 2.6 + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "Location") +public class Location { + + @XmlElement(name = "type", required = true) + private String type; + @XmlElement(name = "coordinates", required = true) + private List<Double> coordinates; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List<Double> getCoordinates() { + return coordinates; + } + + public void setCoordinates(List<Double> coordinates) { + this.coordinates = coordinates; + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/WeatherType.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/WeatherType.java new file mode 100644 index 00000000..aee11c3f --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/bc/WeatherType.java @@ -0,0 +1,178 @@ +package eu.chorevolution.vsb.test.weather.bc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * This class was generated by the CHOReVOLUTION BindingComponent Generator + * using com.sun.codemodel 2.6 + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "WeatherType") +public class WeatherType { + + @XmlElement(name = "latitude", required = true) + private Double latitude; + @XmlElement(name = "longitude", required = true) + private Double longitude; + @XmlElement(name = "temperature", required = true) + private Double temperature; + @XmlElement(name = "pressure", required = true) + private Double pressure; + @XmlElement(name = "observation_time", required = true) + private String observation_time; + @XmlElement(name = "tag", required = true) + private String tag; + @XmlElement(name = "__CLASS__", required = true) + private String __CLASS__; + @XmlElement(name = "collection", required = true) + private String collection; + @XmlElement(name = "id", required = true) + private String id; + @XmlElement(name = "_id", required = true) + private String _id; + @XmlElement(name = "location", required = true) + private Location location; + @XmlElement(name = "status", required = true) + private Double status; + @XmlElement(name = "humidity", required = true) + private Integer humidity; + @XmlElement(name = "creation_date", required = true) + private String creation_date; + @XmlElement(name = "elevation", required = true) + private Double elevation; + @XmlElement(name = "rain", required = true) + private String rain; + + public Location getLocation() { + return location; + } + + public void setLocation(Location location) { + this.location = location; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String get__CLASS__() { + return __CLASS__; + } + + public void set__CLASS__(String __CLASS__) { + this.__CLASS__ = __CLASS__; + } + + public String getCollection() { + return collection; + } + + public void setCollection(String collection) { + this.collection = collection; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String get_id() { + return _id; + } + + public void set_id(String _id) { + this._id = _id; + } + + public Double getStatus() { + return status; + } + + public void setStatus(Double status) { + this.status = status; + } + + public Double getlatitude() { + return latitude; + } + + public void setlatitude(Double latitude) { + this.latitude = latitude; + } + + public Double getlongitude() { + return longitude; + } + + public void setlongitude(Double longitude) { + this.longitude = longitude; + } + + public Double gettemperature() { + return temperature; + } + + public void settemperature(Double temperature) { + this.temperature = temperature; + } + + public Double getpressure() { + return pressure; + } + + public void setpressure(Double pressure) { + this.pressure = pressure; + } + + public String getobservation_time() { + return observation_time; + } + + public void setobservation_time(String observation_time) { + this.observation_time = observation_time; + } + + public Integer gethumidity() { + return humidity; + } + + public void sethumidity(Integer humidity) { + this.humidity = humidity; + } + + public String getcreation_date() { + return creation_date; + } + + public void setcreation_date(String creation_date) { + this.creation_date = creation_date; + } + + public Double getelevation() { + return elevation; + } + + public void setelevation(Double elevation) { + this.elevation = elevation; + } + + public String getrain() { + return rain; + } + + public void setrain(String rain) { + this.rain = rain; + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/ComplexType.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/ComplexType.java new file mode 100644 index 00000000..3f9c63db --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/ComplexType.java @@ -0,0 +1,40 @@ +package eu.chorevolution.vsb.test.weather.restletclient; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * This class was generated by the CHOReVOLUTION BindingComponent Generator + * using com.sun.codemodel 2.6 + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "ComplexType") +public class ComplexType { + + @XmlElement(name = "status", required = true) + private String status; + @XmlElement(name = "docs", required = true) + private List<WeatherType> docs; + + public String getstatus() { + return status; + } + + public void setstatus(String status) { + this.status = status; + } + + public List<WeatherType> getdocs() { + return docs; + } + + public void setdocs(List<WeatherType> docs) { + this.docs = docs; + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/Location.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/Location.java new file mode 100644 index 00000000..459130fc --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/Location.java @@ -0,0 +1,40 @@ +package eu.chorevolution.vsb.test.weather.restletclient; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * This class was generated by the CHOReVOLUTION BindingComponent Generator + * using com.sun.codemodel 2.6 + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "Location") +public class Location { + + @XmlElement(name = "type", required = true) + private String type; + @XmlElement(name = "coordinates", required = true) + private List<Double> coordinates; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List<Double> getCoordinates() { + return coordinates; + } + + public void setCoordinates(List<Double> coordinates) { + this.coordinates = coordinates; + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/RestClient.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/RestClient.java new file mode 100644 index 00000000..62ff6c6e --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/RestClient.java @@ -0,0 +1,104 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package eu.chorevolution.vsb.test.weather.restletclient; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; + +import javax.ws.rs.core.UriBuilder; + +import org.restlet.Client; +import org.restlet.Request; +import org.restlet.Response; +import org.restlet.data.Form; +import org.restlet.data.Method; +import org.restlet.data.Protocol; +import org.restlet.representation.StringRepresentation; +import org.restlet.resource.ClientResource; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * + * @author boulouka + */ +public class RestClient { + + private Client client; + // private String uri = "http://localhost:8282/traffic-lights/{id}"; + + // private String uri = + // "http://93.62.202.227/mes/get_metadata_in_area?collection={collection}&period={period}&lat={latitude}&lon={longitude}&radius={radius}"; + + private String uri = "http://93.62.202.227/mes/get_metadata_in_area?collection={collection}&period={period}"; + + public static void main(String[] args) throws JsonMappingException, + JsonParseException { + RestClient rest = new RestClient(); + rest.getResponse(); + } + + public Response getResponse() throws JsonMappingException, JsonParseException { + + this.client = new Client(Protocol.HTTP); + try { + this.client.start(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + Request request = new Request(); + + UriBuilder builder = UriBuilder.fromPath(this.uri); + + // builder.resolveTemplate("id", "1"); + +// builder.resolveTemplate("collection", "weather"); +// builder.resolveTemplate("period", "3600"); + // builder.resolveTemplate("latitude", "44.41016"); + // builder.resolveTemplate("longitude", "8.92637"); + // builder.resolveTemplate("radius", "1.5"); + + // builder.buildFromEncoded("%20"); + + // request.setResourceRef(builder.toString()); + + try { + request.setResourceRef(java.net.URLDecoder.decode(builder.toString(), + "UTF-8")); + } catch (UnsupportedEncodingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + request.setMethod(Method.GET); + + Response response = this.client.handle(request); + System.out.println(response.getEntityAsText()); + + String serializedObject = response.getEntityAsText(); + ObjectMapper mapper = new ObjectMapper(); + +// try { +// +// // Convert JSON string to Object +//// ComplexType Ti = mapper.readValue(serializedObject, ComplexType.class); +// System.out.println(Ti.getstatus()); +// +// } catch (JsonMappingException e){ +// e.printStackTrace(); +// } catch (IOException e) { +// e.printStackTrace(); +// } + + return null; + + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/WeatherType.java b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/WeatherType.java new file mode 100644 index 00000000..0073c6e5 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/weather/restletclient/WeatherType.java @@ -0,0 +1,178 @@ +package eu.chorevolution.vsb.test.weather.restletclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * This class was generated by the CHOReVOLUTION BindingComponent Generator + * using com.sun.codemodel 2.6 + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "WeatherType") +public class WeatherType { + + @XmlElement(name = "latitude", required = true) + private Double latitude; + @XmlElement(name = "longitude", required = true) + private Double longitude; + @XmlElement(name = "temperature", required = true) + private Double temperature; + @XmlElement(name = "pressure", required = true) + private Double pressure; + @XmlElement(name = "observation_time", required = true) + private String observation_time; + @XmlElement(name = "tag", required = true) + private String tag; + @XmlElement(name = "__CLASS__", required = true) + private String __CLASS__; + @XmlElement(name = "collection", required = true) + private String collection; + @XmlElement(name = "id", required = true) + private String id; + @XmlElement(name = "_id", required = true) + private String _id; + @XmlElement(name = "location", required = true) + private Location location; + @XmlElement(name = "status", required = true) + private Double status; + @XmlElement(name = "humidity", required = true) + private Integer humidity; + @XmlElement(name = "creation_date", required = true) + private String creation_date; + @XmlElement(name = "elevation", required = true) + private Double elevation; + @XmlElement(name = "rain", required = true) + private String rain; + + public Location getLocation() { + return location; + } + + public void setLocation(Location location) { + this.location = location; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String get__CLASS__() { + return __CLASS__; + } + + public void set__CLASS__(String __CLASS__) { + this.__CLASS__ = __CLASS__; + } + + public String getCollection() { + return collection; + } + + public void setCollection(String collection) { + this.collection = collection; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String get_id() { + return _id; + } + + public void set_id(String _id) { + this._id = _id; + } + + public Double getStatus() { + return status; + } + + public void setStatus(Double status) { + this.status = status; + } + + public Double getlatitude() { + return latitude; + } + + public void setlatitude(Double latitude) { + this.latitude = latitude; + } + + public Double getlongitude() { + return longitude; + } + + public void setlongitude(Double longitude) { + this.longitude = longitude; + } + + public Double gettemperature() { + return temperature; + } + + public void settemperature(Double temperature) { + this.temperature = temperature; + } + + public Double getpressure() { + return pressure; + } + + public void setpressure(Double pressure) { + this.pressure = pressure; + } + + public String getobservation_time() { + return observation_time; + } + + public void setobservation_time(String observation_time) { + this.observation_time = observation_time; + } + + public Integer gethumidity() { + return humidity; + } + + public void sethumidity(Integer humidity) { + this.humidity = humidity; + } + + public String getcreation_date() { + return creation_date; + } + + public void setcreation_date(String creation_date) { + this.creation_date = creation_date; + } + + public Double getelevation() { + return elevation; + } + + public void setelevation(Double elevation) { + this.elevation = elevation; + } + + public String getrain() { + return rain; + } + + public void setrain(String rain) { + this.rain = rain; + } + +} diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/resources/BaseService.wsdl b/examples-for-test/scenarios-end-to-end-test/src/main/resources/BaseService.wsdl new file mode 100644 index 00000000..a33344ff --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/resources/BaseService.wsdl @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.9-b14002 svn-revision#14004. --> +<definitions targetNamespace="http://services.chorevolution.eu/" name="ConfigurableService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:tns="http://services.chorevolution.eu/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"> + <types> + <xs:schema version="1.0" targetNamespace="http://services.chorevolution.eu/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> + + <xs:element name="setInvocationAddress" type="tns:setInvocationAddress"/> + + <xs:element name="setInvocationAddressResponse" type="tns:setInvocationAddressResponse"/> + + <xs:complexType name="setInvocationAddress"> + <xs:sequence> + <xs:element name="arg0" type="xs:string" minOccurs="0"/> + <xs:element name="arg1" type="xs:string" minOccurs="0"/> + + <xs:element name="arg2" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + + </xs:sequence> + </xs:complexType> + + <xs:complexType name="setInvocationAddressResponse"> + <xs:sequence/> + </xs:complexType> +</xs:schema> + </types> + <message name="setInvocationAddress"> + <part name="parameters" element="tns:setInvocationAddress"/> + </message> + <message name="setInvocationAddressResponse"> + <part name="parameters" element="tns:setInvocationAddressResponse"/> + </message> + <portType name="ConfigurableService"> + <operation name="setInvocationAddress"> + <input wsam:Action="http://services.chorevolution.eu/ConfigurableService/setInvocationAddressRequest" message="tns:setInvocationAddress"/> + <output wsam:Action="http://services.chorevolution.eu/ConfigurableService/setInvocationAddressResponse" message="tns:setInvocationAddressResponse"/> + </operation> + </portType> + <binding name="ConfigurableServicePortBinding" type="tns:ConfigurableService"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> + <operation name="setInvocationAddress"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + </binding> + <service name="ConfigurableService"> + <port name="ConfigurableServicePort" binding="tns:ConfigurableServicePortBinding"> + <soap:address location="http://localhost:9999/vsb/baseService"/> + </port> + </service> +</definitions> + diff --git a/examples-for-test/scenarios-end-to-end-test/src/main/resources/wsdl-to-code.txt b/examples-for-test/scenarios-end-to-end-test/src/main/resources/wsdl-to-code.txt new file mode 100644 index 00000000..4abfd9d5 --- /dev/null +++ b/examples-for-test/scenarios-end-to-end-test/src/main/resources/wsdl-to-code.txt @@ -0,0 +1,5 @@ +String interfaceDescriptionPath = "D://inria//code//repositories//chorevolution//evolution-service-bus//bc-manager//src//main//resources//weather.gidl"; + + + +wsimport -d . -s .\java .\resources\BaseService.wsdl \ No newline at end of file diff --git a/gmdl-utils/src/main/java/eu/chorevolution/vsb/gmdl/utils/PathResolver.java b/gmdl-utils/src/main/java/eu/chorevolution/vsb/gmdl/utils/PathResolver.java index c32c091b..ce40f7ae 100644 --- a/gmdl-utils/src/main/java/eu/chorevolution/vsb/gmdl/utils/PathResolver.java +++ b/gmdl-utils/src/main/java/eu/chorevolution/vsb/gmdl/utils/PathResolver.java @@ -76,7 +76,8 @@ public class PathResolver { */ public static String myFilePath(Class className, String fileName) { - + + String[] fileNameToArray = fileName.split("\\."); String fileNameExtension = fileNameToArray[fileNameToArray.length - 1]; File file = null; @@ -87,12 +88,20 @@ public class PathResolver { return ""; } - if (res.toString().startsWith("jar:")) { + if (res.toString().startsWith("jar:")){ - try { + try{ java.io.InputStream input = className.getClassLoader().getResourceAsStream(fileName); + System.out.println(" fileNameExtension "+fileNameExtension); + if(fileNameExtension.contains("/")){ + + fileNameExtension = "conf"; + } + System.out.println(" fileNameExtension "+fileNameExtension); + file = File.createTempFile("tempfile", "." + fileNameExtension); + OutputStream out = new FileOutputStream(file); int read; byte[] bytes = new byte[1024]; diff --git a/playgrounds/pub-sub/mqtt-playground/target2/localhost/KahaDB/db.data b/playgrounds/pub-sub/mqtt-playground/target2/localhost/KahaDB/db.data index 1f1f6c1947f797cf118a45f82ca59368c2237ca1..39b5d2ead19abc8dd473ef3b803e22a7229f203e 100644 GIT binary patch delta 135 zcmZo@U~Xt&7E|U@4k=Al@G8wwFtkuGu(UEYure~5DAvqqHgT3bi-n;H*T#eP>=Q4r skf3yu00-ms$(#Z*GE59iC!R7eGB7XzS*xD{X*MY5#M8}=0{hnk0C?Xc9{>OV delta 135 zcmZo@U~Xt&7E|U@4o^){@J*~#Fg8>$G`BJ|v@$WADAvqqG;x+Zi@B*G*T#eP>=Q4r skf3yu00-lY$(#Z*GK`G>&mUr7WME(bvd-xPX*MY5{GrW`0{hnk0EJ&9&;S4c diff --git a/playgrounds/pub-sub/mqtt-playground/target2/localhost/KahaDB/db.redo b/playgrounds/pub-sub/mqtt-playground/target2/localhost/KahaDB/db.redo index 426e704e20a0f61c8308abe52f57c98316bb5836..734a864d79021d17717f764bd0bc8e0fff7276a8 100644 GIT binary patch delta 74 zcmcccfa$^mCIJQzVDY&QqPDQH)hrYcV7xwAP(Vh3iGk_FQwBz$IFPmaDUfD^a)81N Q4BQ(P5Akp2S8$vF0FM+9zyJUM delta 74 zcmcccfa$^mCIJQzVDXs&qGVb)G8YO6FwU4PC?KQ2$oT*KAqGaEIFNNtA4s!7IY40s Q2JVfDhxj-1D>zO70I60ILjV8( diff --git a/playgrounds/pub-sub/mqtt-playground/target2/localhost/KahaDB/lock b/playgrounds/pub-sub/mqtt-playground/target2/localhost/KahaDB/lock index fb66b58d23a816f16166076201d777f797a91680..5d0b0a837217d591f2e5f2bd20c80e8682fef5af 100644 GIT binary patch literal 8 PcmZQzV2lk}u{an22EYPQ literal 8 PcmZQzV2p|9|7HXL1)%}- diff --git a/playgrounds/str/websockets-playground/src/main/java/eu/chorevolution/vsb/playgrounds/str/websockets/WebSocketConsummer.java b/playgrounds/str/websockets-playground/src/main/java/eu/chorevolution/vsb/playgrounds/str/websockets/WebSocketConsummer.java index 3527562e..295fc39c 100644 --- a/playgrounds/str/websockets-playground/src/main/java/eu/chorevolution/vsb/playgrounds/str/websockets/WebSocketConsummer.java +++ b/playgrounds/str/websockets-playground/src/main/java/eu/chorevolution/vsb/playgrounds/str/websockets/WebSocketConsummer.java @@ -12,7 +12,7 @@ public class WebSocketConsummer extends org.java_websocket.client.WebSocketClien public BlockingQueue<String> msgQueue; - public WebSocketConsummer(URI serverURI) { + public WebSocketConsummer(URI serverURI){ super(serverURI); msgQueue = new LinkedBlockingQueue<String>(); diff --git a/pom.xml b/pom.xml index 8371f05c..cf63e834 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>eu.chorevolution.vsb</groupId> <artifactId>vsb</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> - + <name>VSB (eVolution Service Bus)</name> <description>VSB provides tools to generate and use Binding-Component</description> @@ -47,51 +48,44 @@ </roles> </developer> </developers> - <distributionManagement> - <repository> - <id>ow2-nexus-releases</id> - <name>OW2 Release Repository</name> - <url>http://repository.ow2.org/nexus/service/local/staging/deploy/maven2/</url> - </repository> - <snapshotRepository> - <id>ow2-nexus-snapshots</id> - <name>OW2 Snapshots Repository</name> - <url>http://repository.ow2.org/nexus/content/repositories/snapshots/</url> - </snapshotRepository> + <repository> + <id>ow2-nexus-releases</id> + <name>OW2 Release Repository</name> + <url>http://repository.ow2.org/nexus/service/local/staging/deploy/maven2/</url> + </repository> + <snapshotRepository> + <id>ow2-nexus-snapshots</id> + <name>OW2 Snapshots Repository</name> + <url>http://repository.ow2.org/nexus/content/repositories/snapshots/</url> + </snapshotRepository> </distributionManagement> - <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> </properties> - <modules> <module>gm-api</module> <module>protocol-pool</module> <module>gmdl-utils</module> <module>bc-generators</module> - <module>vsb-manager</module> <module>bc-manager</module> - <module>scenarios-end-to-end-test</module> - <module>binding-components</module> - <module>playgrounds</module> - <module>tools</module> - <module>vsb-manager-service-bundle</module> - </modules> - + <module>playgrounds</module> + <module>tools</module> + <module>vsb-manager</module> + </modules> <build> <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.16</version> - <configuration> - <reuseForks>false</reuseForks> - <forkCount>1</forkCount> - </configuration> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.16</version> + <configuration> + <reuseForks>false</reuseForks> + <forkCount>1</forkCount> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/protocol-pool/gm-coap/src/main/java/eu/chorevolution/vsb/gm/protocols/coap/BcCoapSubcomponent.java b/protocol-pool/gm-coap/src/main/java/eu/chorevolution/vsb/gm/protocols/coap/BcCoapSubcomponent.java index 63fb8949..8013902e 100644 --- a/protocol-pool/gm-coap/src/main/java/eu/chorevolution/vsb/gm/protocols/coap/BcCoapSubcomponent.java +++ b/protocol-pool/gm-coap/src/main/java/eu/chorevolution/vsb/gm/protocols/coap/BcCoapSubcomponent.java @@ -31,8 +31,8 @@ public class BcCoapSubcomponent extends BcGmSubcomponent { private static CoapClient client = null; private CoapServer server; private GmServiceRepresentation serviceRepresentation; - private MeasureAgent agentPost = null; - static MeasureAgent agentMget = null; +// private MeasureAgent agentPost = null; +// static MeasureAgent agentMget = null; private ExecutorService executor = null; private String coapDestination = null; @@ -41,7 +41,7 @@ public class BcCoapSubcomponent extends BcGmSubcomponent { switch (this.bcConfiguration.getSubcomponentRole()) { case SERVER: - agentMget = new MeasureAgent("timestamp_4",System.currentTimeMillis(),MonitorConstant.M4, MonitorConstant.timestamp_4_port_listener); +// agentMget = new MeasureAgent("timestamp_4",System.currentTimeMillis(),MonitorConstant.M4, MonitorConstant.timestamp_4_port_listener); this.serviceRepresentation = serviceRepresentation; NetworkConfig config = NetworkConfig.getStandard().setInt(NetworkConfig.Keys.PROTOCOL_STAGE_THREAD_COUNT, 100) .setString(NetworkConfig.Keys.DEDUPLICATOR, "NO_DEDUPLICATOR"); @@ -53,7 +53,7 @@ public class BcCoapSubcomponent extends BcGmSubcomponent { case CLIENT: executor = Executors.newFixedThreadPool(10); - agentPost = new MeasureAgent("timestamp_3",System.currentTimeMillis(),MonitorConstant.M2,MonitorConstant.timestamp_3_port_listener); +// agentPost = new MeasureAgent("timestamp_3",System.currentTimeMillis(),MonitorConstant.M2,MonitorConstant.timestamp_3_port_listener); coapDestination = "coap://"+bcConfiguration.getServiceAddress()+":"+bcConfiguration.getServicePort(); this.client = new CoapClient(coapDestination+"bridgeNextClosure").useNONs(); this.client.setURI(coapDestination+"/"+"bridgeNextClosure"); @@ -106,7 +106,7 @@ public class BcCoapSubcomponent extends BcGmSubcomponent { for (Entry<String, Operation> en : serviceRepresentation.getInterfaces().get(0).getOperations() .entrySet()) { if (en.getKey().equals(op_name)) { - agentMget.fire(""+System.currentTimeMillis()+"-"+message_id); +// agentMget.fire(""+System.currentTimeMillis()+"-"+message_id); Operation op = en.getValue(); List<Data<?>> datas = new ArrayList<>(); Context context = null; @@ -184,7 +184,7 @@ public class BcCoapSubcomponent extends BcGmSubcomponent { // client.post(message, MediaTypeRegistry.APPLICATION_JSON); ThreadSendCoapMessage sendCoapMessage = new ThreadSendCoapMessage(jsonObject.toJSONString()+"-"+message_id); - agentPost.fire(""+System.currentTimeMillis()+"-"+message_id); +// agentPost.fire(""+System.currentTimeMillis()+"-"+message_id); sendCoapMessage.start(); sendCoapMessage = null; diff --git a/protocol-pool/gm-dpws/pom.xml b/protocol-pool/gm-dpws/pom.xml index d1f223ce..016a5345 100644 --- a/protocol-pool/gm-dpws/pom.xml +++ b/protocol-pool/gm-dpws/pom.xml @@ -37,10 +37,8 @@ <enabled>false</enabled> </snapshots> </repository> - </repositories> <dependencies> - <dependency> <groupId>eu.chorevolution.vsb.org.ws4d.java</groupId> <artifactId>ws4d-java-se-full-dpws-debug-with-security</artifactId> diff --git a/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/BcDPWSSubcomponent.java b/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/BcDPWSSubcomponent.java index 3512e68b..5090ab0c 100644 --- a/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/BcDPWSSubcomponent.java +++ b/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/BcDPWSSubcomponent.java @@ -25,8 +25,8 @@ public class BcDPWSSubcomponent extends BcGmSubcomponent { private GmServiceRepresentation serviceRepresentation = null; private LinkedList<String> buffer = null; private DpwsEventProvider eventProvider = null; - private MeasureAgent agentPost = null; - private MeasureAgent agentGet = null; +// private MeasureAgent agentPost = null; +// private MeasureAgent agentGet = null; private BcConfiguration bcConfiguration = null; public BcDPWSSubcomponent(BcConfiguration bcConfiguration, GmServiceRepresentation serviceRepresentation) { @@ -42,18 +42,19 @@ public class BcDPWSSubcomponent extends BcGmSubcomponent { // device = new DPWSDevice(); // final DPWSService service = new DPWSService(this); // device.addService(service); - agentGet = new MeasureAgent("timestamp_4",System.currentTimeMillis(),MonitorConstant.M4,MonitorConstant.timestamp_4_port_listener); +// agentGet = new MeasureAgent("timestamp_4",System.currentTimeMillis(),MonitorConstant.M4,MonitorConstant.timestamp_4_port_listener); observer = DpwsObserver.getInstanceObserver(this.bcConfiguration); break; case CLIENT : // client = DPWSClient.getInstanceClient(); - agentPost = new MeasureAgent("timestamp_3",System.currentTimeMillis(),MonitorConstant.M2,MonitorConstant.timestamp_3_port_listener); +// agentPost = new MeasureAgent("timestamp_3",System.currentTimeMillis(),MonitorConstant.M2,MonitorConstant.timestamp_3_port_listener); JMEDSFramework.start(null); buffer = new LinkedList<String>(); - service = new DPWSService(this.bcConfiguration,buffer, agentPost); +// service = new DPWSService(this.bcConfiguration,buffer, agentPost); + service = new DPWSService(this.bcConfiguration,buffer); device = new DPWSDevice(); EventSource eventSource = service.getEventSource(new QName("BasicServices", DPWSDevice.DOCU_NAMESPACE), "DpwsEvent", null, "DpwsEvent"); eventProvider = new DpwsEventProvider((DpwsEvent)eventSource); @@ -148,7 +149,7 @@ public class BcDPWSSubcomponent extends BcGmSubcomponent { } - agentGet.fire(""+System.currentTimeMillis()+"-"+message_id); +// agentGet.fire(""+System.currentTimeMillis()+"-"+message_id); this.nextComponent.postOneway(this.bcConfiguration.getServiceAddress(), scope, (List<Data<?>>)exchange, 0); } diff --git a/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/DPWSService.java b/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/DPWSService.java index de999e45..e8180a92 100644 --- a/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/DPWSService.java +++ b/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/DPWSService.java @@ -24,7 +24,7 @@ public class DPWSService extends DefaultService private BcConfiguration bcConfiguration = null; private final static URI DOCU_EXAMPLE_SERVICE_ID = (new URI(DPWSDevice.DOCU_NAMESPACE + "/DPWSService")); - public DPWSService(BcConfiguration bcConfiguration, LinkedList<String> buffer, MeasureAgent agent) { + public DPWSService(BcConfiguration bcConfiguration, LinkedList<String> buffer) { super(); @@ -40,7 +40,9 @@ public class DPWSService extends DefaultService ); - DpwsEvent dpwsEvent = new DpwsEvent(buffer, agent); +// DpwsEvent dpwsEvent = new DpwsEvent(buffer, agent); + DpwsEvent dpwsEvent = new DpwsEvent(buffer); + addEventSource(dpwsEvent); // DPWSOperation dpwsOperation = new DPWSOperation(subcomponentRef); diff --git a/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/DpwsEvent.java b/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/DpwsEvent.java index 8f16e927..b83d254c 100644 --- a/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/DpwsEvent.java +++ b/protocol-pool/gm-dpws/src/main/java/eu/chorevolution/vsb/gm/protocols/dpws/DpwsEvent.java @@ -18,13 +18,13 @@ public class DpwsEvent extends DefaultEventSource{ public final static String DOCU_NAMESPACE = DPWSDevice.DOCU_NAMESPACE; private LinkedList<String> buffer = null; - private MeasureAgent agent = null; +// private MeasureAgent agent = null; - public DpwsEvent(LinkedList<String> buffer, MeasureAgent agent) { + public DpwsEvent(LinkedList<String> buffer) { super("DpwsEvent", new QName("BasicServices", DOCU_NAMESPACE)); // TODO Auto-generated constructor stub - this.agent = agent; +// this.agent = agent; this.buffer = buffer; Element name = new Element(new QName("name",DOCU_NAMESPACE), SchemaUtil.TYPE_STRING); setOutput(name); @@ -47,8 +47,8 @@ public class DpwsEvent extends DefaultEventSource{ ParameterValue parameterValue = createOutputValue(); ParameterValueManagement.setString(parameterValue, "name", dataEvent); - String message_id = agent.getMessageID(dataEvent); - agent.fire(""+System.currentTimeMillis()+"-"+message_id); +// String message_id = agent.getMessageID(dataEvent); +// agent.fire(""+System.currentTimeMillis()+"-"+message_id); fire(parameterValue, eventCounter++, CredentialInfo.EMPTY_CREDENTIAL_INFO); } diff --git a/protocol-pool/gm-mqtt/pom.xml b/protocol-pool/gm-mqtt/pom.xml index c81736c0..d7195431 100644 --- a/protocol-pool/gm-mqtt/pom.xml +++ b/protocol-pool/gm-mqtt/pom.xml @@ -34,7 +34,7 @@ <groupId>org.fusesource.mqtt-client</groupId> <artifactId>mqtt-client</artifactId> <version>1.10</version> - </dependency> + </dependency> <!-- ActiveMQ --> <dependency> <groupId>org.apache.activemq</groupId> diff --git a/protocol-pool/gm-mqtt/src/main/java/eu/chorevolution/vsb/gm/protocols/mqtt/BcMQTTSubcomponent.java b/protocol-pool/gm-mqtt/src/main/java/eu/chorevolution/vsb/gm/protocols/mqtt/BcMQTTSubcomponent.java index 2e805527..63d82483 100644 --- a/protocol-pool/gm-mqtt/src/main/java/eu/chorevolution/vsb/gm/protocols/mqtt/BcMQTTSubcomponent.java +++ b/protocol-pool/gm-mqtt/src/main/java/eu/chorevolution/vsb/gm/protocols/mqtt/BcMQTTSubcomponent.java @@ -33,7 +33,7 @@ public class BcMQTTSubcomponent extends BcGmSubcomponent { private MqttClient client = null; MqttClientPost mqttClientPost = null; GmServiceRepresentation serviceRepresentation = null; - MeasureAgent agent = null; +// MeasureAgent agent = null; public BcMQTTSubcomponent(BcConfiguration bcConfiguration, GmServiceRepresentation serviceRepresentation) { super(bcConfiguration); this.serviceRepresentation = serviceRepresentation; @@ -64,7 +64,7 @@ public class BcMQTTSubcomponent extends BcGmSubcomponent { break; case CLIENT: - agent = new MeasureAgent("timestamp_5", System.currentTimeMillis(), MonitorConstant.M4,MonitorConstant.timestamp_5_port_listener); +// agent = new MeasureAgent("timestamp_5", System.currentTimeMillis(), MonitorConstant.M4,MonitorConstant.timestamp_5_port_listener); try{ client = new MqttClient("tcp://"+this.bcConfiguration.getServiceAddress()+":"+this.bcConfiguration.getServicePort(), "client"); @@ -170,7 +170,8 @@ public class BcMQTTSubcomponent extends BcGmSubcomponent { public void postOneway(final String destination, final String scope, final List<Data<?>> data, final long lease) { // TODO Auto-generated method stub - mqttClientPost.postOneWayRequest(destination, scope, data, agent); +// mqttClientPost.postOneWayRequest(destination, scope, data, agent); + mqttClientPost.postOneWayRequest(destination, scope, data); } diff --git a/protocol-pool/gm-mqtt/src/main/java/eu/chorevolution/vsb/gm/protocols/mqtt/MqttClientPost.java b/protocol-pool/gm-mqtt/src/main/java/eu/chorevolution/vsb/gm/protocols/mqtt/MqttClientPost.java index 0f9053ac..38ed8998 100644 --- a/protocol-pool/gm-mqtt/src/main/java/eu/chorevolution/vsb/gm/protocols/mqtt/MqttClientPost.java +++ b/protocol-pool/gm-mqtt/src/main/java/eu/chorevolution/vsb/gm/protocols/mqtt/MqttClientPost.java @@ -20,7 +20,7 @@ public class MqttClientPost { this.client = client; } - public void postOneWayRequest(final String destination, final String scope, final List<Data<?>> datas, MeasureAgent agent){ + public void postOneWayRequest(final String destination, final String scope, final List<Data<?>> datas){ this.scope = scope; @@ -46,7 +46,7 @@ public class MqttClientPost { try { client.publish(scope, message); - agent.fire(""+System.currentTimeMillis()+"-"+message_id); +// agent.fire(""+System.currentTimeMillis()+"-"+message_id); } catch (MqttPersistenceException e) { // TODO Auto-generated catch block diff --git a/protocol-pool/gm-rest/src/main/java/eu/chorevolution/vsb/gm/protocols/rest/BcRestSubcomponent.java b/protocol-pool/gm-rest/src/main/java/eu/chorevolution/vsb/gm/protocols/rest/BcRestSubcomponent.java index 71ff0eab..4cff34b1 100644 --- a/protocol-pool/gm-rest/src/main/java/eu/chorevolution/vsb/gm/protocols/rest/BcRestSubcomponent.java +++ b/protocol-pool/gm-rest/src/main/java/eu/chorevolution/vsb/gm/protocols/rest/BcRestSubcomponent.java @@ -51,8 +51,8 @@ public class BcRestSubcomponent extends BcGmSubcomponent { private static String printermsg = "empty"; private static GmServiceRepresentation serviceRepresentation; private static BcRestSubcomponent bcRestSubcomponent; - private MeasureAgent agentPost = null; - private static MeasureAgent agentMget = null; +// private MeasureAgent agentPost = null; +// private static MeasureAgent agentMget = null; private ExecutorService executor = null; public BcRestSubcomponent( @@ -71,7 +71,7 @@ public class BcRestSubcomponent extends BcGmSubcomponent { case SERVER: - agentMget = new MeasureAgent("timestamp_4",System.currentTimeMillis(),MonitorConstant.M4,MonitorConstant.timestamp_4_port_listener); +// agentMget = new MeasureAgent("timestamp_4",System.currentTimeMillis(),MonitorConstant.M4,MonitorConstant.timestamp_4_port_listener); this.server = new Server(Protocol.HTTP, this.bcConfiguration.getSubcomponentAddress(),this.bcConfiguration.getSubcomponentPort()); this.component = new Component(); this.component.getServers().add(server); @@ -82,7 +82,7 @@ public class BcRestSubcomponent extends BcGmSubcomponent { case CLIENT: executor = Executors.newFixedThreadPool(10); - agentPost = new MeasureAgent("timestamp_3",System.currentTimeMillis(),MonitorConstant.M2,MonitorConstant.timestamp_3_port_listener); +// agentPost = new MeasureAgent("timestamp_3",System.currentTimeMillis(),MonitorConstant.M2,MonitorConstant.timestamp_3_port_listener); client = new Client(Protocol.HTTP); this.printerServer = new Server(Protocol.HTTP, restservicePort); this.printerComponent = new Component(); @@ -173,7 +173,7 @@ public class BcRestSubcomponent extends BcGmSubcomponent { // SendMessage sendMessage = new SendMessage(message); // agentPost.fire(""+System.currentTimeMillis()+"-"+message_id); // sendMessage.start(); - agentPost.fire(""+System.currentTimeMillis()+"-"+message_id); +// agentPost.fire(""+System.currentTimeMillis()+"-"+message_id); executor.execute(new Runnable(){ @Override @@ -415,7 +415,7 @@ public class BcRestSubcomponent extends BcGmSubcomponent { String message = receivedText.split("-")[0]; try { jsonObject = (JSONObject) parser.parse(message); - agentMget.fire(""+System.currentTimeMillis()+"-"+message_id); +// agentMget.fire(""+System.currentTimeMillis()+"-"+message_id); } catch (ParseException e) { e.printStackTrace(); } diff --git a/protocol-pool/gm-websocket/pom.xml b/protocol-pool/gm-websocket/pom.xml index f99e9896..b166a4ee 100644 --- a/protocol-pool/gm-websocket/pom.xml +++ b/protocol-pool/gm-websocket/pom.xml @@ -54,11 +54,6 @@ <artifactId>service-parser</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>bc-manager</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> <dependency> <groupId>eu.chorevolution.vsb</groupId> <artifactId>monitor</artifactId> diff --git a/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/BcWebsocketSubcomponent.java b/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/BcWebsocketSubcomponent.java index 96a0a0a5..92c48b70 100644 --- a/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/BcWebsocketSubcomponent.java +++ b/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/BcWebsocketSubcomponent.java @@ -20,8 +20,8 @@ public class BcWebsocketSubcomponent extends BcGmSubcomponent{ private WebSocketServer webSocketServer = null; private WebSocketObserver webSocketObserver = null; SynchronousQueue<String> buffer = null; - private MeasureAgent agentPost = null; - private MeasureAgent agentMget = null; +// private MeasureAgent agentPost = null; +// private MeasureAgent agentMget = null; private GmServiceRepresentation serviceRepresentation = null; public BcWebsocketSubcomponent(BcConfiguration bcConfiguration,GmServiceRepresentation serviceRepresentation) { @@ -36,7 +36,7 @@ public class BcWebsocketSubcomponent extends BcGmSubcomponent{ URI uri = null; try { - agentMget = new MeasureAgent("timestamp_2",System.currentTimeMillis(),MonitorConstant.M2,MonitorConstant.timestamp_2_port_listener); +// agentMget = new MeasureAgent("timestamp_2",System.currentTimeMillis(),MonitorConstant.M2,MonitorConstant.timestamp_2_port_listener); uri = new URI("http://"+bcConfiguration.getSubcomponentAddress()+":"+bcConfiguration.getSubcomponentPort()); webSocketObserver = new WebSocketObserver(uri); @@ -49,7 +49,7 @@ public class BcWebsocketSubcomponent extends BcGmSubcomponent{ case CLIENT: - agentPost = new MeasureAgent("timestamp_3",System.currentTimeMillis(),MonitorConstant.MDefault,MonitorConstant.timestamp_2_port_listener); +// agentPost = new MeasureAgent("timestamp_3",System.currentTimeMillis(),MonitorConstant.MDefault,MonitorConstant.timestamp_2_port_listener); webSocketServer = new WebSocketServer( new InetSocketAddress(bcConfiguration.getServicePort())); break; @@ -64,13 +64,15 @@ public class BcWebsocketSubcomponent extends BcGmSubcomponent{ switch (this.bcConfiguration.getSubcomponentRole()){ case SERVER: - WebSocketObserverThread Observerthread = new WebSocketObserverThread(webSocketObserver,this, serviceRepresentation, agentMget); + WebSocketObserverThread Observerthread = new WebSocketObserverThread(webSocketObserver,this, serviceRepresentation); +// WebSocketObserverThread Observerthread = new WebSocketObserverThread(webSocketObserver,this, serviceRepresentation, agentMget); Observerthread.start(); break; case CLIENT: webSocketServer.start(); - WebSocketPushNotification notifier = new WebSocketPushNotification(webSocketServer, buffer, agentPost); + WebSocketPushNotification notifier = new WebSocketPushNotification(webSocketServer, buffer); +// WebSocketPushNotification notifier = new WebSocketPushNotification(webSocketServer, buffer, agentPost); notifier.start(); break; default: diff --git a/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/WebSocketObserverThread.java b/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/WebSocketObserverThread.java index 945dffc9..83745185 100644 --- a/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/WebSocketObserverThread.java +++ b/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/WebSocketObserverThread.java @@ -19,15 +19,15 @@ public class WebSocketObserverThread extends Thread { WebSocketObserver webSocketObserver = null; BcWebsocketSubcomponent bcWebsocketSubcomponent = null; - private MeasureAgent agent = null; +// private MeasureAgent agent = null; private GmServiceRepresentation serviceRepresentation = null; public WebSocketObserverThread(WebSocketObserver webSocketObserver, BcWebsocketSubcomponent bcWebsocketSubcomponent, - GmServiceRepresentation serviceRepresentation, MeasureAgent agent){ + GmServiceRepresentation serviceRepresentation){ this.webSocketObserver = webSocketObserver; this.bcWebsocketSubcomponent = bcWebsocketSubcomponent; - this.agent = agent; +// this.agent = agent; this.serviceRepresentation = serviceRepresentation; } @@ -44,7 +44,7 @@ public class WebSocketObserverThread extends Thread { String message_id = msg.split("-")[1]; String message = msg.split("-")[0]; - agent.fire(""+System.currentTimeMillis()+"-"+message_id); +// agent.fire(""+System.currentTimeMillis()+"-"+message_id); JSONParser parser = new JSONParser(); JSONObject jsonObject = (JSONObject) parser.parse(message); diff --git a/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/WebSocketPushNotification.java b/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/WebSocketPushNotification.java index 512a7b5e..df0bc697 100644 --- a/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/WebSocketPushNotification.java +++ b/protocol-pool/gm-websocket/src/main/java/eu/chorevolution/vsb/websocket/WebSocketPushNotification.java @@ -3,10 +3,6 @@ package eu.chorevolution.vsb.websocket; import java.util.LinkedList; import java.util.List; import java.util.concurrent.SynchronousQueue; - -import org.eclipse.californium.core.CoapClient; -import org.eclipse.californium.core.CoapResponse; -import org.eclipse.californium.core.coap.MediaTypeRegistry; import org.json.simple.JSONObject; import eu.chorevolution.vsb.agent.MeasureAgent; @@ -16,14 +12,13 @@ public class WebSocketPushNotification extends Thread { WebSocketServer webSocketServer = null; SynchronousQueue<String> buffer = null; - MeasureAgent agent = null; +// MeasureAgent agent = null; - public WebSocketPushNotification(WebSocketServer webSocketServer, SynchronousQueue<String> buffer, - MeasureAgent agent) { + public WebSocketPushNotification(WebSocketServer webSocketServer, SynchronousQueue<String> buffer) { this.webSocketServer = webSocketServer; this.buffer = buffer; - this.agent = agent; +// this.agent = agent; } @@ -34,8 +29,8 @@ public class WebSocketPushNotification extends Thread { String message = buffer.poll(); if (message != null) { - String message_id = agent.getMessageID(message); - agent.fire(""+System.currentTimeMillis()+"-"+message_id); +// String message_id = agent.getMessageID(message); +// agent.fire(""+System.currentTimeMillis()+"-"+message_id); SendMessage send = new SendMessage(message); send.start(); diff --git a/tools/monitor/src/main/java/eu/chorevolution/vsb/monitor/util/MonitorConstant.java b/tools/monitor/src/main/java/eu/chorevolution/vsb/monitor/util/MonitorConstant.java index aeabd379..dff93168 100644 --- a/tools/monitor/src/main/java/eu/chorevolution/vsb/monitor/util/MonitorConstant.java +++ b/tools/monitor/src/main/java/eu/chorevolution/vsb/monitor/util/MonitorConstant.java @@ -2,20 +2,20 @@ package eu.chorevolution.vsb.monitor.util; public class MonitorConstant { - public static final String TIME_SERVER = "128.93.64.246"; - public static final String M1 = "128.93.65.234"; - public static final String M2 = "128.93.65.233"; - public static final String M3 = "128.93.64.1"; - public static final String M4 = "128.93.64.90"; - public static final String MDefault = "127.0.0.1"; - -// public static final String TIME_SERVER = "127.0.0.1"; -// public static final String M1 = "127.0.0.1"; -// public static final String M2 = "127.0.0.1"; -// public static final String M3 = "127.0.0.1"; -// public static final String M4 = "127.0.0.1"; +// public static final String TIME_SERVER = "128.93.64.246"; +// public static final String M1 = "128.93.65.234"; +// public static final String M2 = "128.93.65.233"; +// public static final String M3 = "128.93.64.1"; +// public static final String M4 = "128.93.64.90"; // public static final String MDefault = "127.0.0.1"; + public static final String TIME_SERVER = "127.0.0.1"; + public static final String M1 = "127.0.0.1"; + public static final String M2 = "127.0.0.1"; + public static final String M3 = "127.0.0.1"; + public static final String M4 = "127.0.0.1"; + public static final String MDefault = "127.0.0.1"; + public static final int TIME_SERVER_PORT = 9999; public static final int timestamp_1_port_listener = 9000; public static final int timestamp_2_port_listener = 9001; diff --git a/tools/service-parser/src/main/java/eu/chorevolution/vsb/gmdl/tools/serviceparser/ServiceDescriptionParser.java b/tools/service-parser/src/main/java/eu/chorevolution/vsb/gmdl/tools/serviceparser/ServiceDescriptionParser.java index db95e2c3..0af9b3a4 100644 --- a/tools/service-parser/src/main/java/eu/chorevolution/vsb/gmdl/tools/serviceparser/ServiceDescriptionParser.java +++ b/tools/service-parser/src/main/java/eu/chorevolution/vsb/gmdl/tools/serviceparser/ServiceDescriptionParser.java @@ -17,8 +17,8 @@ public class ServiceDescriptionParser { } public static final GmServiceRepresentation getRepresentationFromGIDL(String gidl) { - ParseGIDL gidlParser = new ParseGIDL(); + ParseGIDL gidlParser = new ParseGIDL(); return gidlParser.parse(gidl); } diff --git a/tools/service-parser/src/main/java/eu/chorevolution/vsb/gmdl/tools/serviceparser/gidl/ParseGIDL.java b/tools/service-parser/src/main/java/eu/chorevolution/vsb/gmdl/tools/serviceparser/gidl/ParseGIDL.java index 4615a500..57b03fd1 100644 --- a/tools/service-parser/src/main/java/eu/chorevolution/vsb/gmdl/tools/serviceparser/gidl/ParseGIDL.java +++ b/tools/service-parser/src/main/java/eu/chorevolution/vsb/gmdl/tools/serviceparser/gidl/ParseGIDL.java @@ -1,22 +1,15 @@ package eu.chorevolution.vsb.gmdl.tools.serviceparser.gidl; import java.io.File; -import java.io.FileReader; import java.io.IOException; import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; import java.util.Map; -import java.util.Set; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; import eu.chorevolution.modelingnotations.gidl.ComplexType; import eu.chorevolution.modelingnotations.gidl.ContextTypes; diff --git a/vsb-manager/Copy of config_block1_interface_1 b/vsb-manager/api/Copy of config_block1_interface_1 similarity index 100% rename from vsb-manager/Copy of config_block1_interface_1 rename to vsb-manager/api/Copy of config_block1_interface_1 diff --git a/vsb-manager/install.txt b/vsb-manager/api/install.txt similarity index 100% rename from vsb-manager/install.txt rename to vsb-manager/api/install.txt diff --git a/vsb-manager/pom-vsb-manager.xml b/vsb-manager/api/pom-vsb-manager.xml similarity index 100% rename from vsb-manager/pom-vsb-manager.xml rename to vsb-manager/api/pom-vsb-manager.xml diff --git a/vsb-manager/api/pom.xml b/vsb-manager/api/pom.xml new file mode 100644 index 00000000..4278927f --- /dev/null +++ b/vsb-manager/api/pom.xml @@ -0,0 +1,136 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>vsb-manager</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>api</artifactId> + <name>api</name> + <packaging>jar</packaging> + <description>vsb-manager-api expose a API to generate a Binding-Component WAR and JAR based on the description (GMDL) of the system (client, server, publisher, consumer etc.) to bind</description> + + <repositories> + <!-- REST library: Restlet --> + <repository> + <id>maven-restlet</id> + <name>Public online Restlet repository</name> + <url>http://maven.restlet.org</url> + </repository> + </repositories> + <dependencies> + <!-- RestLet --> + + <dependency> + <groupId>org.restlet.jse</groupId> + <artifactId>org.restlet</artifactId> + <version>2.3.1</version> + </dependency> + + <!-- Chorevolution --> + + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>gmdl-utils</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>artifact-generators</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>gm-rest</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>gm-soap</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>gm-coap</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>gm-mqtt</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>gm-dpws</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>gm-websocket</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>service-parser</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>bc-manager</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.json</groupId> + <artifactId>json</artifactId> + <version>20090211</version> + </dependency> + <dependency> + <groupId>com.googlecode.json-simple</groupId> + <artifactId>json-simple</artifactId> + <version>1.1.1</version> + </dependency> + </dependencies> + <build> + <resources> + <resource> + <directory>../bc-generators</directory> + <excludes> + <exclude>*/pom.xml</exclude> + </excludes> + </resource> + <resource> + <directory>../protocol-pool/</directory> + <includes> + <include>**/pom-gm-soap.xml</include> + <include>**/pom.xml</include> + <include>**/pom.xml</include> + </includes> + </resource> + <resource> + <directory>src/test/resources</directory> + <includes> + <include>pom-vsb-manager.xml</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>assembly</goal> + </goals> + </execution> + </executions> + <configuration> + <descriptorRefs> + <descriptorRef>jar-with-dependencies</descriptorRef> + </descriptorRefs> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager.java b/vsb-manager/api/src/main/java/eu/chorevolution/vsb/manager/api/VsbManager.java similarity index 64% rename from vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager.java rename to vsb-manager/api/src/main/java/eu/chorevolution/vsb/manager/api/VsbManager.java index 645e0fff..ad711e68 100644 --- a/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager.java +++ b/vsb-manager/api/src/main/java/eu/chorevolution/vsb/manager/api/VsbManager.java @@ -1,4 +1,4 @@ -package eu.chorevolution.vsb.manager; +package eu.chorevolution.vsb.manager.api; //import eu.chorevolution.vsb.bc.generators.JarGenerator; import java.io.File; @@ -9,24 +9,15 @@ import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.net.URL; -import java.util.Arrays; -import java.util.Collections; import java.util.EmptyStackException; +import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import java.util.Locale; import java.util.Random; import java.util.Scanner; - -import javax.swing.SwingUtilities; -import javax.tools.JavaCompiler; -import javax.tools.JavaCompiler.CompilationTask; import javax.tools.JavaFileObject; import javax.tools.StandardJavaFileManager; -import javax.tools.StandardLocation; -import javax.tools.ToolProvider; - import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; @@ -71,8 +62,7 @@ public class VsbManager { private boolean STARTING_FROM_JAR = false; private ProtocolType serviceProtocol = null; private ProtocolType busProtocol = null; - - + public VsbManager() { // Test if class is running from jar file or from classes files. @@ -82,7 +72,7 @@ public class VsbManager { } } - /******************************** + /********************************************** * Public method to call ***********************************************/ @@ -101,7 +91,7 @@ public class VsbManager { */ public VsbOutput generateWar(String interfaceDescriptionPath, ProtocolType busProtocol, String service_name) { - + this.busProtocol = busProtocol; service_name = deleteSpecialChar(service_name); Constants.service_name = service_name; @@ -124,7 +114,7 @@ public class VsbManager { */ public VsbOutput generateWar(byte[] interfaceDescriptionByteArray, ProtocolType busProtocol, String service_name) { - + this.busProtocol = busProtocol; service_name = deleteSpecialChar(service_name); Constants.service_name = service_name; @@ -146,7 +136,7 @@ public class VsbManager { * @return boolean */ - public boolean deleteGeneratedFiles(){ + public boolean deleteGeneratedFiles() { boolean deleteGerated = false; File directory = new File(Constants.generatedCodePath); @@ -192,18 +182,14 @@ public class VsbManager { String bc_generators_copy = Constants.generatedCodePath + File.separator + "bc-generators"; // Test if class is running from jar or from class file. - if (STARTING_FROM_JAR){ + if (STARTING_FROM_JAR) { - // URL webapp_src_bc = getClass().getClassLoader().getResource( - // "webapp-bc-generator" ); URL webapp_src_artifact = getClass().getClassLoader().getResource("artifact-generators"); - // PathResolver.extractDirectoryFromJar(webapp_src_bc, - // bc_generators_copy); PathResolver.extractDirectoryFromJar(webapp_src_artifact, bc_generators_copy); } else { - PathResolver.copyFolder(new File(".." + File.separator + "bc-generators").getAbsolutePath(), + PathResolver.copyFolder(new File(".." + File.separator + ".." + File.separator + "bc-generators").getAbsolutePath(), bc_generators_copy); } @@ -235,75 +221,84 @@ public class VsbManager { setConstants(interfaceDescriptionPath); generateBindingComponent(interfaceDescriptionPath, busProtocol); - + WarGenerator warGenerator = new WarGenerator(); - JarGenerator jarGenerator = new JarGenerator(); - - warGenerator.addPackage(eu.chorevolution.vsb.manager.VsbManager.class.getPackage()); + + warGenerator.addPackage(eu.chorevolution.vsb.manager.api.VsbManager.class.getPackage()); warGenerator.addPackage(eu.chorevolution.vsb.java2wsdl.Java2WSDL.class.getPackage()); warGenerator .addPackage(eu.chorevolution.vsb.gmdl.tools.serviceparser.ServiceDescriptionParser.class.getPackage()); - + warGenerator.addPackage(eu.chorevolution.vsb.gmdl.tools.serviceparser.gidl.ParseGIDL.class.getPackage()); warGenerator.addPackage(eu.chorevolution.vsb.gmdl.tools.serviceparser.gmdl.ParseGMDL.class.getPackage()); warGenerator.addPackage(eu.chorevolution.vsb.gmdl.utils.Operation.class.getPackage()); warGenerator.addPackage(eu.chorevolution.vsb.gmdl.utils.enums.OperationType.class.getPackage()); - + warGenerator.addPackage(eu.chorevolution.vsb.gm.protocols.coap.BcCoapGenerator.class.getPackage()); warGenerator.addPackage(eu.chorevolution.vsb.gm.protocols.soap.BcSoapGenerator.class.getPackage()); warGenerator.addPackage(eu.chorevolution.vsb.gm.protocols.rest.BcRestGenerator.class.getPackage()); warGenerator.addPackage(eu.chorevolution.vsb.bc.manager.BcManagerRestService.class.getPackage()); - + warGenerator.addPackage(eu.chorevolution.vsb.artifact.war.RestServlet.class.getPackage()); warGenerator.addPackage(eu.chorevolution.vsb.artifact.generators.WarGenerator.class.getPackage()); warGenerator.addPackage(eu.chorevolution.vsb.bc.setinvaddrservice.BaseService.class.getPackage()); warGenerator.addPackage(eu.chorevolution.vsb.gm.protocols.Manageable.class.getPackage()); - + String vsb_manager_pomxml = new File(".").getAbsolutePath() + File.separator + "pom.xml"; - String gm_soap_pomxml = new File(".").getAbsolutePath() + File.separator + ".." + File.separator + String gm_soap_pomxml = new File(".").getAbsolutePath() + File.separator + ".." + File.separator+".." + File.separator + "protocol-pool" + File.separator + "gm-soap" + File.separator + "pom-gm-soap.xml"; - String gm_coap_pomxml = new File(".").getAbsolutePath() + File.separator + ".." + File.separator + String gm_coap_pomxml = new File(".").getAbsolutePath() + File.separator + ".." + File.separator+".." + File.separator + "protocol-pool" + File.separator + "gm-coap" + File.separator + "pom.xml"; - String gm_dpws_pomxml = new File(".").getAbsolutePath() + - File.separator + ".." + File.separator + "protocol-pool" + - File.separator + "gm-dpws" + File.separator + "pom.xml"; - String gm_websocket_pomxl = new File(".").getAbsolutePath() + - File.separator + ".." + File.separator + "protocol-pool" + - File.separator + "gm-websocket" + File.separator + "pom.xml"; - if (STARTING_FROM_JAR){ + String gm_dpws_pomxml = new File(".").getAbsolutePath() + File.separator + ".." + File.separator+".." + File.separator + + "protocol-pool" + File.separator + "gm-dpws" + File.separator + "pom.xml"; + String gm_websocket_pomxl = new File(".").getAbsolutePath() + File.separator + ".." + File.separator+".." + File.separator + + "protocol-pool" + File.separator + "gm-websocket" + File.separator + "pom.xml"; + String gm_mqtt_pomxl = new File(".").getAbsolutePath() + File.separator + ".." + File.separator+".." + File.separator + + "protocol-pool" + File.separator + "gm-mqtt" + File.separator + "pom.xml"; + String gm_rest_pomxl = new File(".").getAbsolutePath() + File.separator + ".." + File.separator+".." + File.separator + + "protocol-pool" + File.separator + "gm-rest" + File.separator + "pom.xml"; + + if (STARTING_FROM_JAR) { vsb_manager_pomxml = PathResolver.myFilePath(BcManagerRestService.class, "pom-vsb-manager.xml"); gm_soap_pomxml = PathResolver.myFilePath(BcManagerRestService.class, "gm-soap/pom-gm-soap.xml"); gm_coap_pomxml = PathResolver.myFilePath(BcManagerRestService.class, "gm-coap/pom.xml"); - gm_dpws_pomxml = PathResolver.myFilePath(BcManagerRestService.class,"gm-dpws/pom.xml"); - gm_websocket_pomxl = PathResolver.myFilePath(BcManagerRestService.class,"gm-websocket/pom.xml"); + gm_dpws_pomxml = PathResolver.myFilePath(BcManagerRestService.class, "gm-dpws/pom.xml"); + gm_websocket_pomxl = PathResolver.myFilePath(BcManagerRestService.class, "gm-websocket/pom.xml"); + gm_rest_pomxl = PathResolver.myFilePath(BcManagerRestService.class, "gm-rest/pom.xml"); + gm_mqtt_pomxl = PathResolver.myFilePath(BcManagerRestService.class, "gm-mqtt/pom.xml"); } + HashMap<String, String> hmapPomXml = new HashMap<String, String>(); + + hmapPomXml.put("coap", gm_coap_pomxml); + hmapPomXml.put("dpws", gm_dpws_pomxml); + hmapPomXml.put("mqtt", gm_mqtt_pomxl); + hmapPomXml.put("websocket", gm_websocket_pomxl); + hmapPomXml.put("soap", gm_soap_pomxml); + hmapPomXml.put("rest", gm_rest_pomxl); warGenerator.addDependencyFiles(vsb_manager_pomxml); warGenerator.addDependencyFiles(gm_coap_pomxml); - // warGenerator.addDependencyFiles(gm_dpws_pomxml); - - if(busProtocol != ProtocolType.SOAP){ - + warGenerator.addDependencyFiles(gm_dpws_pomxml); + + if (busProtocol != ProtocolType.SOAP) { + warGenerator.addDependencyFiles(gm_soap_pomxml); } - - + Class[] classesOptions = new Class[] { - - BcManagerRestService.class, BcGmSubcomponent.class, - BcGmSubcomponent.class, BcRestSubcomponent.class, - BcSoapSubcomponent.class, ServiceDescriptionParser.class, - BcConfiguration.class, BcCoapSubcomponent.class, - BcDPWSSubcomponent.class, BcMQTTSubcomponent.class, - BcWebsocketSubcomponent.class, BcSoapSubcomponent.class - }; - + + BcManagerRestService.class, BcGmSubcomponent.class, BcGmSubcomponent.class, BcRestSubcomponent.class, + BcSoapSubcomponent.class, ServiceDescriptionParser.class, BcConfiguration.class, + BcCoapSubcomponent.class, BcDPWSSubcomponent.class, BcMQTTSubcomponent.class, + BcWebsocketSubcomponent.class, BcSoapSubcomponent.class }; + Generator generator = new Generator(); generator.compileGeratedClasses(classesOptions); - + VsbOutput vsbOutput = generator.generateWar(warGenerator, busProtocol); + JarGenerator jarGenerator = new JarGenerator(hmapPomXml); jarGenerator.setBusProtocol(busProtocol); jarGenerator.setServiceProtocol(serviceProtocol); vsbOutput.jar = generator.generateJar(jarGenerator); @@ -333,7 +328,7 @@ public class VsbManager { gmServiceRepresentation = ServiceDescriptionParser.getRepresentationFromGIDL(interfaceDescription); break; } - + serviceProtocol = gmServiceRepresentation.getProtocol(); if (busProtocol == ProtocolType.SOAP) { @@ -345,15 +340,14 @@ public class VsbManager { // temporarily disabled System.out.println("inria-mimove"); soapGenerator.generatePOJOAndEndpoint(); - + soapGenerator.generateWSDL(); - + } - + generateBindingComponentClass(gmServiceRepresentation, busProtocol); generateBindingComponentMainClass(); - - + } private void copyInterfaceDescription(String interfaceDescription) { @@ -370,7 +364,7 @@ public class VsbManager { } sc.close(); printer.close(); - } catch (FileNotFoundException e){ + } catch (FileNotFoundException e) { System.err.println("Interface file not found."); } @@ -464,16 +458,33 @@ public class VsbManager { JClass FileClass = jCodeModel.ref(java.io.File.class); JClass BcManagerRestServiceClass = jCodeModel.ref(eu.chorevolution.vsb.bc.manager.BcManagerRestService.class); + JClass pathResolverClass = null; + pathResolverClass = jCodeModel.ref(eu.chorevolution.vsb.gmdl.utils.PathResolver.class); + + JVar pathResolverClassVar = jBlock.decl(pathResolverClass, "pathResolver").init(JExpr._new(pathResolverClass)); + + JInvocation myFilePath = pathResolverClassVar.invoke("myFilePath").arg(jc.dotclass()) + .arg((JExpr._new(StringClass).arg("config")).plus(FileClass.staticRef("separator")) + .plus(JExpr._new(StringClass).arg("serviceDescription.gxdl"))); + JVar interfaceDescriptionPathVar = null; interfaceDescriptionPathVar = jBlock.decl(StringClass, "interfaceDescFilePath"); - jBlock.assign(JExpr.ref(interfaceDescriptionPathVar.name()), - JExpr._new(FileClass) - .arg(BcManagerRestServiceClass.dotclass().invoke("getClassLoader").invoke("getResource") - .arg("example.json").invoke("toExternalForm").invoke("substring").arg(intNineVar)) - .invoke("getParentFile").invoke("getParentFile").invoke("getParentFile").invoke("getParentFile") - .invoke("getAbsolutePath").plus(FileClass.staticRef("separator")) - .plus(JExpr._new(StringClass).arg("config")).plus(FileClass.staticRef("separator")) - .plus(JExpr._new(StringClass).arg("serviceDescription.gxdl"))); + jBlock.assign(JExpr.ref(interfaceDescriptionPathVar.name()), myFilePath); + + JClass SystemClass = jCodeModel.ref(System.class); + JInvocation printstmt = SystemClass.staticRef("out").invoke("println").arg(interfaceDescriptionPathVar); + jBlock.add(printstmt); + + // JVar interfaceDescriptionPathVar = jBlock.decl(StringClass, + // "interfaceDescFilePath"); + // jBlock.assign(JExpr.ref(interfaceDescriptionPathVar.name()), + // JExpr._new(FileClass) + // .arg(BcManagerRestServiceClass.dotclass().invoke("getClassLoader").invoke("getResource") + // .arg("example.json").invoke("toExternalForm").invoke("substring").arg(intNineVar)) + // .invoke("getParentFile").invoke("getParentFile").invoke("getParentFile").invoke("getParentFile") + // .invoke("getAbsolutePath").plus(FileClass.staticRef("separator")) + // .plus(JExpr._new(StringClass).arg("config")).plus(FileClass.staticRef("separator")) + // .plus(JExpr._new(StringClass).arg("serviceDescription.gxdl"))); JClass serviceDescriptionClass = jCodeModel.ref(ServiceDescriptionParser.class); @@ -518,18 +529,25 @@ public class VsbManager { JClass RoleTypeClass = jCodeModel.ref(eu.chorevolution.vsb.gmdl.utils.enums.RoleType.class); - JClass BcRestSubcomponentClass = jCodeModel.ref(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class); - JClass BcSoapSubcomponentClass = jCodeModel.ref(eu.chorevolution.vsb.gm.protocols.soap.BcSoapSubcomponent.class); - JClass BcMQTTSubcomponentClass = jCodeModel.ref(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class); - JClass BcCoapSubcomponentClass = jCodeModel.ref(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class); - JClass BcDpwsSubcomponentClass = jCodeModel.ref(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class); - + JClass BcRestSubcomponentClass = jCodeModel + .ref(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class); + JClass BcSoapSubcomponentClass = jCodeModel + .ref(eu.chorevolution.vsb.gm.protocols.soap.BcSoapSubcomponent.class); + JClass BcMQTTSubcomponentClass = jCodeModel + .ref(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class); + JClass BcCoapSubcomponentClass = jCodeModel + .ref(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class); + JClass BcDpwsSubcomponentClass = jCodeModel + .ref(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class); + JClass BcWebSocketSubcomponentClass = jCodeModel + .ref(eu.chorevolution.vsb.websocket.BcWebsocketSubcomponent.class); + JClass BcConfigurationClass = jCodeModel.ref(eu.chorevolution.vsb.gmdl.utils.BcConfiguration.class); - JClass SystemClass = jCodeModel.ref(System.class); + // JClass SystemClass = jCodeModel.ref(System.class); JClass EnumClass = jCodeModel.ref("eu.chorevolution.vsb.gmdl.utils.enums.RoleType"); - JInvocation printstmt = SystemClass.staticRef("out").invoke("println").arg("genfac start iteration"); + printstmt = SystemClass.staticRef("out").invoke("println").arg("genfac start iteration"); forBlock.add(printstmt); JFieldRef RoleTypeServerEnum = null; @@ -559,64 +577,91 @@ public class VsbManager { String generatedCodePath = Constants.generatedCodePath; generatedCodePath = generatedCodePath + File.separator; - JInvocation parseInvocation1 = bcConfig1Var.invoke("parseFromJSON").arg(GmServiceRepresentationVar).arg(JExpr - ._new(FileClass) - .arg(BcManagerRestServiceClass.dotclass().invoke("getClassLoader").invoke("getResource") - .arg("example.json").invoke("toExternalForm").invoke("substring").arg(intNineVar)) - .invoke("getParentFile").invoke("getParentFile").invoke("getParentFile").invoke("getParentFile") - .invoke("getAbsolutePath").plus(FileClass.staticRef("separator")) - .plus(JExpr._new(StringClass).arg("config")).plus(FileClass.staticRef("separator")) - .plus(JExpr._new(StringClass).arg("config_block1_interface_")) - .plus(jCodeModel.ref(java.lang.String.class).staticInvoke("valueOf").arg(ivar.plus(intOneVar)))); + JInvocation myFilePath1 = pathResolverClassVar.invoke("myFilePath").arg(jc.dotclass()) + .arg((JExpr._new(StringClass).arg("config")).plus(FileClass.staticRef("separator")) + .plus(JExpr._new(StringClass).arg("config_block1_interface_")).plus(jCodeModel + .ref(java.lang.String.class).staticInvoke("valueOf").arg(ivar.plus(intOneVar)))); + + JVar config_block1_interfacePathVar = forBlock.decl(StringClass, "config_block1_interfacePath"); + forBlock.assign(JExpr.ref(config_block1_interfacePathVar.name()), myFilePath1); + + JInvocation parseInvocation1 = bcConfig1Var.invoke("parseFromJSON").arg(GmServiceRepresentationVar) + .arg(JExpr._new(StringClass).arg(config_block1_interfacePathVar)); + + // JInvocation parseInvocation1 = + // bcConfig1Var.invoke("parseFromJSON").arg(GmServiceRepresentationVar).arg(JExpr + // ._new(FileClass) + // .arg(BcManagerRestServiceClass.dotclass().invoke("getClassLoader").invoke("getResource") + // .arg("example.json").invoke("toExternalForm").invoke("substring").arg(intNineVar)) + // .invoke("getParentFile").invoke("getParentFile").invoke("getParentFile").invoke("getParentFile") + // .invoke("getAbsolutePath").plus(FileClass.staticRef("separator")) + // .plus(JExpr._new(StringClass).arg("config")).plus(FileClass.staticRef("separator")) + // .plus(JExpr._new(StringClass).arg("config_block1_interface_")) + // .plus(jCodeModel.ref(java.lang.String.class).staticInvoke("valueOf").arg(ivar.plus(intOneVar)))); + forBlock.add(parseInvocation1); - JInvocation parseInvocation2 = bcConfig2Var.invoke("parseFromJSON").arg(GmServiceRepresentationVar).arg(JExpr - ._new(FileClass) - .arg(BcManagerRestServiceClass.dotclass().invoke("getClassLoader").invoke("getResource") - .arg("example.json").invoke("toExternalForm").invoke("substring").arg(intNineVar)) - .invoke("getParentFile").invoke("getParentFile").invoke("getParentFile").invoke("getParentFile") - .invoke("getAbsolutePath").plus(FileClass.staticRef("separator")) - .plus(JExpr._new(StringClass).arg("config")).plus(FileClass.staticRef("separator")) - .plus(JExpr._new(StringClass).arg("config_block2_interface_")) - .plus(jCodeModel.ref(java.lang.String.class).staticInvoke("valueOf").arg(ivar.plus(intOneVar)))); - forBlock.add(parseInvocation2); + JInvocation myFilePath2 = pathResolverClassVar.invoke("myFilePath").arg(jc.dotclass()) + .arg((JExpr._new(StringClass).arg("config")).plus(FileClass.staticRef("separator")) + .plus(JExpr._new(StringClass).arg("config_block2_interface_")).plus(jCodeModel + .ref(java.lang.String.class).staticInvoke("valueOf").arg(ivar.plus(intOneVar)))); + + JVar config_block2_interfacePathVar = forBlock.decl(StringClass, "config_block2_interfacePath"); + forBlock.assign(JExpr.ref(config_block2_interfacePathVar.name()), myFilePath2); + + JInvocation parseInvocation2 = bcConfig2Var.invoke("parseFromJSON").arg(GmServiceRepresentationVar) + .arg(JExpr._new(StringClass).arg(config_block2_interfacePathVar)); + + // JInvocation parseInvocation2 = + // bcConfig2Var.invoke("parseFromJSON").arg(GmServiceRepresentationVar).arg(JExpr + // ._new(FileClass) + // .arg(BcManagerRestServiceClass.dotclass().invoke("getClassLoader").invoke("getResource") + // .arg("example.json").invoke("toExternalForm").invoke("substring").arg(intNineVar)) + // .invoke("getParentFile").invoke("getParentFile").invoke("getParentFile").invoke("getParentFile") + // .invoke("getAbsolutePath").plus(FileClass.staticRef("separator")) + // .plus(JExpr._new(StringClass).arg("config")).plus(FileClass.staticRef("separator")) + // .plus(JExpr._new(StringClass).arg("config_block2_interface_")) + // .plus(jCodeModel.ref(java.lang.String.class).staticInvoke("valueOf").arg(ivar.plus(intOneVar)))); + forBlock.add(parseInvocation2); switch (busProtocol) { case REST: for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) - createConfigFile(ProtocolType.REST, Constants.webapp_src_artifact + File.separator + "config" - + File.separator + "config_block1_interface_" + String.valueOf(i)); + createConfigFileBusProtocole(ProtocolType.REST, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block1_interface_" + String.valueOf(i)); forBlock.assign(JExpr.ref("subcomponent[i][0]"), JExpr._new(BcRestSubcomponentClass).arg(bcConfig1Var).arg(GmServiceRepresentationVar)); // BcGmSubcomponentVar1.init(JExpr._new(BcRestSubcomponentClass).arg(bcConfig1Var)); break; case SOAP: for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) - createConfigFile(ProtocolType.SOAP, Constants.webapp_src_artifact + File.separator + "config" - + File.separator + "config_block1_interface_" + String.valueOf(i)); + createConfigFileBusProtocole(ProtocolType.SOAP, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block1_interface_" + String.valueOf(i)); forBlock.assign(JExpr.ref("subcomponent[i][0]"), JExpr._new(BcSoapSubcomponentClass).arg(bcConfig1Var).arg(GmServiceRepresentationVar)); break; case MQTT: for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) - createConfigFile(ProtocolType.MQTT, Constants.webapp_src_artifact + File.separator + "config" - + File.separator + "config_block1_interface_" + String.valueOf(i)); + createConfigFileBusProtocole(ProtocolType.MQTT, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block1_interface_" + String.valueOf(i)); forBlock.assign(JExpr.ref("subcomponent[i][0]"), JExpr._new(BcMQTTSubcomponentClass).arg(bcConfig1Var).arg(GmServiceRepresentationVar)); break; case COAP: for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) - createConfigFile(ProtocolType.COAP, Constants.webapp_src_artifact + File.separator + "config" - + File.separator + "config_block1_interface_" + String.valueOf(i)); + createConfigFileBusProtocole(ProtocolType.COAP, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block1_interface_" + String.valueOf(i)); forBlock.assign(JExpr.ref("subcomponent[i][0]"), JExpr._new(BcCoapSubcomponentClass).arg(bcConfig1Var).arg(GmServiceRepresentationVar)); break; - + case DPWS: - for(int i=1; i<=gmServiceRepresentation.getInterfaces().size(); i++) - createConfigFile(ProtocolType.DPWS, Constants.webapp_src_artifact + File.separator + "config" + File.separator + "config_block1_interface_" + String.valueOf(i)); - forBlock.assign(JExpr.ref("subcomponent[i][0]"), JExpr._new(BcDpwsSubcomponentClass).arg(bcConfig1Var).arg(GmServiceRepresentationVar)); + for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) + createConfigFileBusProtocole(ProtocolType.DPWS, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block1_interface_" + String.valueOf(i)); + forBlock.assign(JExpr.ref("subcomponent[i][0]"), + JExpr._new(BcDpwsSubcomponentClass).arg(bcConfig1Var).arg(GmServiceRepresentationVar)); break; - + case JMS: break; case PUB_NUB: @@ -624,50 +669,59 @@ public class VsbManager { case SEMI_SPACE: break; case WEB_SOCKETS: + + for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) + createConfigFileBusProtocole(ProtocolType.WEB_SOCKETS, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block1_interface_" + String.valueOf(i)); + forBlock.assign(JExpr.ref("subcomponent[i][0]"), + JExpr._new(BcWebSocketSubcomponentClass).arg(bcConfig1Var).arg(GmServiceRepresentationVar)); break; + case ZERO_MQ: break; default: break; } - switch(gmServiceRepresentation.getProtocol()){ + + switch (gmServiceRepresentation.getProtocol()) { case REST: for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) - createConfigFile(ProtocolType.REST, Constants.webapp_src_artifact + File.separator + "config" - + File.separator + "config_block2_interface_" + String.valueOf(i)); + createConfigFileGmServiceProtocole(ProtocolType.REST, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block2_interface_" + String.valueOf(i)); forBlock.assign(JExpr.ref("subcomponent[i][1]"), JExpr._new(BcRestSubcomponentClass).arg(bcConfig2Var).arg(GmServiceRepresentationVar)); break; case SOAP: for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) - createConfigFile(ProtocolType.SOAP, Constants.webapp_src_artifact + File.separator + "config" - + File.separator + "config_block2_interface_" + String.valueOf(i)); + createConfigFileGmServiceProtocole(ProtocolType.SOAP, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block2_interface_" + String.valueOf(i)); forBlock.assign(JExpr.ref("subcomponent[i][1]"), JExpr._new(BcSoapSubcomponentClass).arg(bcConfig2Var).arg(GmServiceRepresentationVar)); break; case MQTT: for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) - createConfigFile(ProtocolType.MQTT, Constants.webapp_src_artifact + File.separator + "config" - + File.separator + "config_block2_interface_" + String.valueOf(i)); + createConfigFileGmServiceProtocole(ProtocolType.MQTT, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block2_interface_" + String.valueOf(i)); forBlock.assign(JExpr.ref("subcomponent[i][1]"), JExpr._new(BcMQTTSubcomponentClass).arg(bcConfig2Var).arg(GmServiceRepresentationVar)); break; case COAP: for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) - createConfigFile(ProtocolType.COAP, Constants.webapp_src_artifact + File.separator + "config" - + File.separator + "config_block2_interface_" + String.valueOf(i)); + createConfigFileGmServiceProtocole(ProtocolType.COAP, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block2_interface_" + String.valueOf(i)); forBlock.assign(JExpr.ref("subcomponent[i][1]"), JExpr._new(BcCoapSubcomponentClass).arg(bcConfig2Var).arg(GmServiceRepresentationVar)); break; - + case DPWS: - for(int i=1; i<=gmServiceRepresentation.getInterfaces().size(); i++) - createConfigFile(ProtocolType.DPWS, Constants.webapp_src_artifact + File.separator + "config" + File.separator + "config_block2_interface_" + String.valueOf(i)); - forBlock.assign(JExpr.ref("subcomponent[i][1]"), JExpr._new(BcDpwsSubcomponentClass).arg(bcConfig2Var).arg(GmServiceRepresentationVar)); + for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) + createConfigFileGmServiceProtocole(ProtocolType.DPWS, Constants.webapp_src_artifact + File.separator + + "config" + File.separator + "config_block2_interface_" + String.valueOf(i)); + forBlock.assign(JExpr.ref("subcomponent[i][1]"), + JExpr._new(BcDpwsSubcomponentClass).arg(bcConfig2Var).arg(GmServiceRepresentationVar)); break; - case JMS: break; @@ -676,6 +730,13 @@ public class VsbManager { case SEMI_SPACE: break; case WEB_SOCKETS: + + for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) + createConfigFileGmServiceProtocole(ProtocolType.WEB_SOCKETS, Constants.webapp_src_artifact + + File.separator + "config" + File.separator + "config_block2_interface_" + String.valueOf(i)); + forBlock.assign(JExpr.ref("subcomponent[i][1]"), + JExpr._new(BcWebSocketSubcomponentClass).arg(bcConfig2Var).arg(GmServiceRepresentationVar)); + break; case ZERO_MQ: break; @@ -720,11 +781,11 @@ public class VsbManager { } catch (IOException e) { e.printStackTrace(); } - + } - - private static void generateBindingComponentMainClass(){ - + + private static void generateBindingComponentMainClass() { + String configTemplatePath = ""; JSONParser parser = new JSONParser(); JSONObject jsonObject = null; @@ -736,7 +797,7 @@ public class VsbManager { } catch (IOException | ParseException e) { e.printStackTrace(); } - + /* Creating java code model classes */ JCodeModel jCodeModel = new JCodeModel(); /* Adding package here */ @@ -752,60 +813,139 @@ public class VsbManager { e.printStackTrace(); } - + JClass StringClass = jCodeModel.ref(String.class); - JClass bindingComponent = jCodeModel.ref(Constants.target_namespace+".BindingComponent"); - - JMethod jmMain = jc.method(JMod.PUBLIC | JMod.STATIC,void.class , "main"); + JClass bindingComponent = jCodeModel.ref(Constants.target_namespace + ".BindingComponent"); + + JMethod jmMain = jc.method(JMod.PUBLIC | JMod.STATIC, void.class, "main"); jmMain.param(StringClass.array(), "args"); - JBlock jmMainBlock = jmMain.body(); + JBlock jmMainBlock = jmMain.body(); JVar bindingComponentVar = jmMainBlock.decl(bindingComponent, "bindingComponent") - .init(JExpr._new(bindingComponent)); - + .init(JExpr._new(bindingComponent)); + JInvocation run = bindingComponentVar.invoke("run"); jmMainBlock.add(run); - + try { - jCodeModel.build(new File(Constants.generatedCodePath+File.separator)); + jCodeModel.build(new File(Constants.generatedCodePath + File.separator)); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } - + } - - - private static void createConfigFile(ProtocolType protocol, String filename) { + + private static void createConfigFileBusProtocole(ProtocolType protocol, String filename) { String configPath = PathResolver.myFilePath(BcManagerRestService.class, "config.json"); JSONParser configParser = new JSONParser(); JSONObject configJsonObject = null; - String configTemplatePath = ""; + String configTemplatePath = PathResolver.myFilePath(BcManagerRestService.class, "template-config.json"); + ; JSONParser parser = new JSONParser(); JSONObject jsonObject = null; + try { + configJsonObject = (JSONObject) configParser.parse(new FileReader(configPath)); + } catch (IOException | ParseException e) { + e.printStackTrace(); + } + + try { + + jsonObject = (JSONObject) parser.parse(new FileReader(configTemplatePath)); + + } catch (IOException | ParseException e) { + + e.printStackTrace(); + } + switch (protocol) { case REST: - configTemplatePath = PathResolver.myFilePath(BcManagerRestService.class, "rest-config.json"); + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", "1111"); + jsonObject.put("service_port", "1111"); + jsonObject.put("subcomponent_address", "127.0.0.1"); + jsonObject.put("invocation_address", "127.0.0.1"); + break; case SOAP: - configTemplatePath = PathResolver.myFilePath(BcManagerRestService.class, "soap-config.json"); + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", Constants.service_port); + jsonObject.put("bc_rest_service_port", Constants.service_bc_port); + jsonObject.put("bc_manager_servlet_port", Constants.bc_manager_servlet_port); + jsonObject.put("subcomponent_address", "http://localhost"); + jsonObject.put("invocation_address", "http://localhost"); + break; case MQTT: - configTemplatePath = PathResolver.myFilePath(BcManagerRestService.class, "mqtt-config.json"); + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", "8891"); + jsonObject.put("service_port", "8891"); + jsonObject.put("subcomponent_address", "127.0.0.1"); + jsonObject.put("invocation_address", "127.0.0.1"); + break; case COAP: - configTemplatePath = PathResolver.myFilePath(BcManagerRestService.class, "coap-config.json"); + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", "2991"); + jsonObject.put("service_port", "2991"); + jsonObject.put("subcomponent_address", "127.0.0.1"); + jsonObject.put("invocation_address", "127.0.0.1"); + break; - + case DPWS: - configTemplatePath = PathResolver.myFilePath(BcManagerRestService.class,"dpws-config.json"); + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", "5678"); + jsonObject.put("service_port", "5678"); + jsonObject.put("subcomponent_address", "127.0.0.1"); + jsonObject.put("invocation_address", "127.0.0.1"); + break; - + case WEB_SOCKETS: + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", "9082"); + jsonObject.put("service_port", "9082"); + jsonObject.put("subcomponent_address", "127.0.0.1"); + jsonObject.put("invocation_address", "127.0.0.1"); + + break; } + // temporarily disabled + try (FileWriter file = new FileWriter(filename)) { + file.write(jsonObject.toJSONString()); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static void createConfigFileGmServiceProtocole(ProtocolType protocol, String filename) { + + String configPath = PathResolver.myFilePath(BcManagerRestService.class, "config.json"); + JSONParser configParser = new JSONParser(); + JSONObject configJsonObject = null; + + String configTemplatePath = PathResolver.myFilePath(BcManagerRestService.class, "template-config.json"); + ; + JSONParser parser = new JSONParser(); + JSONObject jsonObject = null; + try { configJsonObject = (JSONObject) configParser.parse(new FileReader(configPath)); } catch (IOException | ParseException e) { @@ -821,8 +961,18 @@ public class VsbManager { e.printStackTrace(); } - if (protocol == ProtocolType.SOAP) { + switch (protocol) { + case REST: + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", "1112"); + jsonObject.put("service_port", "1112"); + jsonObject.put("subcomponent_address", "127.0.0.1:1111"); + jsonObject.put("invocation_address", "http://127.0.0.1:1111/"); + break; + case SOAP: jsonObject.put("target_namespace", Constants.target_namespace); jsonObject.put("service_name", Constants.soap_service_name); @@ -831,6 +981,51 @@ public class VsbManager { jsonObject.put("bc_manager_servlet_port", Constants.bc_manager_servlet_port); jsonObject.put("subcomponent_address", "http://localhost"); jsonObject.put("invocation_address", "http://localhost"); + + break; + case MQTT: + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", "8891"); + jsonObject.put("service_port", "8891"); + jsonObject.put("subcomponent_address", "127.0.0.1"); + jsonObject.put("invocation_address", "127.0.0.1"); + + break; + case COAP: + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", "2991"); + jsonObject.put("service_port", "2991"); + jsonObject.put("subcomponent_address", "127.0.0.1"); + jsonObject.put("invocation_address", "127.0.0.1"); + + break; + + case DPWS: + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", "5678"); + jsonObject.put("service_port", "5678"); + jsonObject.put("subcomponent_address", "127.0.0.1"); + jsonObject.put("invocation_address", "127.0.0.1"); + + break; + + case WEB_SOCKETS: + + jsonObject.put("target_namespace", Constants.target_namespace); + jsonObject.put("service_name", Constants.soap_service_name); + jsonObject.put("subcomponent_port", "9082"); + jsonObject.put("service_port", "9082"); + jsonObject.put("subcomponent_address", "127.0.0.1"); + jsonObject.put("invocation_address", "127.0.0.1"); + + break; + } // temporarily disabled diff --git a/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/api/client/VsbManagerClient.java b/vsb-manager/api/src/main/java/eu/chorevolution/vsb/manager/api/client/VsbManagerClient.java similarity index 100% rename from vsb-manager/src/main/java/eu/chorevolution/vsb/manager/api/client/VsbManagerClient.java rename to vsb-manager/api/src/main/java/eu/chorevolution/vsb/manager/api/client/VsbManagerClient.java diff --git a/vsb-manager/src/test/java/eu/chorevolution/vsb/manager/VsbManagerRestServiceClient.java b/vsb-manager/api/src/test/java/eu/chorevolution/vsb/manager/VsbManagerRestServiceClient.java similarity index 100% rename from vsb-manager/src/test/java/eu/chorevolution/vsb/manager/VsbManagerRestServiceClient.java rename to vsb-manager/api/src/test/java/eu/chorevolution/vsb/manager/VsbManagerRestServiceClient.java diff --git a/vsb-manager/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java b/vsb-manager/api/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java similarity index 64% rename from vsb-manager/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java rename to vsb-manager/api/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java index 14435396..be37db23 100644 --- a/vsb-manager/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java +++ b/vsb-manager/api/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java @@ -1,6 +1,7 @@ package eu.chorevolution.vsb.manager; import eu.chorevolution.vsb.gmdl.utils.enums.ProtocolType; +import eu.chorevolution.vsb.manager.api.VsbManager; //import eu.chorevolution.vsb.bindingcomponent.generated.GeneratedFactory; @@ -8,12 +9,12 @@ public class VsbManagerTest{ public static void main(String[] args){ - String interfaceDescriptionPath = "/home/pntumba/inria_code/repositories/urban-traffic-coordination/bindingcomponents/bcDTS-ACCIDENTS/model/dts-accidents.gidl"; +// String interfaceDescriptionPath = "/home/pntumba/inria_code/repositories/urban-traffic-coordination/bindingcomponents/bcDTS-ACCIDENTS/model/dts-accidents.gidl"; // String interfaceDescriptionPath = "/home/pntumba/inria_code/repositories/urban-traffic-coordination/bindingcomponents/bcDTS-WEATHER/model/dts-weather.gidl"; // String interfaceDescriptionPath = "/home/pntumba/inria_code/repositories/urban-traffic-coordination/bindingcomponents/bcDTS-BRIDGE/model/dts-bridge.gidl"; // String interfaceDescriptionPath = "/home/pntumba/inria_code/repositories/urban-traffic-coordination/bindingcomponents/bcDTS-CONGESTION/model/dts-congestion.gidl"; -// String interfaceDescriptionPath = "/home/pntumba/inria_code/repositories/evolution-service-bus/bc-manager/src/main/resources/bridge.gidl"; + String interfaceDescriptionPath = "/home/pntumba/inria_code/repositories/evolution-service-bus/bc-manager/src/main/resources/bridge.gidl"; VsbManager vsbm = new VsbManager(); - vsbm.generateWar(interfaceDescriptionPath, ProtocolType.COAP, "accidents"); + vsbm.generateWar(interfaceDescriptionPath, ProtocolType.MQTT, "bridge"); } } \ No newline at end of file diff --git a/vsb-manager/api/src/test/java/test b/vsb-manager/api/src/test/java/test new file mode 100644 index 00000000..e69de29b diff --git a/vsb-manager/src/test/resources/pom-vsb-manager.xml b/vsb-manager/api/src/test/resources/pom-vsb-manager.xml similarity index 100% rename from vsb-manager/src/test/resources/pom-vsb-manager.xml rename to vsb-manager/api/src/test/resources/pom-vsb-manager.xml diff --git a/vsb-manager/pom.xml b/vsb-manager/pom.xml index cd52c8dd..5f86d7df 100644 --- a/vsb-manager/pom.xml +++ b/vsb-manager/pom.xml @@ -1,136 +1,16 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>vsb</artifactId> - <version>0.0.1-SNAPSHOT</version> - </parent> - <artifactId>vsb-manager</artifactId> - <name>vsb-manager</name> - <packaging>jar</packaging> - <description>vsb-manager expose a REST interface to generate a Binding-Component WAR based on the description (GMDL) of the system (client, server, publisher, consumer etc.) to bind</description> - - <repositories> - <!-- REST library: Restlet --> - <repository> - <id>maven-restlet</id> - <name>Public online Restlet repository</name> - <url>http://maven.restlet.org</url> - </repository> - </repositories> - <dependencies> - <!-- RestLet --> - - <dependency> - <groupId>org.restlet.jse</groupId> - <artifactId>org.restlet</artifactId> - <version>2.3.1</version> - </dependency> - - <!-- Chorevolution --> - - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>gmdl-utils</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>artifact-generators</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>gm-rest</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>gm-soap</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>gm-coap</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>gm-mqtt</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>gm-dpws</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>gm-websocket</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>service-parser</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>eu.chorevolution.vsb</groupId> - <artifactId>bc-manager</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.json</groupId> - <artifactId>json</artifactId> - <version>20090211</version> - </dependency> - <dependency> - <groupId>com.googlecode.json-simple</groupId> - <artifactId>json-simple</artifactId> - <version>1.1.1</version> - </dependency> - </dependencies> - <build> - <resources> - <resource> - <directory>../bc-generators</directory> - <excludes> - <exclude>*/pom.xml</exclude> - </excludes> - </resource> - <resource> - <directory>../protocol-pool/</directory> - <includes> - <include>**/pom-gm-soap.xml</include> - <include>**/pom.xml</include> - <include>**/pom.xml</include> - </includes> - </resource> - <resource> - <directory>src/test/resources</directory> - <includes> - <include>pom-vsb-manager.xml</include> - </includes> - </resource> - </resources> - <plugins> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>assembly</goal> - </goals> - </execution> - </executions> - <configuration> - <descriptorRefs> - <descriptorRef>jar-with-dependencies</descriptorRef> - </descriptorRefs> - </configuration> - </plugin> - </plugins> - </build> +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>vsb</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>vsb-manager</artifactId> + <name>vsb-manager</name> + <packaging>pom</packaging> + <modules> + <module>api</module> + <module>service</module> + </modules> </project> diff --git a/vsb-manager/service/pom.xml b/vsb-manager/service/pom.xml new file mode 100644 index 00000000..16b4bfad --- /dev/null +++ b/vsb-manager/service/pom.xml @@ -0,0 +1,71 @@ +<?xml version="1.0"?> +<project + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>vsb-manager</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>service</artifactId> + <version>0.0.1-SNAPSHOT</version> + <packaging>war</packaging> + <name>vsb-manager-service Maven Webapp</name> + <url>http://maven.apache.org</url> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <contextpath>service</contextpath> + </properties> + <repositories> + <repository> + <id>spring-milestones</id> + <url>http://repo.spring.io/libs-milestone/</url> + </repository> + </repositories> + <build> + <plugins> + <plugin> + <groupId>org.apache.tomcat.maven</groupId> + <artifactId>tomcat7-maven-plugin</artifactId> + <version>2.2</version> + <configuration> + <url>http://localhost:8080/manager/text</url> + <server>TomcatServer</server> + <path>/vsbmanager</path> + <username>admin</username> + <password>admin</password> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.2</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>eu.chorevolution.vsb</groupId> + <artifactId>api</artifactId> + <version>0.0.1-SNAPSHOT</version> + <!-- <classifier>jar-with-dependencies</classifier> --> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.restlet.jee</groupId> + <artifactId>org.restlet.ext.servlet</artifactId> + <version>2.3.1</version> + </dependency> + </dependencies> +</project> diff --git a/vsb-manager/service/src/main/java/eu/chorevolution/vsb/managerservice/VsbManagerResource.java b/vsb-manager/service/src/main/java/eu/chorevolution/vsb/managerservice/VsbManagerResource.java new file mode 100644 index 00000000..a85bcde4 --- /dev/null +++ b/vsb-manager/service/src/main/java/eu/chorevolution/vsb/managerservice/VsbManagerResource.java @@ -0,0 +1,95 @@ +package eu.chorevolution.vsb.managerservice; + +import java.io.IOException; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; +import org.restlet.representation.ObjectRepresentation; +import org.restlet.representation.Representation; +import org.restlet.resource.Post; +import org.restlet.resource.ResourceException; +import org.restlet.resource.ServerResource; +import eu.chorevolution.vsb.bc.manager.VsbOutput; +import eu.chorevolution.vsb.gmdl.utils.enums.ProtocolType; +import eu.chorevolution.vsb.manager.api.VsbManager; + +public class VsbManagerResource extends ServerResource { + + public VsbManagerResource(){} + + @Post + public Representation generateBindingComponent(Representation entity) throws ResourceException { + String receivedText = null; + try { + + receivedText = entity.getText(); + + } + catch (IOException e1){ e1.printStackTrace(); } + + System.out.println("received : " + receivedText); + JSONParser parser = new JSONParser(); + JSONObject jsonObject = null; + String protocol = null; + String interfaceService = null; + String service_name = null; + + try { + + jsonObject = (JSONObject)parser.parse(receivedText); + protocol = (String)jsonObject.get("protocol"); + interfaceService = (String)jsonObject.get("interface"); + service_name = (String)jsonObject.get("service_name"); + + } catch (ParseException e){e.printStackTrace();} + + byte[] byteArray = stringToByteArray(interfaceService); + + ProtocolType busProtocol = null; + switch(protocol.toUpperCase()){ + case "REST": + busProtocol = ProtocolType.REST; + break; + case "SOAP": + busProtocol = ProtocolType.SOAP; + break; + case "MQTT": + busProtocol = ProtocolType.MQTT; + break; + case "WEBSOCKETS": + busProtocol = ProtocolType.WEB_SOCKETS; + break; + case "SEMI_SPACE": + busProtocol = ProtocolType.SEMI_SPACE; + break; + case "JMS": + busProtocol = ProtocolType.JMS; + break; + case "PUBNUB": + busProtocol = ProtocolType.PUB_NUB; + break; + case "COAP": + busProtocol = ProtocolType.COAP; + break; + case "ZERO_MQ": + busProtocol = ProtocolType.ZERO_MQ; + break; + case "DPWS": + + busProtocol = ProtocolType.DPWS; + break; + } + VsbManager vsbm = new VsbManager(); + VsbOutput vsbOutput = vsbm.generateWar(byteArray, busProtocol, service_name); + return new ObjectRepresentation<VsbOutput>(vsbOutput); + } + + private byte[] stringToByteArray(String string){ + + byte[] array = new byte[string.length()]; + for (int i = 0; i < string.length(); i++) { + array[i] = (byte) string.charAt(i); + } + return array; + } +} diff --git a/vsb-manager/service/src/main/java/eu/chorevolution/vsb/managerservice/VsbManagerServer.java b/vsb-manager/service/src/main/java/eu/chorevolution/vsb/managerservice/VsbManagerServer.java new file mode 100644 index 00000000..dce1a593 --- /dev/null +++ b/vsb-manager/service/src/main/java/eu/chorevolution/vsb/managerservice/VsbManagerServer.java @@ -0,0 +1,27 @@ +package eu.chorevolution.vsb.managerservice; + + + +import org.restlet.Application; +import org.restlet.Restlet; +import org.restlet.routing.Router; + + +public class VsbManagerServer extends Application { + + + public VsbManagerServer(){} + + @Override + public synchronized Restlet createInboundRoot() { + + // Create a router Restlet that routes each call to a + + Router router = new Router(getContext()); + // Defines only one route with a new instance of VsbManagerResource. + router.attach("/bcgenerator", VsbManagerResource.class); + return router; + } + + +} \ No newline at end of file diff --git a/vsb-manager/service/src/main/webapp/WEB-INF/web.xml b/vsb-manager/service/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..51232774 --- /dev/null +++ b/vsb-manager/service/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright 2015 The CHOReVOLUTION project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> +<web-app> + <display-name>Binding Component Generator REST API</display-name> + <context-param> + <param-name>org.restlet.application</param-name> + <param-value>eu.chorevolution.vsb.managerservice.VsbManagerServer</param-value> + </context-param> + <servlet> + <servlet-name>RestletServlet</servlet-name> + <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class> + </servlet> + <servlet-mapping> + <servlet-name>RestletServlet</servlet-name> + <url-pattern>/*</url-pattern> + </servlet-mapping> + <max-file-size>82914560</max-file-size> + <max-request-size>82914560</max-request-size> +</web-app> + diff --git a/vsb-manager/service/src/main/webapp/index.jsp b/vsb-manager/service/src/main/webapp/index.jsp new file mode 100644 index 00000000..c38169bb --- /dev/null +++ b/vsb-manager/service/src/main/webapp/index.jsp @@ -0,0 +1,5 @@ +<html> +<body> +<h2>Hello World!</h2> +</body> +</html> diff --git a/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager$1.class b/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager$1.class deleted file mode 100644 index 91d99273b33f6c895dc79fdaf4b68335599c6d4a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 821 zcmbVKTWb?R6#gdJW|O!z@!D8#wXV4+xL7KE@B&g&D0Z9bhW4TOFuNI&t&^FumxwR^ z9iLSY5$O-`M~P=vFcf@HVfUQ#oipb$=bP_8zMcSB$Gti(W2uHJS~aq+7`SZXssY!G zxNhTyjTMF`Zty0~qKVIsU6H%dL?>dVWuC=axwABM$J3E?3Ch$JDxaqAUZOJ{X*qm* zEEr0M+YHsmk&IQGJ!L3&d;1L5rXEqSu@ft?n@>ZL40$NYvlwJNdQHs=OcOEG1Dz+4 z*osZOv7d%MS9~mz`$v4n$<tSn)M>27zQ`teWaE~NRR_1>I;i7}gF9$D=%CB6Y*IYQ z)!5tBK^{%EVj)NUB+-e3o;h|GZHAu6y;B$U=%U{AS6gpBf%|~L*;Yy<o06xgNEw>* z4ukMWL>WWpFRL-E{qdw(uvaYDD;DgXUT|f`Wo}w;bbE(8|6bt{vGKAW3>nt{FWc71 zC{|n++!EPVFnG2{%6~B&HdpA0)#%BwX3LOaEb=&5Bz>09JCw-+HokzJe5-##>7)6| zpJ7>p_pqK9utIQQ4sC*!0)C+M8ZKf93uqDLZPFdA;UVb~8dSJq%ClE!l6?-91DmA( aTTuFW3Y2hxiU1Zak-SNNy_l1XX7wizNzPON diff --git a/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager.class b/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager.class deleted file mode 100644 index eb4f97c2addf707b229e5aca7f4f651bbb57d9fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15076 zcmb_j34B!5)j#KEX5P!>g=HXthXMftB#>lCzzBmI5TMZ{AYl==Fqu4(fyqpqnXpu? zd)?Z)RV!MntqWCgLmdK$QrBu*yV+K|*xK4wyI0$<)h>Mh^WMy41}2F7s^q=<?z?BX z=bq(%@65dN-#t$g(HynkOTS=K<8c}v<E0`tbv{<^<BLi01fAZ|d7?a5c=0?*E|ZJt zMxLT^rI)AjG@Yk=xr(d3JcDO?=|rxP*R?v=$=$E>ES>9hZqRwQbj;EDIJq}^X$l`- z%yW63v;rE>_tGR$<OE@RqCA|W@yQyWqVWQa7izpn<0g$4YrI5WF4g!GUh)e?vzO}S zeyW#di;DGpn#L^}w`$zx<z>8F#+|P73NJNsyT&W!d6mwq<-SJeGjv`nnx83`vvfXN z?&s)yu9v2Bhg{ZqsfL4c>6A;z%Ux`Fc|CWRa1V!d-XN3MSi%wRE#@f4bnf%=c^ua{ z;pHUv%dkx)yqULnc`JWX=ktZn1wwV9#-H-ixonDUFOti}!silcT`HH$M4iiZzC!Mw z7LqGvz*QxDHD6Q0*Yamd__O>uxm>65^%~!x^Nl*+<fRx-()jaUN(l1=->ma3Uj72# zs_`~2ZQ<n_-&V}G^A~l#!^>adJH31te_7+N$l$wmzQ@b=@_k<3&R_NN{rrH=56YVz zIzQy)hxrkmANBHMyi<lfuJaQ*KdEs_=Up;-Kzes;yhrD~^8A#}`(*Uf(*H~``0UsD zYx3q<FF(i6>->U9dQs<>WY~-H@O63fvb0{2);Ht={l2O5w{(70<8N#H9gV-M@%J?T zzRs`d`~y+!hdTdA=ht<9Lpc3d1pdU!Kjojv<xQP`E>eG?^IJOqQeOT_=eNbSzt;IT zI{#MZcSPj7Lj11Iztj2mI{%@V-r_%c;je%4(&zZk;<<m(`L9Cvo~+6HLi0E2{<{qL zKb`-f^FMX|Kuq?bmyYM<I{!=Of9w1o@x%XWe85X@h`%-}LQAn+l%|Tj^rmuY%B?96 zlhGWFTJc4ZU?O29m^>$hqv7O9Ohr}ItC?JjVqF%~@Ro4YYU}UqwBjp+oe}gH2`jlM z7EL6B(Im)Ry}@vlsl4i}mJPv8L4PC|?e@1P<KbxceBm>;+k%u}(pngfcA;}othX-~ zwW3L;=Bh(UTC9G5s3#V;HpL?S$#5*{-<0U|clUNh{CJEc{8qHTH{o9%k0oQFSY+ka zKFbzU+MW!CHns-)Y%LLqn$qAh2xUaE#H`XaRV+cSyqYSJtfUN0m1=4@)A&Rv7+qn7 z`s0c4CM&XaNi2RU=CZ7FgB6lFE>0^Nj`^2_Bi4Ld?JfRfECz)jINBAAcL{~OZ4E|) z-Bx^lwKF-<+TRjRB<E{t1XFQ)xH}q5_Qzq#(Eoz%33<w7lyFp^f6{!WVR0*HE9dkv zoqqIUGjl#jjHX7yQ?d)a$o46wzN(L0&85BVR(w-9WUa9J;#LA~5tK!r|B-|R-2f>` zQ$9_NLK@Q4Xib%As$5fJG&NRJrlzpw#~^t#jR?UgNegbgKHM#fW;^3ixZa@-T)i6M zhfrhkw#WM8A<JPue08ET?HP3&;3)?Eirz*rN!y?HE2c5_V@?Py><>q}tT=))5f2&a zST){I6Vyb6oy|m5s7c_YCL3xBTB=fBRTrE`XUN~{c&2}0D6NU6rW$IRn$A=bvQ1I9 zArXses>)E+YKEp}8mdOv)~Y%~`GxneretDiEY=;d>bk>S5kt+AUR77eRN5J;O}juW zj-VM8j3>kEgP~+zuV=H>8SLvbRJ{=DNh^`8+Z>D=szFUO=(qGX;?_{J)f|I<N55w} zuHa-cto?%m{cD2prB14e!Cun~(q$|#xEO{yPBj|pcr}-)svwORx?yty3FuU5t!Zy+ zVOmmfsGX*qtdMZrx-S?<%b#}gCMyw&hx^3Cm)kFxPWX6?#OQvTc4@Qd@o~u|k2>V7 zLSEQaa<c8RKFQtCmudFUn&xKaEQO?Irp6(t{C(*Rp71AP!9Mt8J8n4(cm#w<7)cPW zz%5H?sCg1s{vpI>%gDlz6a4*|=}n5oyZz$+{zSO9FJk%AOLuDfvbM}(`RwpaN9zit zRSS+AP)M@l4yG2eOu`+NA!}Z?cuUB#*Pm(X!6a#cwy^9t)Gb4uKyMrBL^T<SD;bP; zTgi@Su-8iT1w)p>uPW5+5w?h	^qDWju<tonCDML!Bahgn&I80lh#iG}I#1gk&Ns zZm7j-iL~vwUaCG}@IG9SU78JbsyfY3EfSrrhH6vGG_~ANr>hmHriN-)E18!0dt$v7 zjMvrGgYfJL`kP{#qmfv!D`6LOf3~96rgf_A>`zE_ugydyQXFzrIO><l81!%Y4{Ef* zFR3O?tuoYVwFWV|vd4;B6+!$(V-*QI!&a<E22WHZV-+EQ3$!c3(F#qSVW_n-Usc<s zsWT0AmO9%|=csd0@(tCY)@dqes7@7PG8e`ABVAya%yNKxO7S;T7i`Zib~BB(ZJe&> z(T!G@RCPmHYQ3Sl6|!@W3L9#Jv^GlCjHpRWZYSHTUKKT%Ss5y(mH>bls!yE<{9&lL zN}zrkDk+5hY7?AE1Qjl|>6Z@5TG1a(hI_57ub>7GPDCtU!8Ec$nAsMph}n3C=~$S_ zpXiVJLx6a__(N(FwAU(4Lv2=D;85v^vbvTag~#GsQCJPNReh4Ft`NDP$ORFB8e11{ zfn5?gT9p?dfGka&Z>S5@g(z<EepH=NhWeDc2zA>~7pqI4x@~XUr<<cm3z*7Km#WK{ zv~V=J1V9b--B6dSD^TGL^=UOpQ&-A}t1u#m;A)f^JG9UTIAEx2)U`}}96*7gKBKNR z)MwS_0Dr-BSri$I>zR)KsPr)eZb1d_E{tdlb)C9iw7ua7vThE%E`wTD9A(s!;vraK zc`(^ys2kNy@LQyUeBiVs9_y9LAT#^Cp>9^U80rh^R?G^nd7}a<G7WW`C{YSpv69U@ zVW`{1Dy~HMla`^rsO~V-m(-nxx=UJLR(BqO(phG3dRu9%D`YU8ID|2CN<d#c+#60} zNfXHDux)>*L~?qYP&Wj9HkUhCa78R)IW=eA5Ck~_b4o|Pup^+&saGGHw)ecGl&sd% zSFX&b#U$(U_C0mTjCGQi>+I@UXHT+jaFU+(#Vb}XUSX)Oh{JmpwKOkoLmJkQRAmra z;v8rh>TX%Yd(^!^zlOR`U1F&15?>=a^J`$ep}wl_KeWFASPpx>TzwtBG4%i(3zg(S zwF3@i2bnma)IK;T(u=_Bj?PFdw6VS;>&P9@ZBsDPZ!JUOd`R7K@X&_5p~D^WMT7p} z^fY994E3;j#88i_CWBv4j~QyGnuC4kP|^*42XK~0G4jl9>TyFo0kEl_RH=h#^3@mt z3$$5Vu=CCOr5jt|c+yb2)Bubo9#!kev{5v=#8D3FlJ(E+GSqIhhba$OtciyamWJ9Z zMdT^L_WK0VI4HtShbw#HvCXm@H`LSW8Auw;lo`xX7};ei?I8ZGM7C=fB3=#(u-rX& zo;o?HepG=|0NC~5f+ki(Dg#cRlKX0itu(eB_5`zA>5Rdg+5lrYCljcC!q&#CD}#xR zKnuCtPemcj2(CP2=<u}WnLU0+hAp&NWS|P7{Duy#oy&3ZfGt1M!~!pyto1lS=}K>j z%>pA@tz=KE%l5uQ%JM>qox-ou919iK)j?=FzJRFa=%!dGjpqx^1P322u~;9|F$IX1 zgsn)|3Tr*ngaU6-v$~MNW6@v)=?GgqD~dVQ7C7QbAB^OH)$}eGIJ!7tA&oeu_8q#p zmK|fvIa~rBt2&euSd<kKiGwJdPb3#~CgfPjuAu-J-RYyLE<rz1S24==G+Vc{fro+4 zZngkXiOZUKa&umZ@Po)RG$oRZEeEbLO)jLOGux<@^sidc0#?q^K>8UWkc=(f0yl(x zu}ZySs{YP|ea<FxZZ2qxVNOEIzy_?VWZ?{&NN+_4-+G<Rc?W<v1Y%nb%#jS^xXRuD zy4sg5Sk5%(XwGJE8UhPs1Enm_gz0X~*&FQY$_^^ewNhq`94YFVbpz6{iw;v|dMu*X z*_UOG-|Urik|OvI2hfNn?W4k#abPMq5%PK#>JGZWv|QO~@>~mNIr>1q(%zG`WwvB6 zos>&w<0ZXNGtn0b0}4&gWt%x9EtoR(o?xO!^s&!ln-NmhdHul%&Q<dKJEPi}LxMqj zpWj+Y?nkcU5Fi(J?5#R#;*TUeXlHJp?&>gTlhxVZE$4J+Ru9D^2jHb$1Se5)w2*@* z(~BL8i@RkUX(9YQuSl)L(Jt!Urm!9HW$@kht%;=7n_EM$kxIL9?p|$Cy0n44Q<j~o zg|sW6Orii4A=n>*H)Io7&Jd85i?sBivczWku#PF=tYSu5Q#jZijUhlovJsV3<{V7h z2j%`2TVlE=ins`2TMje&7diKIfMl3u1j+<+gl1>qWNX_7@W@y{)Gu=~7FaKLq6)je zUJzuDJ94@K`Rve(;2<f-EDPfC;8yswCzy~q;7}y*V}y)%JA$(1A2I~oIwk(ev};2R z2RJ!X&dlrJ`Pi&7FNd_CJzKlz17xLb_|bh%g2*t>b(MqR24>)bL!eUTXTpVWJ1ZE) z>zvJRx)T+l(|NsGz_Xnf5cWpKhn<7T;t1?03ka)@tg1dMyGGInz9r#AQ#g*34Q%Pf z?p<9AL=7`-Mcc-UVvz_&AnDJqh6GPIA;gZ+oqSf3jJ3oz<HMt10{uElePT^m%4c43 z$|N}OD1sm$Dy&*&L7cUPmf0o83ffBM=Gp8TK#HJZ2N{%S%7?9P2AqjoAZrRrhk2v+ zEgNF_bwKav%V4%y1yf@IfRm{}Fi1y8jyrHTeWbLxAP{OgaMo67bu0|SxK^%Rz8DMU ztd{-4#uXUr=}p7K1y#+5yw2&!7`vr_>JGvLGgoJ<3(GEftH3ZDY+_VVTtHqPbaS*R zNR?64)n$d?N%*X+0Biemx+ByU=v7peBTk&B6kxV^OCMlZ{gE0!gImG0?nr4elQI(W zfmBFv^G0Yh`$*{rfwtHa_&{PUk-%qvOzR3-Xo3B<7oUJRaAJNTGs?^@43x+$^ggqK z?v7}`g!QDt3!TG;sjHwmLo8S!p*h?ND&?$akqv;3*nl}qnNBIFV$P6)a`V=})v;c- zZxad|B)#vEwQ81Al*xtWiE`!~QrWf<6c5lngnOnJ32rPOs!I+{dytaCe{}Q7nJ@Ut zCujCf;_w;>UiLbkw>;7>rMADX3m<*T{=s%_dqbzJ^Dy;}Fv5PpQQ10Y_Xi`oJCZ#X zJl)-4MWjHuI-=HQruhX~A11Zrtze)aHE;`H8KUO!0ingMzK9L@n{q=~uuwaIwG|EJ zmHE8>+<KJGvY1kzZOs!a+c$@kp&oqkpwjBE%sauW#0g%doZwYTnMzdJCwP_lrzq+y zKzl6~$2TKn-|WjPYyyd3P1lOW?eNKY1?QjR6a}3zolNDx5yc<%HzOY(%|Y15Klzd6 z?UYZY1z$KBJzKcpYejtm4d><>IgR3SvVT6V%P-AFGA8GTj-erIvz&(E9*V@ol}Z65 z+WY(LG-yGGvAL46=VI72&?K5dzrYvKh;)47g-_dY{WYG(<Bku($US2h@ndK({RUT$ z-FXteFM|)E(Z*0dg<N<;Z0seqb}tpJ-9;{+J4K$Iq~Yq*2b;xcrpUXCN>XGzPNlwK zDH`q@k)n|)l5wLRr_oMdS#Do>F6S|W?8Xi@&B112(c|((AM-zAnV#dZ`P|13T5K{5 zOSFI*Xdx}3MRX=L(RQ>RqNVJnW-g&qshHlOcO7feQ>3T}6p;a%u#?JLX6~ek15~k> zCc&<gTWfq%QdF6usWrZ7na1=?qbk#=&NOCZ8Z$GEnoOfM-AGa0ptdK`aL8_h2FppK z6*P?2P&ss-NM}(MokR6>E(NFq^H@hM6r@$uiJlO3(|X#7Yq5ME!I_Er5FAFrFK)zl zN!s?3ANtQ~+exDXuDw)`hlYTg10K`8mu9auUAt&bijLb)jRDVg@&+^$zB8|OCzYls zP-}X8^HX%femXHlC&|;vnWs~H3j*2<-@+6v3g{;Of7;d6Ak=|k)#x?ha7_<lMveGW zG^^)#xL4Dx&40q(G>d(UQ?z6ol@~R7x6=qbFSVaNu10T}SLmkLbhzL@6MqsC6J`w1 zCt7i7Zk5Hkj~?DjHEU~XchRY?6rHx8Y68U~xMhG^176e11JuU5X_<=xCE|6y<?#Q2 zVH#%10G%EvHA{EX3Z~nrVkfm{;%6ls$}|uqj$@^0m3tqZxVFf*x_zz7e$gHnW)2&m zHG$y}VV1BtoQ2aF8U;p}BX-kTrWBod8<l{o?<_D7ozAYAIY8$;23w4$Su~rDPv7UF zN8<ZNs>F38o_Z10Q8K6xYZ#|-l)%VMpxFwl&2$`XfghX?zrKK$(S`7gi{K3xQ<yHn z$jj(EbOrr@uB0E+HS`u;OYhTX>7R5R{fDlH$KSx^bQ4dco4J~9;U#n{ucd9gj&A2T z-N6^pm-tHhGJl5d;Tz~a`U5n2m`V;nu%^);HTsiAf7a+PcKfdyy+^Fk`<??(qNLz^ zyYp|jV)cd_<6Iw*>j36B?68CXuF?N#^bd{xsnG{S|D{tj0*?<h`qu%NruZ<#(AO)U z%fpJ2O23V0k{qycFP#gw?`TC(u4}6exJ=j6jqajGPnoC8{S|68U1c8IbyF1FMx$y> z4QqA!Zt7IDW;<0$K!mnYh1|PRWck*osCyfYaK`oQrZC1`?&0kRcGf%!an6EHLr4<c z4+S2eQhJc4(GIFZ@;Qkfq1E&#Lia%|+T*s7r-@z0ijgsA%=`n5{)>MMv;CW<qW43p z{3p5TfN)2rS3aswr>!f{FJ+)*rfVO3yl6)IZrY%zwPrWrWWKF-H=%HEqf#_*D!ZSe zkM5;dwp#ST%V8C9cHeo9$M2%}Guc^`gFDdxlGARaqdiDRdlAO_Y^_U(|3lTXGF(K( z@+AaEC2uo`W}{@i;9Jm|&Nyuxa3KS=)=JK)8B94YNjYv4m1EvsN??(a@?^ROvrd1& zgD*)V^K44d=71*Sk!(`5)zn6e+)3yAE=bXZPS>Xp{%+qzDY_WZ@Ae^OT^uMei%qZZ zk`!Hvz%Q2gy=;Ik$J;AX^l9IfDZ0vcb&9S@(Y0&rk)M%~rD!7k9WwH>>5+^K;FfZE zvEBHbG=_s_xbM0Fx;{lWAQ8BIH%j+N4*2k<#CMZ0mZr~Pj1n_IpSR_@ebZ&=D0Brz zBdwO1qn*53ZsLDCua<FOj9C^Ks~Sxc#n(=)$RUHdbw)b3jx)y&=2la3>)65EYL=Oj zTaUBpaKV3>+&bMH<+~Zy5cO_>to)~9bA*ZVFE&ci7Xo9=v8MY8y4AO>Xn<}@(d_|f zWt!#)-xpJKhwn=%x-&(0rRdAj>#~P@B}I3O=Jy1~!8G^Ee2+25naB9<OIz$%JfWD| zHc#`}4n8LE#Vu(oeO0K&gZzGJOhDrSX-q`pL1|Q=u|pb@(C|xRG8zwIp#%7$eI*B` znp1oar|6MDB^r-PV=AOh@I5ALGffom?ZgDk$`n1Gq9+2=O)SilChEPd)>K;$bfvOg z7zv|{Gbj6YnUe=-K-Rv>e%_sZt~RTDdxWjSUF<spLlAa**O=ALD~PxyFcZCi3+T=I zf1t*!@jYc@oqd5C6y*RS$Od|5EyC3SK>&8B)K$KxMF>jUK<*H;Mq>LJC${0gu!sbP zZ@(<IDQ^BX+rrO^26fP&F0I#LxIK4d-2C8%Wx#yKnd5!WvlwTV-G0Gt*YBhkG2fT! z9<W`JC*US^UQpPv_)FmL6<1?JSp#hKb-PyIO^rM0<wNF|27|9aud;>#`i7(50DbfF z2BhU@%~>X(+<*y~24DIXlKR61*iJkOwiWqo*A!s;>QS(rl*<-Y!u-FTH58ABT{3n$ z2JJZhUM?VcNIQLJC_B|VcB(!)I~|6tZKpxDAInaMVQbqd!xo-3%lBQ0fqGki+wba~ zo>_xEvwYvfn6z8g4?X}6tF<P;WJ!v?FJ-2|Y)H{-kD<Ey07s`G-8%QV*f_M)YTDx2 z;o0Nahkm=_^P7NYM9;!~pQ93b9uWRTP`nJ<Z-V+2!1!-aEkH>leV3NfYvA%j@OcBA zene-`>p)RI0XTXS%lR$<-tXvgRN3q3kAPr*M)my*M!b&^f5Vq81X1bqFZQD78mw_C z`*;{n<B{yg7f0ssX#5zXj2Cb@pT=XjjmPp19>;t5SpGU!@b`E!zrj=Z_gtx%r{Wg| z(^WZF;|tF-R4v!27OqpPxL%#h4XT@Gt3IBiw(@c6Qa&DE!kUL~qXpCre1f`-PgHmF z$?9QVpuWZn)oZ*+{gxN2fAEqb{IH>D95)wD=F^I1aZAx$ZYyfyWkt*R^rBU~qA0>E zi+1v=qCLFEMSO-!=QCZS`7BojpW|xc4%aGP=eiX4t2pSol{;OxbC+ueTdp^7|2eOB z{h7O6?{U~ehRaBt*|?j;;^NBBJVg&cQ3fcvAIaPQ}&`#Ij^evLPKm^XPe-r^a< zTRr3We9uh2z;g!f=kkS~C|}~am@oC*$d`NW<SRTo_$tpHzSgskul78{*La=>C<Ywn zC{-N5V!CZ03^)u>oC}1jNI&R}#*m4hdSH{Uak1wBm(#eRhG^{77{C26?0=<L*PJ#w z?MD%be}B_hU^LPIfOY8yRC++2PYwSw&OF=}=O~j^!%-}I9icJ);q6HKipDTUE78zt z%iB^xv5G&WQ+x;Ahfh7IBQs$5Kd4P(p9e@6UxadCWs!zR1TWrr$l*mU$^?EwBs<$& zL5@!L%+#1O4@#Z&cwXx8`@!JBN5H+EYMkC5=J%F6y+6wBEr@Atj5^Qs*n4dEAmAMY zu=8fvd)Vow=9@oQ@Kf~q8uXlup6pip^)-9xjkPm((T@W<1LNwl6ZuJseroD3%I@+- z8Y77KXWQu$0KUMxDf;<#Iw9RRN4CPC@;(DF41!6y1fw&k7zDP;KQl|7$zp6IKQB_y zU352+oO7Rx?aV%GBaTns=VF1z@-awT2e_F1>HAzPQxi9H3%!Yy6kt5ld%TWAnPf?q zQU%6bM?Suu#$mTPo^Qf$8$VAo_-3l*FVJ${Mj^h9*7Fx>E8jsE@SSuW-$QrtcDkGI zCHy{*9$@Ig57B;pke=lo^b$Wpukxe#S?6Pr_9Qe)L8o2N;7KIJU68+<L%3T!z#Djv zy@}aLqYmK61!3z%b2^|0Bb&;~eC@K$T_u+p2av|SLk-rrOhbSp(#uQmGtF}RxU2jC ujUwYC2(m=j2CBp9f**q-C=`!@Jr$3oU*hfq$y>P72pvDO>`}u!#s3eYX~|Up -- GitLab