diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
index 6c8f275556..0f23492eda 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
@@ -22,13 +22,13 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.annotations
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
bundle
WSO2 Carbon - API Management Annotations
WSO2 Carbon - API Management Custom Annotation Module
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
index f6b96db523..220e24581a 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
@@ -21,12 +21,12 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
4.0.0
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
org.wso2.carbon.apimgt.application.extension.api
war
WSO2 Carbon - API Application Management API
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
index 893bd9969d..8cd5a42506 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
@@ -22,12 +22,12 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
4.0.0
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
org.wso2.carbon.apimgt.application.extension
bundle
WSO2 Carbon - API Application Management
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml
index 3194629542..fbf325db15 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml
@@ -21,13 +21,13 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.handlers
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
bundle
WSO2 Carbon - API Security Handler Component
WSO2 Carbon - API Management Security Handler Module
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml
index 606ed6f78a..842f0e6bfe 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml
@@ -13,13 +13,13 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.integration.client
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
bundle
WSO2 Carbon - API Management Integration Client
WSO2 Carbon - API Management Integration Client
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml
index 3cba44b0da..31adc6fde5 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml
@@ -13,13 +13,13 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.integration.generated.client
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
bundle
WSO2 Carbon - API Management Integration Generated Client
WSO2 Carbon - API Management Integration Client
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml
index e091aeda13..cee4587b91 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml
@@ -22,13 +22,13 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.webapp.publisher
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
bundle
WSO2 Carbon - API Management Webapp Publisher
WSO2 Carbon - API Management Webapp Publisher
diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml
index ab973e9fc9..119693a8c8 100644
--- a/components/apimgt-extensions/pom.xml
+++ b/components/apimgt-extensions/pom.xml
@@ -22,13 +22,13 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../../pom.xml
4.0.0
apimgt-extensions
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
pom
WSO2 Carbon - API Management Extensions Component
http://wso2.org
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
index 4070a56c11..2bc513dbe8 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
@@ -22,7 +22,7 @@
certificate-mgt
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
index 515f30007b..70eead145a 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
@@ -22,7 +22,7 @@
certificate-mgt
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
index 6da29baaae..dec884436c 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
@@ -21,13 +21,13 @@
org.wso2.carbon.devicemgt
certificate-mgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.certificate.mgt.core
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
bundle
WSO2 Carbon - Certificate Management Core
WSO2 Carbon - Certificate Management Core
diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml
index e4fe363856..f360b55bbe 100644
--- a/components/certificate-mgt/pom.xml
+++ b/components/certificate-mgt/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../../pom.xml
4.0.0
org.wso2.carbon.devicemgt
certificate-mgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
pom
WSO2 Carbon - Certificate Management Component
http://wso2.org
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
index e4e84d91a1..f649963aa8 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml
index 007305061e..05c100dbd4 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml
index 0b6f9c2f0f..ecfd3e1276 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml
index b9256ef3b8..7cc0b1213d 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
index 12527b4be0..4e8aa8ee60 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
index edfc9fa1aa..451a1d6515 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml
index d02cb5774f..34a7bec6a1 100644
--- a/components/device-mgt-extensions/pom.xml
+++ b/components/device-mgt-extensions/pom.xml
@@ -22,7 +22,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml
index 7319b23d06..64d2f9dfbc 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml
@@ -3,7 +3,7 @@
org.wso2.carbon.devicemgt
device-mgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml
index 90a0410853..f4657a1210 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
index ca3cdf9b0f..dd86262e54 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
@@ -22,7 +22,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java
similarity index 95%
rename from components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoService.java
rename to components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java
index 7f34536ede..094781fe79 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoService.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java
@@ -68,15 +68,21 @@ import javax.ws.rs.core.Response;
@Scope(
name = "View Analytics",
description = "",
- key = "perm:geo-service:analytics",
- permissions = {"/device-mgt/devices/owning-device/analytics"}
+ key = "perm:geo-service:analytics-view",
+ permissions = {"/device-mgt/devices/owning-device/view-analytics"}
+ ),
+ @Scope(
+ name = "Manage Alerts",
+ description = "",
+ key = "perm:geo-service:alerts-manage",
+ permissions = {"/device-mgt/devices/owning-device/manage-alerts"}
)
}
)
@Path("/geo-services")
@Api(value = "Geo Service",
description = "This carries all the resources related to the geo service functionalities.")
-public interface GeoService {
+public interface GeoLocationBasedService {
/**
* Retrieve Analytics for the device type
*/
@@ -92,7 +98,7 @@ public interface GeoService {
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics")
+ @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics-view")
})
}
)
@@ -161,7 +167,7 @@ public interface GeoService {
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics")
+ @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
})
}
)
@@ -226,7 +232,7 @@ public interface GeoService {
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics")
+ @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
})
}
)
@@ -291,7 +297,7 @@ public interface GeoService {
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics")
+ @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
})
}
)
@@ -355,7 +361,7 @@ public interface GeoService {
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics")
+ @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
})
}
)
@@ -400,8 +406,8 @@ public interface GeoService {
String deviceType,
@ApiParam(
name = "from",
- value = "Get stats from what time",
- required = true)
+ value = "Get stats from what time",
+ required = true)
@QueryParam("from") long from,
@ApiParam(
name = "to",
@@ -415,13 +421,13 @@ public interface GeoService {
consumes = "application/json",
produces = "application/json",
httpMethod = "DELETE",
- value = "Create Geo alerts for the device",
+ value = "Deletes Geo alerts for the device",
notes = "",
response = Response.class,
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics")
+ @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
})
}
)
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java
similarity index 94%
rename from components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoServiceImpl.java
rename to components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java
index b81df06d52..04bfeff0d7 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoServiceImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java
@@ -35,11 +35,12 @@ import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorization
import org.wso2.carbon.device.mgt.common.geo.service.Alert;
import org.wso2.carbon.device.mgt.common.geo.service.Event;
import org.wso2.carbon.device.mgt.common.geo.service.GeoFence;
-import org.wso2.carbon.device.mgt.common.geo.service.GeoServiceException;
+import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService;
+import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationBasedServiceException;
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig;
-import org.wso2.carbon.device.mgt.jaxrs.service.api.GeoService;
+import org.wso2.carbon.device.mgt.jaxrs.service.api.GeoLocationBasedService;
import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils;
import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtUtil;
@@ -64,9 +65,9 @@ import java.util.Map;
/**
* The api for
*/
-public class GeoServiceImpl implements GeoService {
+public class GeoLocationBasedServiceImpl implements GeoLocationBasedService {
- private static Log log = LogFactory.getLog(GeoServiceImpl.class);
+ private static Log log = LogFactory.getLog(GeoLocationBasedServiceImpl.class);
@Path("stats/{deviceType}/{deviceId}")
@GET
@@ -149,10 +150,10 @@ public class GeoServiceImpl implements GeoService {
identifier.setId(deviceId);
identifier.setType(deviceType);
- org.wso2.carbon.device.mgt.common.geo.service.GeoService geoService = DeviceMgtAPIUtils.getGeoService();
+ GeoLocationProviderService geoService = DeviceMgtAPIUtils.getGeoService();
geoService.createGeoAlert(alert, identifier, alertType);
return Response.ok().build();
- } catch (DeviceAccessAuthorizationException | GeoServiceException e) {
+ } catch (DeviceAccessAuthorizationException | GeoLocationBasedServiceException e) {
String error = "Error occurred while creating the geo alert for " + deviceType + " with id: " + deviceId;
log.error(error, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(error).build();
@@ -182,10 +183,10 @@ public class GeoServiceImpl implements GeoService {
identifier.setId(deviceId);
identifier.setType(deviceType);
- org.wso2.carbon.device.mgt.common.geo.service.GeoService geoService = DeviceMgtAPIUtils.getGeoService();
+ GeoLocationProviderService geoService = DeviceMgtAPIUtils.getGeoService();
geoService.updateGeoAlert(alert, identifier, alertType);
return Response.ok().build();
- } catch (DeviceAccessAuthorizationException | GeoServiceException e) {
+ } catch (DeviceAccessAuthorizationException | GeoLocationBasedServiceException e) {
String error = "Error occurred while creating the geo alert for " + deviceType + " with id: " + deviceId;
log.error(error, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(error).build();
@@ -216,10 +217,10 @@ public class GeoServiceImpl implements GeoService {
identifier.setId(deviceId);
identifier.setType(deviceType);
- org.wso2.carbon.device.mgt.common.geo.service.GeoService geoService = DeviceMgtAPIUtils.getGeoService();
+ GeoLocationProviderService geoService = DeviceMgtAPIUtils.getGeoService();
geoService.removeGeoAlert(alertType, identifier, queryName);
return Response.ok().build();
- } catch (DeviceAccessAuthorizationException | GeoServiceException e) {
+ } catch (DeviceAccessAuthorizationException | GeoLocationBasedServiceException e) {
String error = "Error occurred while removing the geo alert for " + deviceType + " with id: " + deviceId;
log.error(error, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(error).build();
@@ -249,7 +250,7 @@ public class GeoServiceImpl implements GeoService {
identifier.setId(deviceId);
identifier.setType(deviceType);
- org.wso2.carbon.device.mgt.common.geo.service.GeoService geoService = DeviceMgtAPIUtils.getGeoService();
+ GeoLocationProviderService geoService = DeviceMgtAPIUtils.getGeoService();
if (GeoServices.ALERT_TYPE_WITHIN.equals(alertType)) {
List alerts = geoService.getWithinAlerts(identifier);
@@ -271,7 +272,7 @@ public class GeoServiceImpl implements GeoService {
return Response.ok().entity(alerts).build();
}
return null;
- } catch (DeviceAccessAuthorizationException | GeoServiceException e) {
+ } catch (DeviceAccessAuthorizationException | GeoLocationBasedServiceException e) {
String error = "Error occurred while getting the geo alerts for " + deviceType + " with id: " + deviceId;
log.error(error, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(error).build();
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
index 2df2daba39..8b12b4a285 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
@@ -44,7 +44,7 @@ import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorization
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService;
-import org.wso2.carbon.device.mgt.common.geo.service.GeoService;
+import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService;
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService;
import org.wso2.carbon.device.mgt.common.spi.DeviceTypeGeneratorService;
import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService;
@@ -427,9 +427,10 @@ public class DeviceMgtAPIUtils {
return gadgetDataService;
}
- public static GeoService getGeoService() {
+ public static GeoLocationProviderService getGeoService() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
- GeoService geoService = (GeoService) ctx.getOSGiService(GeoService.class, null);
+ GeoLocationProviderService
+ geoService = (GeoLocationProviderService) ctx.getOSGiService(GeoLocationProviderService.class, null);
if (geoService == null) {
throw new IllegalStateException("Geo Service has not been initialized.");
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml
index b59be7cf4f..572b64922b 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml
@@ -80,7 +80,7 @@
-
+
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
index ef925a59b0..7b4723d838 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
@@ -21,7 +21,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoServiceException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoLocationBasedServiceException.java
similarity index 77%
rename from components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoServiceException.java
rename to components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoLocationBasedServiceException.java
index 91154e03e2..e9eb31f329 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoServiceException.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoLocationBasedServiceException.java
@@ -20,7 +20,7 @@ package org.wso2.carbon.device.mgt.common.geo.service;
/**
* Custom exception class of Geo Service related operations.
*/
-public class GeoServiceException extends Exception {
+public class GeoLocationBasedServiceException extends Exception {
private static final long serialVersionUID = -7151990041029070298L;
@@ -34,26 +34,26 @@ public class GeoServiceException extends Exception {
this.errorMessage = errorMessage;
}
- public GeoServiceException(String msg, Exception nestedEx) {
+ public GeoLocationBasedServiceException(String msg, Exception nestedEx) {
super(msg, nestedEx);
setErrorMessage(msg);
}
- public GeoServiceException(String message, Throwable cause) {
+ public GeoLocationBasedServiceException(String message, Throwable cause) {
super(message, cause);
setErrorMessage(message);
}
- public GeoServiceException(String msg) {
+ public GeoLocationBasedServiceException(String msg) {
super(msg);
setErrorMessage(msg);
}
- public GeoServiceException() {
+ public GeoLocationBasedServiceException() {
super();
}
- public GeoServiceException(Throwable cause) {
+ public GeoLocationBasedServiceException(Throwable cause) {
super(cause);
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoService.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoLocationProviderService.java
similarity index 78%
rename from components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoService.java
rename to components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoLocationProviderService.java
index 1880634c77..d8375ab583 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoService.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/geo/service/GeoLocationProviderService.java
@@ -26,26 +26,26 @@ import java.util.List;
* This represents the Geo service functionality which should be implemented by
* required GeoServiceManagers.
*/
-public interface GeoService {
+public interface GeoLocationProviderService {
- List getWithinAlerts(DeviceIdentifier identifier) throws GeoServiceException;
+ List getWithinAlerts(DeviceIdentifier identifier) throws GeoLocationBasedServiceException;
- List getExitAlerts(DeviceIdentifier identifier) throws GeoServiceException;
+ List getExitAlerts(DeviceIdentifier identifier) throws GeoLocationBasedServiceException;
boolean createGeoAlert(Alert alert, DeviceIdentifier identifier, String alertType)
- throws GeoServiceException;
+ throws GeoLocationBasedServiceException;
boolean updateGeoAlert(Alert alert, DeviceIdentifier identifier, String alertType)
- throws GeoServiceException;
+ throws GeoLocationBasedServiceException;
boolean removeGeoAlert(String alertType, DeviceIdentifier identifier, String queryName)
- throws GeoServiceException;
+ throws GeoLocationBasedServiceException;
- String getSpeedAlerts(DeviceIdentifier identifier) throws GeoServiceException;
+ String getSpeedAlerts(DeviceIdentifier identifier) throws GeoLocationBasedServiceException;
- String getProximityAlerts(DeviceIdentifier identifier) throws GeoServiceException;
+ String getProximityAlerts(DeviceIdentifier identifier) throws GeoLocationBasedServiceException;
- List getStationaryAlerts(DeviceIdentifier identifier) throws GeoServiceException;
+ List getStationaryAlerts(DeviceIdentifier identifier) throws GeoLocationBasedServiceException;
- List getTrafficAlerts(DeviceIdentifier identifier) throws GeoServiceException;
+ List getTrafficAlerts(DeviceIdentifier identifier) throws GeoLocationBasedServiceException;
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
index 47eaf030cb..81a1d150a7 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt
- 3.0.40-SNAPSHOT
+ 3.0.46-SNAPSHOT
../pom.xml
@@ -146,6 +146,18 @@
org.slf4j
slf4j-api
+
+ javax.servlet
+ servlet-api
+
+
+ org.wso2.carbon.registry
+ org.wso2.carbon.registry.indexing
+
+
+ org.wso2.carbon.identity.framework
+ org.wso2.carbon.user.mgt
+
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/EnrollmentDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/EnrollmentDAOImpl.java
index 6347d4fe34..33371e3c9d 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/EnrollmentDAOImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/EnrollmentDAOImpl.java
@@ -71,7 +71,6 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
- int status = -1;
try {
conn = this.getConnection();
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, DATE_OF_LAST_UPDATE = ? WHERE DEVICE_ID = ?" +
@@ -84,7 +83,7 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
stmt.setString(5, enrolmentInfo.getOwner());
stmt.setInt(6, tenantId);
stmt.setInt(7, enrolmentInfo.getId());
- stmt.executeUpdate();
+ int status = stmt.executeUpdate();
return status;
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while updating enrolment configuration", e);
@@ -98,7 +97,6 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
- int status = -1;
try {
conn = this.getConnection();
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, DATE_OF_LAST_UPDATE = ? WHERE ID = ?";
@@ -107,7 +105,7 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
stmt.setString(2, enrolmentInfo.getStatus().toString());
stmt.setTimestamp(3, new Timestamp(new Date().getTime()));
stmt.setInt(4, enrolmentInfo.getId());
- stmt.executeUpdate();
+ int status = stmt.executeUpdate();
return status;
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while updating enrolment configuration", e);
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/geo/service/GeoServcieManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java
similarity index 93%
rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/geo/service/GeoServcieManagerImpl.java
rename to components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java
index 400a7b1693..36b56e357a 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/geo/service/GeoServcieManagerImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java
@@ -39,8 +39,8 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants.GeoServices;
import org.wso2.carbon.device.mgt.common.geo.service.Alert;
import org.wso2.carbon.device.mgt.common.geo.service.GeoFence;
-import org.wso2.carbon.device.mgt.common.geo.service.GeoService;
-import org.wso2.carbon.device.mgt.common.geo.service.GeoServiceException;
+import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService;
+import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationBasedServiceException;
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
import org.wso2.carbon.event.processor.stub.EventProcessorAdminServiceStub;
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
@@ -78,9 +78,9 @@ import static org.wso2.carbon.device.mgt.common.DeviceManagementConstants.GeoSer
* This class will read events, set alerts, read alerts related to geo-fencing and it will
* use Registry as the persistence storage.
*/
-public class GeoServcieManagerImpl implements GeoService {
+public class GeoLocationProviderServiceImpl implements GeoLocationProviderService {
- private static Log log = LogFactory.getLog(GeoServcieManagerImpl.class);
+ private static Log log = LogFactory.getLog(GeoLocationProviderServiceImpl.class);
/**
* required soap header for authorization
@@ -110,7 +110,7 @@ public class GeoServcieManagerImpl implements GeoService {
private static final String SSLV3 = "SSLv3";
@Override
- public List getWithinAlerts(DeviceIdentifier identifier) throws GeoServiceException {
+ public List getWithinAlerts(DeviceIdentifier identifier) throws GeoLocationBasedServiceException {
Registry registry = getGovernanceRegistry();
String registryPath = GeoServices.REGISTRY_PATH_FOR_ALERTS +
@@ -151,14 +151,14 @@ public class GeoServcieManagerImpl implements GeoService {
}
return fences;
} catch (RegistryException | IOException e) {
- throw new GeoServiceException(
+ throw new GeoLocationBasedServiceException(
"Error occurred while getting the geo alerts for " + identifier.getType() + " with id: " +
identifier.getId(), e);
}
}
@Override
- public List getExitAlerts(DeviceIdentifier identifier) throws GeoServiceException {
+ public List getExitAlerts(DeviceIdentifier identifier) throws GeoLocationBasedServiceException {
Registry registry = getGovernanceRegistry();
String registryPath = GeoServices.REGISTRY_PATH_FOR_ALERTS +
@@ -199,7 +199,7 @@ public class GeoServcieManagerImpl implements GeoService {
}
return fences;
} catch (RegistryException | IOException e) {
- throw new GeoServiceException(
+ throw new GeoLocationBasedServiceException(
"Error occurred while getting the geo alerts for " + identifier.getType() + " with id: " +
identifier.getId(), e);
}
@@ -207,18 +207,18 @@ public class GeoServcieManagerImpl implements GeoService {
@Override
public boolean createGeoAlert(Alert alert, DeviceIdentifier identifier, String alertType)
- throws GeoServiceException {
+ throws GeoLocationBasedServiceException {
return saveGeoAlert(alert, identifier, alertType, false);
}
@Override
public boolean updateGeoAlert(Alert alert, DeviceIdentifier identifier, String alertType)
- throws GeoServiceException {
+ throws GeoLocationBasedServiceException {
return saveGeoAlert(alert, identifier, alertType, true);
}
public boolean saveGeoAlert(Alert alert, DeviceIdentifier identifier, String alertType, boolean isUpdate)
- throws GeoServiceException {
+ throws GeoLocationBasedServiceException {
Type type = new TypeToken