From 4cc670a614c17eb46d8abf97b9100fafcb3fb14a Mon Sep 17 00:00:00 2001 From: Pahansith Date: Thu, 11 Feb 2021 10:54:57 +0530 Subject: [PATCH] Format code --- .../mgt/core/event/config/EventOperationExecutor.java | 9 --------- .../config/GroupAssignmentEventOperationExecutor.java | 6 ++---- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationExecutor.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationExecutor.java index aa40af5025..937706c219 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationExecutor.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationExecutor.java @@ -38,9 +38,6 @@ import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; -import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; -import org.wso2.carbon.device.mgt.core.dao.EventConfigDAO; -import org.wso2.carbon.device.mgt.core.dao.GeofenceDAO; import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder; import org.wso2.carbon.device.mgt.core.operation.mgt.OperationMgtConstants; import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; @@ -61,8 +58,6 @@ public class EventOperationExecutor implements Runnable { private static final Log log = LogFactory.getLog(EventOperationExecutor.class); private final GroupManagementProviderService groupManagementService; - private final EventConfigDAO eventConfigDAO; - private final GeofenceDAO geofenceDAO; private final List groupIds; private final String eventSource; private final EventMetaData eventMetaData; @@ -72,8 +67,6 @@ public class EventOperationExecutor implements Runnable { public EventOperationExecutor(EventMetaData eventMetaData, List groupIds, int tenantId, String eventSource, String operationCode) { this.groupManagementService = DeviceManagementDataHolder.getInstance().getGroupManagementProviderService(); - this.eventConfigDAO = DeviceManagementDAOFactory.getEventConfigDAO(); - this.geofenceDAO = DeviceManagementDAOFactory.getGeofenceDAO(); this.eventMetaData = eventMetaData; this.groupIds = groupIds; this.tenantId = tenantId; @@ -223,11 +216,9 @@ public class EventOperationExecutor implements Runnable { //TODO introduce a proper mechanism } catch (OperationManagementException e) { log.error("Creating event operation failed with error ", e); - return; } catch (InvalidDeviceException e) { log.error("Creating event operation failed.\n" + "Could not found device/devices for the defined device identifiers.", e); - return; } } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/GroupAssignmentEventOperationExecutor.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/GroupAssignmentEventOperationExecutor.java index 546616c0d9..0179c9199e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/GroupAssignmentEventOperationExecutor.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/GroupAssignmentEventOperationExecutor.java @@ -86,15 +86,13 @@ public class GroupAssignmentEventOperationExecutor implements Runnable { try { this.eventSources = eventConfigurationService.getEventsSourcesOfGroup(groupId, tenantId); if (this.eventSources == null || this.eventSources.isEmpty()) { - String msg = "No events applied for queried group with ID " + groupId; if (log.isDebugEnabled()) { - log.debug(msg); + log.debug("No configured events for the queried group with ID " + groupId); } return; } } catch (EventConfigurationException e) { - String msg = "Failed while retrieving event records of group " + groupId + "of the tenant " + tenantId; - log.error(msg, e); + log.error("Failed while retrieving event records of group " + groupId + "of the tenant " + tenantId, e); return; }