Address review comments

#11311
Nipuni Kavindya 5 months ago
parent 98d05785c3
commit 28cf9fc403

@ -291,14 +291,14 @@ public interface SubscriptionManager {
/** /**
* This method is responsible for retrieving device subscription details related to the given UUID. * This method is responsible for retrieving device subscription details related to the given UUID.
* *
* @param uuid the UUID of the application release.
* @param deviceId the deviceId of the device that need to get operation details. * @param deviceId the deviceId of the device that need to get operation details.
* @param uuid the UUID of the application release.
* @param offset the offset for the data set * @param offset the offset for the data set
* @param limit the limit for the data set * @param limit the limit for the data set
* @return {@link DeviceOperationDTO} which contains the details of device subscriptions. * @return {@link DeviceOperationDTO} which contains the details of device subscriptions.
* @throws SubscriptionManagementException if there is an error while fetching the details. * @throws SubscriptionManagementException if there is an error while fetching the details.
*/ */
List<DeviceOperationDTO> getSubscriptionOperationsByUUIDAndDeviceID(String uuid, int deviceId, int offset, int limit) List<DeviceOperationDTO> getSubscriptionOperationsByUUIDAndDeviceID(int deviceId, String uuid, int offset, int limit)
throws ApplicationManagementException; throws ApplicationManagementException;
/** /**

@ -2582,7 +2582,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
} }
@Override @Override
public List<DeviceOperationDTO> getSubscriptionOperationsByUUIDAndDeviceID(String uuid, int deviceId, int offset, int limit) public List<DeviceOperationDTO> getSubscriptionOperationsByUUIDAndDeviceID(int deviceId, String uuid, int offset, int limit)
throws ApplicationManagementException { throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
if (uuid == null || uuid.isEmpty()) { if (uuid == null || uuid.isEmpty()) {

@ -2796,8 +2796,9 @@ public class GenericOperationDAOImpl implements OperationDAO {
"WHERE o.ID = ? " + "WHERE o.ID = ? " +
"AND o.TENANT_ID = ?"; "AND o.TENANT_ID = ?";
try (Connection conn = OperationManagementDAOFactory.getConnection(); try {
PreparedStatement stmt = conn.prepareStatement(sql)) { Connection conn = OperationManagementDAOFactory.getConnection();
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setInt(1, operationId); stmt.setInt(1, operationId);
stmt.setInt(2, tenantId); stmt.setInt(2, tenantId);
@ -2830,9 +2831,11 @@ public class GenericOperationDAOImpl implements OperationDAO {
} }
operationDetails.setOperationResponses(responses); operationDetails.setOperationResponses(responses);
} }
}
} catch (SQLException e) { } catch (SQLException e) {
throw new OperationManagementDAOException("Error occurred while retrieving operation details for operation ID: " String msg = "Error occurred while retrieving operation details for operation ID: " + operationId;
+ operationId, e); log.error(msg, e);
throw new OperationManagementDAOException(msg, e);
} }
return operationDetails; return operationDetails;

Loading…
Cancel
Save