diff --git a/modules/distribution/pom.xml b/modules/distribution/pom.xml index 0e021802..8f56d39c 100644 --- a/modules/distribution/pom.xml +++ b/modules/distribution/pom.xml @@ -244,28 +244,20 @@ d - + + + + - - - - - - - - - + + + + + + + diff --git a/modules/distribution/src/assembly/bin.xml b/modules/distribution/src/assembly/bin.xml index bd414507..230ddd00 100644 --- a/modules/distribution/src/assembly/bin.xml +++ b/modules/distribution/src/assembly/bin.xml @@ -1272,6 +1272,7 @@ src/samples-deployer.xml ${pom.artifactId}-${pom.version}/ + true diff --git a/modules/distribution/src/assembly/dist.xml b/modules/distribution/src/assembly/dist.xml index 1cc58910..3a46fb28 100644 --- a/modules/distribution/src/assembly/dist.xml +++ b/modules/distribution/src/assembly/dist.xml @@ -35,5 +35,23 @@ features/** + + ../samples + ${pom.artifactId}-${pom.version}/samples + + **/*.iml + **/.DS_Store + **/target/ + **/currentsensor/** + **/digitaldisplay/** + **/doormanager/** + **/droneanalyzer/** + **/connectedlap/** + **/firealarm/** + **/geolocationTracker/** + **/watertank/** + + true + diff --git a/modules/distribution/src/assembly/filter.properties b/modules/distribution/src/assembly/filter.properties index cf2d1eac..353373f6 100644 --- a/modules/distribution/src/assembly/filter.properties +++ b/modules/distribution/src/assembly/filter.properties @@ -25,3 +25,5 @@ carbon.version=4.4.9 default.server.role=IoTServer cep.server.role=ComplexEventProcessor das.server.role=DataAnalyticsServer +devicetype.plugins.version=2.2.5-SNAPSHOT +cdm.version=1.2.6-SNAPSHOT diff --git a/modules/distribution/src/samples-deployer.xml b/modules/distribution/src/samples-deployer.xml index 264f74f8..1b85ce08 100644 --- a/modules/distribution/src/samples-deployer.xml +++ b/modules/distribution/src/samples-deployer.xml @@ -27,7 +27,7 @@ 4.0.0 org.wso2.iot.devicemgt-plugins iot-devicetype-feature-installation - 1.0.0 + ${product.version} pom Creating custom distribution http://wso2.org @@ -184,10 +184,6 @@ - - 2.2.4-SNAPSHOT - - wso2.releases diff --git a/modules/p2-profile-gen/pom.xml b/modules/p2-profile-gen/pom.xml index 6078b4a0..c73daf43 100644 --- a/modules/p2-profile-gen/pom.xml +++ b/modules/p2-profile-gen/pom.xml @@ -150,7 +150,7 @@ - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.feature:${carbon.device.mgt.plugin.version} + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.url.printer.feature:${carbon.device.mgt.plugin.version} org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.adapter.feature:${carbon.device.mgt.plugin.version} @@ -905,7 +905,7 @@ - org.wso2.carbon.device.mgt.iot.feature.group + org.wso2.carbon.device.mgt.iot.url.printer.feature.group ${carbon.device.mgt.plugin.version} @@ -2608,7 +2608,7 @@ - org.wso2.carbon.device.mgt.iot.feature.group + org.wso2.carbon.device.mgt.iot.url.printer.feature.group ${carbon.device.mgt.plugin.version} @@ -3156,7 +3156,7 @@ - org.wso2.carbon.device.mgt.iot.feature.group + org.wso2.carbon.device.mgt.iot.url.printer.feature.group ${carbon.device.mgt.plugin.version} diff --git a/modules/samples/connectedcup/component/api/pom.xml b/modules/samples/connectedcup/component/api/pom.xml index 0f243b08..3497b109 100644 --- a/modules/samples/connectedcup/component/api/pom.xml +++ b/modules/samples/connectedcup/component/api/pom.xml @@ -71,13 +71,6 @@ provided - - - org.eclipse.paho - org.eclipse.paho.client.mqttv3 - provided - - org.apache.httpcomponents @@ -85,16 +78,6 @@ 4.1 provided - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot - provided - - - org.coffeeking - org.coffeeking.connectedcup.plugin - provided - @@ -116,11 +99,6 @@ provided - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.analytics.data.publisher - provided - org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.annotations diff --git a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupService.java b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupService.java index 7f0119a7..66254e2e 100644 --- a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupService.java +++ b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupService.java @@ -39,7 +39,7 @@ public interface ConnectedCupService { @Path("device/ordercoffee") @POST @Feature(code = "ordercoffee", name = "Order Coffee", description = "Order coffee cup") - @Permission(scope = "connectedcup_user", permissions = {"/permission/admin/device-mgt/user/operations"}) + //@Permission(scope = "connectedcup_user", permissions = {"/permission/admin/device-mgt/user/operations"}) Response orderCoffee(@QueryParam("deviceId") String deviceId); /** @@ -49,13 +49,13 @@ public interface ConnectedCupService { @GET @Consumes("application/json") @Produces("application/json") - @Permission(scope = "connectedcup_user", permissions = {"/permission/admin/device-mgt/user/stats"}) + //@Permission(scope = "connectedcup_user", permissions = {"/permission/admin/device-mgt/user/stats"}) Response getDeviceStats(@PathParam("deviceId") String deviceId, @PathParam("sensorName") String sensor, @QueryParam("from") long from, @QueryParam("to") long to); @Path("device/register") @POST - @Permission(scope = "connectedcup_user", permissions = {"/permission/admin/device-mgt/user/devices"}) + //@Permission(scope = "connectedcup_user", permissions = {"/permission/admin/device-mgt/user/devices"}) boolean register(@QueryParam("name") String name); } diff --git a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java index 3206ab55..f257d400 100644 --- a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java +++ b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java @@ -20,11 +20,11 @@ package org.coffeeking.api; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.coffeeking.api.constants.ConnectedCupConstants; import org.coffeeking.api.util.APIUtil; import org.coffeeking.api.util.SensorRecord; -import org.coffeeking.connectedcup.plugin.constants.ConnectedCupConstants; -import org.wso2.carbon.analytics.dataservice.commons.SORT; import org.wso2.carbon.analytics.dataservice.commons.SortByField; +import org.wso2.carbon.analytics.dataservice.commons.SortType; import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; @@ -98,7 +98,7 @@ public class ConnectedCupServiceImpl implements ConnectedCupService { } List sensorDatas; List sortByFields = new ArrayList<>(); - SortByField sortByField = new SortByField("time", SORT.ASC, false); + SortByField sortByField = new SortByField("time", SortType.ASC); sortByFields.add(sortByField); sensorDatas = APIUtil.getAllEventsForDevice(sensorTableName, query, sortByFields); return Response.ok().entity(sensorDatas).build(); diff --git a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/constants/ConnectedCupConstants.java b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/constants/ConnectedCupConstants.java similarity index 96% rename from modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/constants/ConnectedCupConstants.java rename to modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/constants/ConnectedCupConstants.java index b1b71488..05201c09 100644 --- a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/constants/ConnectedCupConstants.java +++ b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/constants/ConnectedCupConstants.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.coffeeking.connectedcup.plugin.constants; +package org.coffeeking.api.constants; public class ConnectedCupConstants { diff --git a/modules/samples/connectedcup/component/plugin/pom.xml b/modules/samples/connectedcup/component/plugin/pom.xml deleted file mode 100644 index 70a3595e..00000000 --- a/modules/samples/connectedcup/component/plugin/pom.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - device-mgt-iot-connectedcup - org.coffeeking - 1.0.0-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.coffeeking.connectedcup.plugin - 1.0.0-SNAPSHOT - bundle - WSO2 IoTS(Device Types) - Connected Cup CDMF Plugin - WSO2 IoTS(Device Types) - Connected Cup CDMF Plugin - http://wso2.org - - - - - org.apache.felix - maven-scr-plugin - - - maven-compiler-plugin - - 1.7 - 1.7 - - 2.3.2 - - - org.apache.felix - maven-bundle-plugin - 1.4.0 - true - - - ${project.artifactId} - ${project.artifactId} - ${carbon.device.mgt.plugin.version} - IoT Server Impl Bundle - org.coffeeking.connectedcup.plugin.internal - - org.osgi.framework, - org.osgi.service.component, - org.apache.commons.logging, - javax.xml.bind.*;resolution:=optional, - javax.naming;resolution:=optional, - javax.sql;resolution:=optional, - javax.xml.bind.annotation.*;resolution:=optional, - javax.net;resolution:=optional, - javax.net.ssl;resolution:=optional, - org.w3c.dom;resolution:=optional, - org.wso2.carbon.device.mgt.common.*, - org.wso2.carbon.device.mgt.common, - org.wso2.carbon.context.*, - org.wso2.carbon.ndatasource.core, - org.wso2.carbon.device.mgt.iot.*, - javax.xml.parsers.*;resolution:=optional - - - - !org.coffeeking.connectedcup.plugin.internal, - org.coffeeking.connectedcup.plugin.* - - - - - - - - - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - - - - org.wso2.carbon - org.wso2.carbon.logging - - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.common - - - org.wso2.carbon - org.wso2.carbon.ndatasource.core - - - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot - - - - diff --git a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/exception/ConnectedCupDeviceMgtPluginException.java b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/exception/ConnectedCupDeviceMgtPluginException.java deleted file mode 100644 index 92b85968..00000000 --- a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/exception/ConnectedCupDeviceMgtPluginException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you 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. - */ -package org.coffeeking.connectedcup.plugin.exception; - -public class ConnectedCupDeviceMgtPluginException extends Exception { - - public ConnectedCupDeviceMgtPluginException(String msg, Exception nestedEx) { - super(msg, nestedEx); - } - - public ConnectedCupDeviceMgtPluginException(String message, Throwable cause) { - super(message, cause); - } - - public ConnectedCupDeviceMgtPluginException(String msg) { - super(msg); - } - - public ConnectedCupDeviceMgtPluginException() { - super(); - } - - public ConnectedCupDeviceMgtPluginException(Throwable cause) { - super(cause); - } - -} diff --git a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/ConnectedCupManager.java b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/ConnectedCupManager.java deleted file mode 100644 index 621d2458..00000000 --- a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/ConnectedCupManager.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you 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. - */ - -package org.coffeeking.connectedcup.plugin.impl; - - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.coffeeking.connectedcup.plugin.exception.ConnectedCupDeviceMgtPluginException; -import org.coffeeking.connectedcup.plugin.impl.dao.ConnectedCupDAOUtil; -import org.wso2.carbon.device.mgt.common.Device; -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; -import org.wso2.carbon.device.mgt.common.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.DeviceManager; -import org.wso2.carbon.device.mgt.common.EnrolmentInfo; -import org.wso2.carbon.device.mgt.common.FeatureManager; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; -import org.wso2.carbon.device.mgt.common.license.mgt.License; -import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; -import java.util.List; - - -/** - * - */ -public class ConnectedCupManager implements DeviceManager { - - private static final Log log = LogFactory.getLog(ConnectedCupManager.class); - - private static final ConnectedCupDAOUtil CONNECTED_CUP_DAO_UTIL = new ConnectedCupDAOUtil(); - - @Override - public FeatureManager getFeatureManager() { - return null; - } - - @Override - public boolean saveConfiguration(TenantConfiguration tenantConfiguration) - throws DeviceManagementException { - //TODO implement this - return false; - } - - @Override - public TenantConfiguration getConfiguration() throws DeviceManagementException { - //TODO implement this - return null; - } - - @Override - public boolean enrollDevice(Device device) throws DeviceManagementException { - boolean status; - try { - if (log.isDebugEnabled()) { - log.debug("Enrolling a new Connected Cup device : " + device.getDeviceIdentifier()); - } - ConnectedCupDAOUtil.beginTransaction(); - status = CONNECTED_CUP_DAO_UTIL.getConnectedCupDeviceDAO().addDevice(device); - ConnectedCupDAOUtil.commitTransaction(); - } catch (ConnectedCupDeviceMgtPluginException e) { - try { - ConnectedCupDAOUtil.rollbackTransaction(); - } catch (ConnectedCupDeviceMgtPluginException iotDAOEx) { - String msg = "Error occurred while roll back the device enrol transaction :" + device.toString(); - log.warn(msg, iotDAOEx); - } - String msg = "Error while enrolling the Connected Cup device : " + device.getDeviceIdentifier(); - log.error(msg, e); - throw new DeviceManagementException(msg, e); - } - return status; - } - - @Override - public boolean modifyEnrollment(Device device) throws DeviceManagementException { - boolean status; - try { - if (log.isDebugEnabled()) { - log.debug("Modifying the Connected Cup device enrollment data"); - } - ConnectedCupDAOUtil.beginTransaction(); - status = CONNECTED_CUP_DAO_UTIL.getConnectedCupDeviceDAO().updateDevice(device); - ConnectedCupDAOUtil.commitTransaction(); - } catch (ConnectedCupDeviceMgtPluginException e) { - try { - ConnectedCupDAOUtil.rollbackTransaction(); - } catch (ConnectedCupDeviceMgtPluginException iotDAOEx) { - String msg = "Error occurred while roll back the update device transaction :" + device.toString(); - log.warn(msg, iotDAOEx); - } - String msg = "Error while updating the enrollment of the Connected Cup device : " + - device.getDeviceIdentifier(); - log.error(msg, e); - throw new DeviceManagementException(msg, e); - } - return status; - } - - @Override - public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException { - boolean status; - try { - if (log.isDebugEnabled()) { - log.debug("Dis-enrolling Connected Cup device : " + deviceId); - } - ConnectedCupDAOUtil.beginTransaction(); - status = CONNECTED_CUP_DAO_UTIL.getConnectedCupDeviceDAO().deleteDevice(deviceId.getId()); - ConnectedCupDAOUtil.commitTransaction(); - } catch (ConnectedCupDeviceMgtPluginException e) { - try { - ConnectedCupDAOUtil.rollbackTransaction(); - } catch (ConnectedCupDeviceMgtPluginException iotDAOEx) { - String msg = "Error occurred while roll back the device dis enrol transaction :" + deviceId.toString(); - log.warn(msg, iotDAOEx); - } - String msg = "Error while removing the Connected Cup device : " + deviceId.getId(); - log.error(msg, e); - throw new DeviceManagementException(msg, e); - } - return status; - } - - @Override - public boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException { - boolean isEnrolled = false; - try { - if (log.isDebugEnabled()) { - log.debug("Checking the enrollment of Connected Cup device : " + deviceId.getId()); - } - Device iotDevice = CONNECTED_CUP_DAO_UTIL.getConnectedCupDeviceDAO().getDevice(deviceId.getId()); - if (iotDevice != null) { - isEnrolled = true; - } - } catch (ConnectedCupDeviceMgtPluginException e) { - String msg = "Error while checking the enrollment status of Connected Cup device : " + - deviceId.getId(); - log.error(msg, e); - throw new DeviceManagementException(msg, e); - } - return isEnrolled; - } - - @Override - public boolean isActive(DeviceIdentifier deviceId) throws DeviceManagementException { - return true; - } - - @Override - public boolean setActive(DeviceIdentifier deviceId, boolean status) - throws DeviceManagementException { - return true; - } - - @Override - public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException { - Device device; - try {if (log.isDebugEnabled()) { - log.debug("Getting the details of Connected Cup device : " + deviceId.getId()); - } - device = CONNECTED_CUP_DAO_UTIL.getConnectedCupDeviceDAO().getDevice(deviceId.getId()); - - } catch (ConnectedCupDeviceMgtPluginException e) { - String msg = "Error while fetching the Connected Cup device : " + deviceId.getId(); - log.error(msg, e); - throw new DeviceManagementException(msg, e); - } - return device; - } - - @Override - public boolean setOwnership(DeviceIdentifier deviceId, String ownershipType) - throws DeviceManagementException { - return true; - } - - public boolean isClaimable(DeviceIdentifier deviceIdentifier) throws DeviceManagementException { - return false; - } - - @Override - public boolean setStatus(DeviceIdentifier deviceId, String currentOwner, - EnrolmentInfo.Status status) throws DeviceManagementException { - return false; - } - - @Override - public License getLicense(String s) throws LicenseManagementException { - return null; - } - - @Override - public void addLicense(License license) throws LicenseManagementException { - - } - - @Override - public boolean requireDeviceAuthorization() { - return false; - } - - @Override - public boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException { - boolean status; - try { - if (log.isDebugEnabled()) { - log.debug( - "updating the details of Connected Cup device : " + deviceIdentifier); - } - ConnectedCupDAOUtil.beginTransaction(); - status = CONNECTED_CUP_DAO_UTIL.getConnectedCupDeviceDAO().updateDevice(device); - ConnectedCupDAOUtil.commitTransaction(); - } catch (ConnectedCupDeviceMgtPluginException e) { - try { - ConnectedCupDAOUtil.rollbackTransaction(); - } catch (ConnectedCupDeviceMgtPluginException iotDAOEx) { - String msg = "Error occurred while roll back the update device info transaction :" + device.toString(); - log.warn(msg, iotDAOEx); - } - String msg = - "Error while updating the Connected Cup device : " + deviceIdentifier; - log.error(msg, e); - throw new DeviceManagementException(msg, e); - } - return status; - } - - @Override - public List getAllDevices() throws DeviceManagementException { - List devices = null; - try { - if (log.isDebugEnabled()) { - log.debug("Fetching the details of all Connected Cup devices"); - } - devices = CONNECTED_CUP_DAO_UTIL.getConnectedCupDeviceDAO().getAllDevices(); - } catch (ConnectedCupDeviceMgtPluginException e) { - String msg = "Error while fetching all Connected Cup devices."; - log.error(msg, e); - throw new DeviceManagementException(msg, e); - } - return devices; - } - -} \ No newline at end of file diff --git a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/ConnectedCupManagerService.java b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/ConnectedCupManagerService.java deleted file mode 100644 index 0f007334..00000000 --- a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/ConnectedCupManagerService.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you 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. - */ - -package org.coffeeking.connectedcup.plugin.impl; - -import org.coffeeking.connectedcup.plugin.constants.ConnectedCupConstants; -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; -import org.wso2.carbon.device.mgt.common.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.DeviceManager; -import org.wso2.carbon.device.mgt.common.ProvisioningConfig; -import org.wso2.carbon.device.mgt.common.app.mgt.Application; -import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; -import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; -import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; -import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig; -import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; - -import java.util.List; - -public class ConnectedCupManagerService implements DeviceManagementService{ - private DeviceManager deviceManager; - - @Override - public String getType() { - return ConnectedCupConstants.DEVICE_TYPE; - } - - @Override - public void init() throws DeviceManagementException { - this.deviceManager=new ConnectedCupManager(); - } - - @Override - public DeviceManager getDeviceManager() { - return deviceManager; - } - - @Override - public ApplicationManager getApplicationManager() { - return null; - } - - @Override - public ProvisioningConfig getProvisioningConfig() { - return new ProvisioningConfig("carbon.super", false); - } - - @Override - public PushNotificationConfig getPushNotificationConfig() { - return null; - } - -} diff --git a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/dao/ConnectedCupDAO.java b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/dao/ConnectedCupDAO.java deleted file mode 100644 index deb509cc..00000000 --- a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/dao/ConnectedCupDAO.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you 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. - */ - -package org.coffeeking.connectedcup.plugin.impl.dao; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.coffeeking.connectedcup.plugin.constants.ConnectedCupConstants; -import org.coffeeking.connectedcup.plugin.exception.ConnectedCupDeviceMgtPluginException; -import org.coffeeking.connectedcup.plugin.impl.dao.util.ConnectedCupUtils; -import org.wso2.carbon.device.mgt.common.Device; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -/** - * Device Dao for connected cup Devices. - */ -public class ConnectedCupDAO { - - - private static final Log log = LogFactory.getLog(ConnectedCupDAO.class); - - public Device getDevice(String deviceId) throws ConnectedCupDeviceMgtPluginException { - Connection conn = null; - PreparedStatement stmt = null; - Device connectedCupDevice = null; - ResultSet resultSet = null; - try { - conn = ConnectedCupDAOUtil.getConnection(); - String selectDBQuery = - "SELECT CONNECTED_CUP_DEVICE_ID, DEVICE_NAME FROM CONNECTED_CUP_DEVICE WHERE CONNECTED_CUP_DEVICE_ID = ?"; - stmt = conn.prepareStatement(selectDBQuery); - stmt.setString(1, deviceId); - resultSet = stmt.executeQuery(); - - if (resultSet.next()) { - connectedCupDevice = new Device(); - connectedCupDevice.setName(resultSet.getString(ConnectedCupConstants.DEVICE_PLUGIN_DEVICE_NAME)); - if (log.isDebugEnabled()) { - log.debug("Connected Cup service " + deviceId + " data has been fetched from" + - "Connected Cup database."); - } - } - } catch (SQLException e) { - String msg = "Error occurred while fetching Connected Cup device : '" + deviceId + "'"; - log.error(msg, e); - throw new ConnectedCupDeviceMgtPluginException(msg, e); - } finally { - ConnectedCupUtils.cleanupResources(stmt, resultSet); - ConnectedCupDAOUtil.closeConnection(); - } - return connectedCupDevice; - } - - - public boolean addDevice(Device connectedCupDevice) throws ConnectedCupDeviceMgtPluginException { - boolean status = false; - Connection conn = null; - PreparedStatement stmt = null; - try { - conn = ConnectedCupDAOUtil.getConnection(); - String createDBQuery = - "INSERT INTO CONNECTED_CUP_DEVICE(CONNECTED_CUP_DEVICE_ID, DEVICE_NAME ) VALUES (?, ?)"; - - stmt = conn.prepareStatement(createDBQuery); - stmt.setString(1, connectedCupDevice.getDeviceIdentifier()); - stmt.setString(2, connectedCupDevice.getName()); - - int rows = stmt.executeUpdate(); - if (rows > 0) { - status = true; - if (log.isDebugEnabled()) { - log.debug("Connected Cup device " + connectedCupDevice.getDeviceIdentifier() + - " data has been added to the Connected Cup database."); - } - } - } catch (SQLException e) { - String msg = "Error occurred while adding the Connected Cup device '" + - connectedCupDevice.getDeviceIdentifier() + "' to the Connected Cup db."; - log.error(msg, e); - throw new ConnectedCupDeviceMgtPluginException(msg, e); - } finally { - ConnectedCupUtils.cleanupResources(stmt, null); - } - return status; - } - - public boolean updateDevice(Device connectedCupDevice) throws ConnectedCupDeviceMgtPluginException { - boolean status = false; - Connection conn = null; - PreparedStatement stmt = null; - try { - conn = ConnectedCupDAOUtil.getConnection(); - String updateDBQuery = - "UPDATE CONNECTED_CUP_DEVICE SET DEVICE_NAME = ? WHERE CONNECTED_CUP_DEVICE_ID = ?"; - - stmt = conn.prepareStatement(updateDBQuery); - stmt.setString(1, connectedCupDevice.getName()); - stmt.setString(2, connectedCupDevice.getDeviceIdentifier()); - int rows = stmt.executeUpdate(); - if (rows > 0) { - status = true; - if (log.isDebugEnabled()) { - log.debug("Connected Cup device " + connectedCupDevice.getDeviceIdentifier() + - " data has been modified."); - } - } - } catch (SQLException e) { - String msg = "Error occurred while modifying the Connected Cup device '" + - connectedCupDevice.getDeviceIdentifier() + "' data."; - log.error(msg, e); - throw new ConnectedCupDeviceMgtPluginException(msg, e); - } finally { - ConnectedCupUtils.cleanupResources(stmt, null); - } - return status; - } - - public boolean deleteDevice(String deviceId) throws ConnectedCupDeviceMgtPluginException { - boolean status = false; - Connection conn = null; - PreparedStatement stmt = null; - try { - conn = ConnectedCupDAOUtil.getConnection(); - String deleteDBQuery = - "DELETE FROM CONNECTED_CUP_DEVICE WHERE CONNECTED_CUP_DEVICE_ID = ?"; - stmt = conn.prepareStatement(deleteDBQuery); - stmt.setString(1, deviceId); - int rows = stmt.executeUpdate(); - if (rows > 0) { - status = true; - if (log.isDebugEnabled()) { - log.debug("Connected Cup device " + deviceId + " data has deleted" + - " from the Connected Cup database."); - } - } - } catch (SQLException e) { - String msg = "Error occurred while deleting Connected Cup device " + deviceId; - log.error(msg, e); - throw new ConnectedCupDeviceMgtPluginException(msg, e); - } finally { - ConnectedCupUtils.cleanupResources(stmt, null); - } - return status; - } - - public List getAllDevices() throws ConnectedCupDeviceMgtPluginException { - - Connection conn = null; - PreparedStatement stmt = null; - ResultSet resultSet = null; - Device connectedCupDevice; - List iotDevices = new ArrayList<>(); - - try { - conn = ConnectedCupDAOUtil.getConnection(); - String selectDBQuery = - "SELECT CONNECTED_CUP_DEVICE_ID, DEVICE_NAME" + - "FROM CONNECTED_CUP_DEVICE"; - stmt = conn.prepareStatement(selectDBQuery); - resultSet = stmt.executeQuery(); - while (resultSet.next()) { - connectedCupDevice = new Device(); - connectedCupDevice.setDeviceIdentifier(resultSet.getString( - ConnectedCupConstants.DEVICE_PLUGIN_DEVICE_ID)); - connectedCupDevice.setName(resultSet.getString( - ConnectedCupConstants.DEVICE_PLUGIN_DEVICE_NAME)); - } - if (log.isDebugEnabled()) { - log.debug("All Connected Cup device details have fetched from Connected Cup database" + - "."); - } - return iotDevices; - } catch (SQLException e) { - String msg = "Error occurred while fetching all Connected Cup device data'"; - log.error(msg, e); - throw new ConnectedCupDeviceMgtPluginException(msg, e); - } finally { - ConnectedCupUtils.cleanupResources(stmt, resultSet); - ConnectedCupDAOUtil.closeConnection(); - } - - } - -} \ No newline at end of file diff --git a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/dao/ConnectedCupDAOUtil.java b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/dao/ConnectedCupDAOUtil.java deleted file mode 100644 index 4daa8569..00000000 --- a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/dao/ConnectedCupDAOUtil.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you 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. - */ - -package org.coffeeking.connectedcup.plugin.impl.dao; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.coffeeking.connectedcup.plugin.constants.ConnectedCupConstants; -import org.coffeeking.connectedcup.plugin.exception.ConnectedCupDeviceMgtPluginException; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.SQLException; - -public class ConnectedCupDAOUtil { - - private static final Log log = LogFactory.getLog(ConnectedCupDAOUtil.class); - static DataSource dataSource; - private static ThreadLocal currentConnection = new ThreadLocal(); - - public ConnectedCupDAOUtil() { - initConnectedCupDAO(); - } - - public static void initConnectedCupDAO() { - try { - Context ctx = new InitialContext(); - dataSource = (DataSource) ctx.lookup(ConnectedCupConstants.DATA_SOURCE_NAME); - } catch (NamingException e) { - log.error("Error while looking up the data source: " + - ConnectedCupConstants.DATA_SOURCE_NAME); - } - - } - - - public ConnectedCupDAO getConnectedCupDeviceDAO() { - return new ConnectedCupDAO(); - } - - public static void beginTransaction() throws ConnectedCupDeviceMgtPluginException { - try { - Connection conn = dataSource.getConnection(); - conn.setAutoCommit(false); - currentConnection.set(conn); - } catch (SQLException e) { - throw new ConnectedCupDeviceMgtPluginException( - "Error occurred while retrieving datasource connection", e); - } - } - - public static Connection getConnection() throws ConnectedCupDeviceMgtPluginException { - if (currentConnection.get() == null) { - try { - currentConnection.set(dataSource.getConnection()); - } catch (SQLException e) { - throw new ConnectedCupDeviceMgtPluginException( - "Error occurred while retrieving data source connection", e); - } - } - return currentConnection.get(); - } - - public static void commitTransaction() throws ConnectedCupDeviceMgtPluginException { - try { - Connection conn = currentConnection.get(); - if (conn != null) { - conn.commit(); - } else { - if (log.isDebugEnabled()) { - log.debug("Datasource connection associated with the current thread is null, " + - "hence commit has not been attempted"); - } - } - } catch (SQLException e) { - throw new ConnectedCupDeviceMgtPluginException( - "Error occurred while committing the transaction", e); - } finally { - closeConnection(); - } - } - - public static void closeConnection() throws ConnectedCupDeviceMgtPluginException { - - Connection con = currentConnection.get(); - if (con != null) { - try { - con.close(); - } catch (SQLException e) { - log.error("Error occurred while close the connection"); - } - } - currentConnection.remove(); - } - - public static void rollbackTransaction() throws ConnectedCupDeviceMgtPluginException { - try { - Connection conn = currentConnection.get(); - if (conn != null) { - conn.rollback(); - } else { - if (log.isDebugEnabled()) { - log.debug( - "Datasource connection associated with the current thread is null, " + - "hence rollback has not been attempted"); - } - } - } catch (SQLException e) { - throw new ConnectedCupDeviceMgtPluginException("Error occurred while rollback the transaction", e); - } finally { - closeConnection(); - } - } -} \ No newline at end of file diff --git a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/dao/util/ConnectedCupUtils.java b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/dao/util/ConnectedCupUtils.java deleted file mode 100644 index 9c25f256..00000000 --- a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/impl/dao/util/ConnectedCupUtils.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you 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. - */ - -package org.coffeeking.connectedcup.plugin.impl.dao.util; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.common.Device; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.List; -import java.util.Map; - -/** - * Contains utility methods used by FireAlarm plugin. - */ -public class ConnectedCupUtils { - - private static Log log = LogFactory.getLog(ConnectedCupUtils.class); - - public static String getDeviceProperty(List deviceProperties, String propertyKey) { - String deviceProperty = ""; - for (Device.Property property : deviceProperties) { - if (propertyKey.equals(property.getName())) { - deviceProperty = property.getValue(); - } - } - return deviceProperty; - } - - public static Device.Property getProperty(String property, String value) { - if (property != null) { - Device.Property prop = new Device.Property(); - prop.setName(property); - prop.setValue(value); - return prop; - } - return null; - } - - public static void cleanupResources(Connection conn, PreparedStatement stmt, ResultSet rs) { - if (rs != null) { - try { - rs.close(); - } catch (SQLException e) { - log.warn("Error occurred while closing result set", e); - } - } - if (stmt != null) { - try { - stmt.close(); - } catch (SQLException e) { - log.warn("Error occurred while closing prepared statement", e); - } - } - if (conn != null) { - try { - conn.close(); - } catch (SQLException e) { - log.warn("Error occurred while closing database connection", e); - } - } - } - - public static void cleanupResources(PreparedStatement stmt, ResultSet rs) { - cleanupResources(null, stmt, rs); - } - - -} diff --git a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/internal/ConnectedCupServiceComponent.java b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/internal/ConnectedCupServiceComponent.java deleted file mode 100644 index 6b6f00bd..00000000 --- a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/internal/ConnectedCupServiceComponent.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you 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. - */ - -package org.coffeeking.connectedcup.plugin.internal; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.coffeeking.connectedcup.plugin.impl.ConnectedCupManagerService; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; -import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; - -/** - * @scr.component name="org.coffeeking.connectedcup.plugin.internal - * .ConnectedCupServiceComponent" - * immediate="true" - */ - -public class ConnectedCupServiceComponent { - private static final Log log = LogFactory.getLog(ConnectedCupServiceComponent.class); - private ServiceRegistration connectedCupServiceRegRef; - - protected void activate(ComponentContext ctx) { - if (log.isDebugEnabled()) { - log.debug("Activating Connected Cup Service Component"); - } - try { - BundleContext bundleContext = ctx.getBundleContext(); - connectedCupServiceRegRef = - bundleContext.registerService(DeviceManagementService.class.getName(), - new ConnectedCupManagerService(), null); - - if (log.isDebugEnabled()) { - log.debug("Connected Cup Service Component has been successfully activated"); - } - } catch (Throwable e) { - log.error("Error occurred while activating Connected Cup Service Component", e); - } - } - - protected void deactivate(ComponentContext ctx) { - if (log.isDebugEnabled()) { - log.debug("De-activating Connected Cup Service Component"); - } - try { - if (connectedCupServiceRegRef != null) { - connectedCupServiceRegRef.unregister(); - } - - if (log.isDebugEnabled()) { - log.debug("Connected Cup Service Component has been successfully de-activated"); - } - } catch (Throwable e) { - log.error("Error occurred while de-activating Connected Cup Service Component", e); - } - } - -} diff --git a/modules/samples/connectedcup/component/pom.xml b/modules/samples/connectedcup/component/pom.xml index 9342d155..20ef83f7 100644 --- a/modules/samples/connectedcup/component/pom.xml +++ b/modules/samples/connectedcup/component/pom.xml @@ -38,7 +38,6 @@ analytics - plugin api agent ui diff --git a/modules/samples/connectedcup/feature/connectedcup-feature/pom.xml b/modules/samples/connectedcup/feature/connectedcup-feature/pom.xml index 71b9b925..b177023e 100644 --- a/modules/samples/connectedcup/feature/connectedcup-feature/pom.xml +++ b/modules/samples/connectedcup/feature/connectedcup-feature/pom.xml @@ -38,11 +38,6 @@ http://wso2.org - - org.coffeeking - org.coffeeking.connectedcup.plugin - ${wso2.iot.version} - org.coffeeking org.coffeeking.connectedcup.api @@ -55,11 +50,6 @@ ${wso2.iot.version} war - - com.h2database.wso2 - h2-database-engine - 1.2.140.wso2v3 - @@ -158,46 +148,6 @@ - - org.apache.maven.plugins - maven-antrun-plugin - - - - create-connected-cup-plugin-mgt-schema - package - - run - - - - - - - - - - - - - - - - - - - - - - - - - org.wso2.maven carbon-p2-plugin @@ -217,11 +167,6 @@ org.eclipse.equinox.p2.type.group:true - - - org.coffeeking:org.coffeeking.connectedcup.plugin:${wso2.iot.version} - - org.wso2.carbon.core.server:${carbon.kernel.version} diff --git a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/configs/connectedcup.xml b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/configs/connectedcup.xml deleted file mode 100644 index 8d70e4d0..00000000 --- a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/configs/connectedcup.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - jdbc/ConnectedCupDM_DB - - - diff --git a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/datasources/connectedcup-datasources.xml b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/datasources/connectedcup-datasources.xml deleted file mode 100644 index 893a91c0..00000000 --- a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/datasources/connectedcup-datasources.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - ConnectedCupDM_DB - The datasource used for the Connected Cup database - - jdbc/ConnectedCupDM_DB - - - - jdbc:h2:repository/database/ConnectedCupDM_DB;DB_CLOSE_ON_EXIT=FALSE - - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - diff --git a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/dbscripts/h2.sql b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/dbscripts/h2.sql deleted file mode 100644 index afa2ad8a..00000000 --- a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/dbscripts/h2.sql +++ /dev/null @@ -1,11 +0,0 @@ - --- ----------------------------------------------------- --- Table `CONNECTED_CUP_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `CONNECTED_CUP_DEVICE` ( - `CONNECTED_CUP_DEVICE_ID` VARCHAR(45) NOT NULL , - `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (`CONNECTED_CUP_DEVICE_ID`) ); - - - diff --git a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/dbscripts/mysql.sql b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/dbscripts/mysql.sql deleted file mode 100644 index 64560fc3..00000000 --- a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/dbscripts/mysql.sql +++ /dev/null @@ -1,12 +0,0 @@ --- ----------------------------------------------------- --- Table `CONNECTED_CUP_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `CONNECTED_CUP_DEVICE` ( - `CONNECTED_CUP_DEVICE_ID` VARCHAR(45) NOT NULL , - `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (`CONNECTED_CUP_DEVICE_ID`) ) -ENGINE = InnoDB; - - - - diff --git a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/devicetypes/connectedcup.xml b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/devicetypes/connectedcup.xml new file mode 100644 index 00000000..f8f178f9 --- /dev/null +++ b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/devicetypes/connectedcup.xml @@ -0,0 +1,38 @@ + + + + + connectedcup + + + + + en_US + 1.0.0 + This is license text + + + + + + + false + + + diff --git a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/p2.inf b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/p2.inf index 68abddb2..7837721e 100644 --- a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/p2.inf +++ b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/p2.inf @@ -1,26 +1,18 @@ instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../conf/device-types/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.coffeeking.connectedcup_${feature.version}/configs/,target:${installFolder}/../../conf/device-types/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/webapps/);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.coffeeking.connectedcup_${feature.version}/webapps/,target:${installFolder}/../../deployment/server/webapps/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.coffeeking.connectedcup_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.coffeeking.connectedcup_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/connectedcup,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.coffeeking.connectedcup_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/jaggeryapps/);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.coffeeking.connectedcup_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../database/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.coffeeking.connectedcup_${feature.version}/database/,target:${installFolder}/../../database/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.connectedcup_${feature.version}/devicetypes/,target:${installFolder}/../../deployment/server/devicetypes/,overwrite:true);\ instructions.unconfigure = \ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/device-types/connectedcup.xml);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/connectedcup.war);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/connected-cup-agent.war);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/connectedcup);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/connected-cup-agent);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/connectedcup);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/datasources/connectedcup-datasources.xml);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../database/ConnectedCupDM_DB.h2.db);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.device-view);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.type-view);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view);\ diff --git a/modules/samples/connectedcup/pom.xml b/modules/samples/connectedcup/pom.xml index ea0d1512..2a77321c 100644 --- a/modules/samples/connectedcup/pom.xml +++ b/modules/samples/connectedcup/pom.xml @@ -135,12 +135,6 @@ 4.1 provided - - org.coffeeking - org.coffeeking.connectedcup.plugin - ${wso2.iot.version} - provided - org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.webapp.publisher @@ -372,8 +366,8 @@ 4.4.3 - 1.2.3-SNAPSHOT - 2.2.3-SNAPSHOT + 1.2.6-SNAPSHOT + 2.2.5-SNAPSHOT 1.0.2 3.0.0.wso2v1 @@ -388,7 +382,7 @@ 3.1.0.wso2v2 3.0.0.wso2v1 3.6.100.v20120522-1841 - 1.0.6-ALPHA + 1.2.8 1.0.0-SNAPSHOT diff --git a/modules/samples/installer/device-deployer.xml b/modules/samples/installer/device-deployer.xml index 8f8f40f0..102218ae 100644 --- a/modules/samples/installer/device-deployer.xml +++ b/modules/samples/installer/device-deployer.xml @@ -27,7 +27,7 @@ 4.0.0 org.wso2.iot.devicemgt-plugins devicetype-feature-installation - 1.0.0-SNAPSHOT + ${product.version} pom Creating custom distribution http://wso2.org @@ -35,7 +35,6 @@ samples/connectedcup - samples/connectedlap @@ -60,10 +59,7 @@ - org.coffeeking:org.coffeeking.connectedcup.feature:1.0.0-SNAPSHOT - - - org.wso2:org.wso2.connectedlap.feature:1.0.0-SNAPSHOT + org.coffeeking:org.coffeeking.connectedcup.feature:${product.version} @@ -91,11 +87,7 @@ org.coffeeking.connectedcup.feature.group - 1.0.0-SNAPSHOT - - - org.wso2.connectedlap.feature.group - 1.0.0-SNAPSHOT + ${product.version} @@ -115,11 +107,7 @@ org.coffeeking.connectedcup.feature.group - 1.0.0-SNAPSHOT - - - org.wso2.connectedlap.feature.group - 1.0.0-SNAPSHOT + ${product.version} diff --git a/pom.xml b/pom.xml index 2e68bbe7..b5fda535 100644 --- a/pom.xml +++ b/pom.xml @@ -1100,7 +1100,7 @@ 1.0.0-SNAPSHOT - 2.2.4-SNAPSHOT + 2.2.5-SNAPSHOT 6.0.5 @@ -1185,7 +1185,7 @@ 1.0.2 - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT