From 9c12a2c4a0b6efe61378cc3688dcc4d8b45c0e4d Mon Sep 17 00:00:00 2001 From: ayyoob Date: Sun, 8 Jan 2017 21:29:28 +0530 Subject: [PATCH] changed default h2 port to 9095 --- modules/analytics/distribution/ds_config.xml | 2 +- .../conf/datasources/master-datasources.xml | 2 +- .../resources/devicetypes/connectedcup.xml | 38 ------------------- .../connectedcup/component/api/pom.xml | 21 +++++++++- .../api/ConnectedCupServiceImpl.java | 2 +- .../api/exception/ConnectedCupException.java | 0 .../java/org/coffeeking/api/util/APIUtil.java | 5 ++- .../org/coffeeking/api/util/SensorRecord.java | 0 .../src/main/webapp/META-INF/permissions.xml | 0 .../webapp/META-INF/webapp-classloading.xml | 0 .../src/main/webapp/WEB-INF/cxf-servlet.xml | 0 .../api/src/main/webapp/WEB-INF/web.xml | 0 .../constants/ConnectedCupConstants.java | 2 +- .../main/resources/configs/connectedcup.xml | 25 ++++++++++++ 14 files changed, 51 insertions(+), 46 deletions(-) delete mode 100644 modules/core/distribution/src/samples/connectedcup/feature/connectedcup-feature/src/main/resources/devicetypes/connectedcup.xml rename modules/{core/distribution/src => distribution/src/resources}/samples/connectedcup/component/api/pom.xml (87%) rename modules/{core/distribution/src => distribution/src/resources}/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java (98%) rename modules/{core/distribution/src => distribution/src/resources}/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/exception/ConnectedCupException.java (100%) rename modules/{core/distribution/src => distribution/src/resources}/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java (98%) rename modules/{core/distribution/src => distribution/src/resources}/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/SensorRecord.java (100%) rename modules/{core/distribution/src => distribution/src/resources}/samples/connectedcup/component/api/src/main/webapp/META-INF/permissions.xml (100%) rename modules/{core/distribution/src => distribution/src/resources}/samples/connectedcup/component/api/src/main/webapp/META-INF/webapp-classloading.xml (100%) rename modules/{core/distribution/src => distribution/src/resources}/samples/connectedcup/component/api/src/main/webapp/WEB-INF/cxf-servlet.xml (100%) rename modules/{core/distribution/src => distribution/src/resources}/samples/connectedcup/component/api/src/main/webapp/WEB-INF/web.xml (100%) rename modules/{core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api => distribution/src/resources/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin}/constants/ConnectedCupConstants.java (96%) create mode 100644 modules/distribution/src/resources/samples/connectedcup/feature/connectedcup-feature/src/main/resources/configs/connectedcup.xml diff --git a/modules/analytics/distribution/ds_config.xml b/modules/analytics/distribution/ds_config.xml index 90800a3c..c1d5903e 100644 --- a/modules/analytics/distribution/ds_config.xml +++ b/modules/analytics/distribution/ds_config.xml @@ -29,7 +29,7 @@ - jdbc:h2:../core/repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE;AUTO_SERVER_PORT=9090 + jdbc:h2:../core/repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE;AUTO_SERVER_PORT=9095 wso2carbon wso2carbon org.h2.Driver diff --git a/modules/core/distribution/src/repository/conf/datasources/master-datasources.xml b/modules/core/distribution/src/repository/conf/datasources/master-datasources.xml index 24495944..ec22c8a6 100755 --- a/modules/core/distribution/src/repository/conf/datasources/master-datasources.xml +++ b/modules/core/distribution/src/repository/conf/datasources/master-datasources.xml @@ -30,7 +30,7 @@ - jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE;AUTO_SERVER_PORT=9090 + jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE;AUTO_SERVER_PORT=9095 wso2carbon wso2carbon org.h2.Driver diff --git a/modules/core/distribution/src/samples/connectedcup/feature/connectedcup-feature/src/main/resources/devicetypes/connectedcup.xml b/modules/core/distribution/src/samples/connectedcup/feature/connectedcup-feature/src/main/resources/devicetypes/connectedcup.xml deleted file mode 100644 index f8f178f9..00000000 --- a/modules/core/distribution/src/samples/connectedcup/feature/connectedcup-feature/src/main/resources/devicetypes/connectedcup.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - connectedcup - - - - - en_US - 1.0.0 - This is license text - - - - - - - false - - - diff --git a/modules/core/distribution/src/samples/connectedcup/component/api/pom.xml b/modules/distribution/src/resources/samples/connectedcup/component/api/pom.xml similarity index 87% rename from modules/core/distribution/src/samples/connectedcup/component/api/pom.xml rename to modules/distribution/src/resources/samples/connectedcup/component/api/pom.xml index 3497b109..b248b5cb 100644 --- a/modules/core/distribution/src/samples/connectedcup/component/api/pom.xml +++ b/modules/distribution/src/resources/samples/connectedcup/component/api/pom.xml @@ -23,13 +23,13 @@ device-mgt-iot-connectedcup org.coffeeking - 1.0.0-SNAPSHOT + 1.0.0 ../pom.xml 4.0.0 org.coffeeking.connectedcup.api - 1.0.0-SNAPSHOT + 1.0.0 war WSO2 IoTS(Device Types) - Connected Cup API WSO2 IoTS(Device Types) - Connected Cup API @@ -71,6 +71,13 @@ provided + + + org.eclipse.paho + org.eclipse.paho.client.mqttv3 + provided + + org.apache.httpcomponents @@ -78,6 +85,11 @@ 4.1 provided + + org.coffeeking + org.coffeeking.connectedcup.plugin + provided + @@ -99,6 +111,11 @@ 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/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java b/modules/distribution/src/resources/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java similarity index 98% rename from modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java rename to modules/distribution/src/resources/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java index f257d400..b20e11a2 100644 --- a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java +++ b/modules/distribution/src/resources/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java @@ -20,9 +20,9 @@ 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.SortByField; import org.wso2.carbon.analytics.dataservice.commons.SortType; import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; diff --git a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/exception/ConnectedCupException.java b/modules/distribution/src/resources/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/exception/ConnectedCupException.java similarity index 100% rename from modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/exception/ConnectedCupException.java rename to modules/distribution/src/resources/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/exception/ConnectedCupException.java diff --git a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java b/modules/distribution/src/resources/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java similarity index 98% rename from modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java rename to modules/distribution/src/resources/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java index a6266eb3..65ee31e6 100644 --- a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java +++ b/modules/distribution/src/resources/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java @@ -21,10 +21,10 @@ package org.coffeeking.api.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.analytics.api.AnalyticsDataAPI; +import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil; import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; import org.wso2.carbon.analytics.dataservice.commons.SortByField; -import org.wso2.carbon.analytics.dataservice.core.AnalyticsDataServiceUtils; import org.wso2.carbon.analytics.datasource.commons.Record; import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; import org.wso2.carbon.context.CarbonContext; @@ -96,12 +96,13 @@ public class APIUtil { sortByFields); List recordIds = getRecordIds(resultEntries); AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, null, recordIds); - Map sensorDatas = createSensorData(AnalyticsDataServiceUtils.listRecords( + Map sensorDatas = createSensorData(AnalyticsDataAPIUtil.listRecords( analyticsDataAPI, response)); List sortedSensorData = getSortedSensorData(sensorDatas, resultEntries); return sortedSensorData; } + private static List getRecordIds(List searchResults) { List ids = new ArrayList<>(); for (SearchResultEntry searchResult : searchResults) { diff --git a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/SensorRecord.java b/modules/distribution/src/resources/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/SensorRecord.java similarity index 100% rename from modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/SensorRecord.java rename to modules/distribution/src/resources/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/SensorRecord.java diff --git a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/webapp/META-INF/permissions.xml b/modules/distribution/src/resources/samples/connectedcup/component/api/src/main/webapp/META-INF/permissions.xml similarity index 100% rename from modules/core/distribution/src/samples/connectedcup/component/api/src/main/webapp/META-INF/permissions.xml rename to modules/distribution/src/resources/samples/connectedcup/component/api/src/main/webapp/META-INF/permissions.xml diff --git a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/webapp/META-INF/webapp-classloading.xml b/modules/distribution/src/resources/samples/connectedcup/component/api/src/main/webapp/META-INF/webapp-classloading.xml similarity index 100% rename from modules/core/distribution/src/samples/connectedcup/component/api/src/main/webapp/META-INF/webapp-classloading.xml rename to modules/distribution/src/resources/samples/connectedcup/component/api/src/main/webapp/META-INF/webapp-classloading.xml diff --git a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/webapp/WEB-INF/cxf-servlet.xml b/modules/distribution/src/resources/samples/connectedcup/component/api/src/main/webapp/WEB-INF/cxf-servlet.xml similarity index 100% rename from modules/core/distribution/src/samples/connectedcup/component/api/src/main/webapp/WEB-INF/cxf-servlet.xml rename to modules/distribution/src/resources/samples/connectedcup/component/api/src/main/webapp/WEB-INF/cxf-servlet.xml diff --git a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/webapp/WEB-INF/web.xml b/modules/distribution/src/resources/samples/connectedcup/component/api/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from modules/core/distribution/src/samples/connectedcup/component/api/src/main/webapp/WEB-INF/web.xml rename to modules/distribution/src/resources/samples/connectedcup/component/api/src/main/webapp/WEB-INF/web.xml diff --git a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/constants/ConnectedCupConstants.java b/modules/distribution/src/resources/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/constants/ConnectedCupConstants.java similarity index 96% rename from modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/constants/ConnectedCupConstants.java rename to modules/distribution/src/resources/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/constants/ConnectedCupConstants.java index 05201c09..b1b71488 100644 --- a/modules/core/distribution/src/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/constants/ConnectedCupConstants.java +++ b/modules/distribution/src/resources/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/constants/ConnectedCupConstants.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.coffeeking.api.constants; +package org.coffeeking.connectedcup.plugin.constants; public class ConnectedCupConstants { diff --git a/modules/distribution/src/resources/samples/connectedcup/feature/connectedcup-feature/src/main/resources/configs/connectedcup.xml b/modules/distribution/src/resources/samples/connectedcup/feature/connectedcup-feature/src/main/resources/configs/connectedcup.xml new file mode 100644 index 00000000..8d70e4d0 --- /dev/null +++ b/modules/distribution/src/resources/samples/connectedcup/feature/connectedcup-feature/src/main/resources/configs/connectedcup.xml @@ -0,0 +1,25 @@ + + + + + + jdbc/ConnectedCupDM_DB + + +