diff --git a/.m2/settings.xml b/.m2/settings.xml
deleted file mode 100644
index 8317041cd2..0000000000
--- a/.m2/settings.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
- maven-snapshots
- ${env.MAVEN_REPO_USER}
- ${env.MAVEN_REPO_PASS}
-
-
-
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java
index 9b380f14ee..c85d2d968c 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java
@@ -1527,8 +1527,15 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic
@Override
public boolean updateGeofence(GeofenceData geofenceData, int fenceId)
- throws GeoLocationBasedServiceException, EventConfigurationException {
+ throws GeoLocationBasedServiceException {
+
+ EventConfigurationProviderService eventConfigService;
+ eventConfigService = DeviceManagementDataHolder.getInstance().getEventConfigurationService();
+
int tenantId;
+ List groupIdsToDelete = new ArrayList<>();
+ List groupIdsToAdd = new ArrayList<>();
+
try {
tenantId = DeviceManagementDAOUtil.getTenantId();
} catch (DeviceManagementDAOException e) {
@@ -1543,8 +1550,6 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic
int updatedRowCount = geofenceDAO.updateGeofence(geofenceData, fenceId);
savedGroupIds = geofenceDAO.getGroupIdsOfGeoFence(fenceId);
geofenceData.setId(fenceId);
- List groupIdsToDelete = new ArrayList<>();
- List groupIdsToAdd = new ArrayList<>();
for (Integer savedGroupId : savedGroupIds) {
if (!geofenceData.getGroupIds().contains(savedGroupId)) {
groupIdsToDelete.add(savedGroupId);
@@ -1558,6 +1563,18 @@ public class GeoLocationProviderServiceImpl implements GeoLocationProviderServic
geofenceDAO.deleteGeofenceGroupMapping(groupIdsToDelete, fenceId);
geofenceDAO.createGeofenceGroupMapping(geofenceData, groupIdsToAdd);
EventManagementDAOFactory.commitTransaction();
+ try {
+ if (!groupIdsToDelete.isEmpty()) {
+ eventConfigService.createEventOperationTask(OperationMgtConstants.OperationCodes.EVENT_REVOKE,
+ DeviceManagementConstants.EventServices.GEOFENCE,
+ new GeoFenceEventMeta(geofenceData), tenantId, groupIdsToDelete);
+ }
+ } catch (EventConfigurationException e) {
+ String msg = "Failed while creating EVENT_REVOKE operation creation task entry while updating geo fence "
+ + geofenceData.getFenceName() + " of the tenant " + tenantId;
+ log.error(msg, e);
+ throw new GeoLocationBasedServiceException(msg, e);
+ }
if (updatedRowCount > 0) {
GeoCacheManagerImpl.getInstance().updateGeoFenceInCache(geofenceData, fenceId, tenantId);
}