From 3938064210e3d96b62ba74252ad1753288da2e5a Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 30 Apr 2017 14:29:30 +0530 Subject: [PATCH] Add opeerations mapping map for tenants and fixes for code review --- .../notification/PushNotificationConfig.java | 1 + .../mgt/core/dto/operation/mgt/Operation.java | 2 +- .../DeviceManagementServiceComponent.java | 4 +-- .../operation/mgt/OperationManagerImpl.java | 4 +-- .../core/operation/mgt/dao/OperationDAO.java | 13 +++++-- .../mgt/dao/impl/GenericOperationDAOImpl.java | 31 +++++++++------- .../mgt/dao/impl/OperationMappingDAOImpl.java | 2 +- .../operation/OracleOperationDAOImpl.java | 31 +++++++++------- .../operation/SQLServerOperationDAOImpl.java | 35 ++++++++++--------- 9 files changed, 73 insertions(+), 50 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/push/notification/PushNotificationConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/push/notification/PushNotificationConfig.java index 882df04a645..6b9e9f9f3e4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/push/notification/PushNotificationConfig.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/push/notification/PushNotificationConfig.java @@ -40,6 +40,7 @@ public class PushNotificationConfig { return type; } + @XmlElement(name = "isScheduled") public boolean isScheduled() { return isScheduled; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java index 2263ccdf7bf..c3acb18076e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dto/operation/mgt/Operation.java @@ -36,7 +36,7 @@ public class Operation implements Serializable { } public enum PushStatus { - SCHEDULED, IN_PROGRESS, COMPLETED + SCHEDULED, COMPLETED } private String code; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java index b63aa0d2a17..deec497e120 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java @@ -63,9 +63,7 @@ import org.wso2.carbon.utils.ConfigurationContextService; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -200,7 +198,7 @@ public class DeviceManagementServiceComponent { config.getPushNotificationConfiguration().setSchedulerBatchDelayMills(DeviceManagementConstants.PushNotifications .DEFAULT_BATCH_DELAY_MILLS); } - ScheduledExecutorService pushNotificationExecutor = Executors.newScheduledThreadPool(1); + ScheduledExecutorService pushNotificationExecutor = Executors.newSingleThreadScheduledExecutor(); pushNotificationExecutor.schedule(new PushNotificationSchedulerTask(), config.getPushNotificationConfiguration() .getSchedulerBatchDelayMills(), TimeUnit.MILLISECONDS); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index aaf77bf2d83..362bf0722e9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -131,7 +131,7 @@ public class OperationManagerImpl implements OperationManager { DeviceIDHolder deviceAuthorizationResult = this.authorizeDevices(operation, validDeviceIds); List authorizedDeviceList = deviceAuthorizationResult.getValidDeviceIDList(); if (authorizedDeviceList.size() <= 0) { - log.info("User : " + getUser() + " is not authorized to perform operations on given device-list."); + log.warn("User : " + getUser() + " is not authorized to perform operations on given device-list."); Activity activity = new Activity(); //Send the operation statuses only for admin triggered operations String deviceType = validDeviceIds.get(0).getType(); @@ -191,7 +191,7 @@ public class OperationManagerImpl implements OperationManager { if (notificationStrategy != null && !isScheduled) { try { if (log.isDebugEnabled()) { - log.debug("Sending push notification to " + deviceId + " add operation thread."); + log.debug("Sending push notification to " + deviceId + " from add operation method."); } notificationStrategy.execute(new NotificationContext(deviceId, operation)); operationMappingDAO.updateOperationMapping(operationId, enrolmentId, org.wso2.carbon diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java index d22684f6a39..79da36c052d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/OperationDAO.java @@ -25,6 +25,7 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.OperationResponse; import org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation; import java.util.List; +import java.util.Map; public interface OperationDAO { @@ -81,7 +82,15 @@ public interface OperationDAO { boolean resetAttemptCount(int enrolmentId) throws OperationManagementDAOException; - List getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushStatus pushStatus, - int limit) throws OperationManagementDAOException;; + /** + * This method provides operation mappings for given status + * @param opStatus Operation status + * @param pushStatus Push notification Status + * @param limit Limit for no devices + * @return Tenant based operation mappings list + * @throws OperationManagementDAOException + */ + Map> getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushStatus pushStatus, + int limit) throws OperationManagementDAOException;; } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java index 1e145c14f49..f29c3ed05da 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java @@ -24,9 +24,9 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.ActivityStatus; -import org.wso2.carbon.device.mgt.core.operation.mgt.OperationMapping; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationResponse; import org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation; +import org.wso2.carbon.device.mgt.core.operation.mgt.OperationMapping; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationDAO; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; @@ -46,8 +46,10 @@ import java.sql.Timestamp; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; /** * This class holds the generic implementation of OperationDAO which can be used to support ANSI db syntax. @@ -1093,32 +1095,35 @@ public class GenericOperationDAOImpl implements OperationDAO { } @Override - public List getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushStatus pushStatus, - int limit) throws OperationManagementDAOException { - + public Map> getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushStatus pushStatus, + int limit) throws OperationManagementDAOException { PreparedStatement stmt = null; ResultSet rs = null; OperationMapping operationMapping; - List operationMappings = new LinkedList<>(); + Map> operationMappingsTenantMap = new HashMap<>(); try { Connection conn = OperationManagementDAOFactory.getConnection(); - String sql = "SELECT op_mappings.ENROLMENT_ID, op_mappings.OPERATION_ID, d_type.NAME ,d.TENANT_ID FROM " + - "DM_DEVICE d, DM_ENROLMENT_OP_MAPPING op_mappings, DM_DEVICE_TYPE d_type WHERE op_mappings" + - ".STATUS = '?' AND op_mappings.PUSH_NOTIFICATION_STATUS = '?' AND d.DEVICE_TYPE_ID = d_type.ID " + - "AND d.ID=op_mappings.ENROLMENT_ID ORDER BY op_mappings.OPERATION_ID LIMIT ?"; - + String sql = "SELECT op.ENROLMENT_ID, op.OPERATION_ID, dt.NAME ,d.TENANT_ID FROM DM_DEVICE d, " + + "DM_ENROLMENT_OP_MAPPING op, DM_DEVICE_TYPE dt WHERE op.STATUS = '?' AND " + + "op.PUSH_NOTIFICATION_STATUS = '?' AND d.DEVICE_TYPE_ID = dt.ID AND d.ID=op.ENROLMENT_ID ORDER BY " + + "op.OPERATION_ID LIMIT ?"; stmt = conn.prepareStatement(sql); stmt.setString(1, opStatus.toString()); stmt.setString(2, pushStatus.toString()); stmt.setInt(3, limit); rs = stmt.executeQuery(); - while (rs.next()) { + int tenantID = rs.getInt("TENANT_ID"); + List operationMappings = operationMappingsTenantMap.get(tenantID); + if (operationMappings == null) { + operationMappings = new LinkedList<>(); + operationMappingsTenantMap.put(tenantID, operationMappings); + } operationMapping = new OperationMapping(); operationMapping.setOperationId(rs.getInt("OPERATION_ID")); operationMapping.setDeviceIdentifier(new DeviceIdentifier(String.valueOf(rs.getInt("ENROLMENT_ID")), rs.getString("NAME"))); - operationMapping.setTenantId(rs.getInt("TENANT_ID")); + operationMapping.setTenantId(tenantID); operationMappings.add(operationMapping); } } catch (SQLException e) { @@ -1126,6 +1131,6 @@ public class GenericOperationDAOImpl implements OperationDAO { } finally { OperationManagementDAOUtil.cleanupResources(stmt, rs); } - return operationMappings; + return operationMappingsTenantMap; } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java index f9b8b5e8a8c..867353aa8d4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java @@ -48,7 +48,7 @@ public class OperationMappingDAOImpl implements OperationMappingDAO { if (isScheduled) { stmt.setString(4, Operation.PushStatus.SCHEDULED.toString()); } else { - stmt.setString(4, Operation.PushStatus.IN_PROGRESS.toString()); + stmt.setString(4, Operation.PushStatus.COMPLETED.toString()); } stmt.setLong(5, time); stmt.setLong(6, time); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/operation/OracleOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/operation/OracleOperationDAOImpl.java index c78afd44a8d..19f604fa03d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/operation/OracleOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/operation/OracleOperationDAOImpl.java @@ -23,9 +23,9 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.ActivityStatus; -import org.wso2.carbon.device.mgt.core.operation.mgt.OperationMapping; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationResponse; import org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation; +import org.wso2.carbon.device.mgt.core.operation.mgt.OperationMapping; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; @@ -38,8 +38,10 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; /** * This class holds the implementation of OperationDAO which can be used to support Oracle db syntax. @@ -364,33 +366,38 @@ public class OracleOperationDAOImpl extends GenericOperationDAOImpl { return 0; } - @Override - public List getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushStatus pushStatus, - int limit) throws OperationManagementDAOException { + @Override + public Map> getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushStatus pushStatus, + int limit) throws OperationManagementDAOException { PreparedStatement stmt = null; ResultSet rs = null; OperationMapping operationMapping; - List operationMappings = new LinkedList<>(); + Map> operationMappingsTenantMap = new HashMap<>(); try { Connection conn = OperationManagementDAOFactory.getConnection(); - String sql = "SELECT op_mappings.ENROLMENT_ID, op_mappings.OPERATION_ID, d_type.NAME ,d.TENANT_ID FROM " + - "DM_DEVICE d, DM_ENROLMENT_OP_MAPPING op_mappings, DM_DEVICE_TYPE d_type WHERE op_mappings" + - ".STATUS = '?' AND op_mappings.PUSH_NOTIFICATION_STATUS = '?' AND d.DEVICE_TYPE_ID = d_type.ID " + - "AND d.ID=op_mappings.ENROLMENT_ID AND ROWNUM <= ? ORDER BY op_mappings.OPERATION_ID"; + String sql = "SELECT op.ENROLMENT_ID, op.OPERATION_ID, dt.NAME ,d.TENANT_ID FROM DM_DEVICE d, " + + "DM_ENROLMENT_OP_MAPPING op, DM_DEVICE_TYPE dt WHERE op.STATUS = '?' AND op" + + ".PUSH_NOTIFICATION_STATUS = '?' AND d.DEVICE_TYPE_ID = dt.ID AND d.ID=op.ENROLMENT_ID AND ROWNUM" + + " <= ? ORDER BY op.OPERATION_ID"; stmt = conn.prepareStatement(sql); stmt.setString(1, opStatus.toString()); stmt.setString(2, pushStatus.toString()); stmt.setInt(3, limit); rs = stmt.executeQuery(); - while (rs.next()) { + int tenantID = rs.getInt("TENANT_ID"); + List operationMappings = operationMappingsTenantMap.get(tenantID); + if (operationMappings == null) { + operationMappings = new LinkedList<>(); + operationMappingsTenantMap.put(tenantID, operationMappings); + } operationMapping = new OperationMapping(); operationMapping.setOperationId(rs.getInt("OPERATION_ID")); operationMapping.setDeviceIdentifier(new DeviceIdentifier(String.valueOf(rs.getInt("ENROLMENT_ID")), rs.getString("NAME"))); - operationMapping.setTenantId(rs.getInt("TENANT_ID")); + operationMapping.setTenantId(tenantID); operationMappings.add(operationMapping); } } catch (SQLException e) { @@ -398,6 +405,6 @@ public class OracleOperationDAOImpl extends GenericOperationDAOImpl { } finally { OperationManagementDAOUtil.cleanupResources(stmt, rs); } - return operationMappings; + return operationMappingsTenantMap; } } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java index c553fee8d75..6a69c5d4af1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java @@ -23,9 +23,9 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.ActivityStatus; -import org.wso2.carbon.device.mgt.core.operation.mgt.OperationMapping; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationResponse; import org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation; +import org.wso2.carbon.device.mgt.core.operation.mgt.OperationMapping; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; @@ -38,8 +38,10 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; /** * This class holds the implementation of OperationDAO which can be used to support SQLServer db syntax. @@ -267,33 +269,35 @@ public class SQLServerOperationDAOImpl extends GenericOperationDAOImpl { } @Override - public List getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushStatus pushStatus, - int limit) throws OperationManagementDAOException { - + public Map> getOperationMappingsByStatus(Operation.Status opStatus, Operation.PushStatus pushStatus, + int limit) throws OperationManagementDAOException { PreparedStatement stmt = null; ResultSet rs = null; OperationMapping operationMapping; - List operationMappings = new LinkedList<>(); + Map> operationMappingsTenantMap = new HashMap<>(); try { Connection conn = OperationManagementDAOFactory.getConnection(); - String sql = "SELECT op_mappings.ENROLMENT_ID, op_mappings.OPERATION_ID, d_type.NAME ,d.TENANT_ID FROM " + - "DM_DEVICE d, DM_ENROLMENT_OP_MAPPING op_mappings, DM_DEVICE_TYPE d_type WHERE op_mappings" + - ".STATUS = '?' AND op_mappings.PUSH_NOTIFICATION_STATUS = '?' AND d.DEVICE_TYPE_ID = d_type.ID " + - "AND d.ID=op_mappings.ENROLMENT_ID ORDER BY op_mappings.OPERATION_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; - + String sql = "SELECT op.ENROLMENT_ID, op.OPERATION_ID, dt.NAME ,d.TENANT_ID FROM DM_DEVICE d, " + + "DM_ENROLMENT_OP_MAPPING op, DM_DEVICE_TYPE dt WHERE op.STATUS = '?' AND op" + + ".PUSH_NOTIFICATION_STATUS = '?' AND d.DEVICE_TYPE_ID = dt.ID " + + "AND d.ID=op.ENROLMENT_ID ORDER BY op.OPERATION_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; stmt = conn.prepareStatement(sql); stmt.setString(1, opStatus.toString()); stmt.setString(2, pushStatus.toString()); - stmt.setInt(3, 0); - stmt.setInt(4, limit); + stmt.setInt(3, limit); rs = stmt.executeQuery(); - while (rs.next()) { + int tenantID = rs.getInt("TENANT_ID"); + List operationMappings = operationMappingsTenantMap.get(tenantID); + if (operationMappings == null) { + operationMappings = new LinkedList<>(); + operationMappingsTenantMap.put(tenantID, operationMappings); + } operationMapping = new OperationMapping(); operationMapping.setOperationId(rs.getInt("OPERATION_ID")); operationMapping.setDeviceIdentifier(new DeviceIdentifier(String.valueOf(rs.getInt("ENROLMENT_ID")), rs.getString("NAME"))); - operationMapping.setTenantId(rs.getInt("TENANT_ID")); + operationMapping.setTenantId(tenantID); operationMappings.add(operationMapping); } } catch (SQLException e) { @@ -301,7 +305,6 @@ public class SQLServerOperationDAOImpl extends GenericOperationDAOImpl { } finally { OperationManagementDAOUtil.cleanupResources(stmt, rs); } - return operationMappings; + return operationMappingsTenantMap; } - }