|
|
@ -47,7 +47,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean addMobileDeviceOperationMapping(MobileDeviceOperationMapping deviceOperation)
|
|
|
|
public boolean addMobileDeviceOperationMapping(MobileDeviceOperationMapping mblDeviceOperationMapping)
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
boolean status = false;
|
|
|
|
boolean status = false;
|
|
|
|
Connection conn = null;
|
|
|
|
Connection conn = null;
|
|
|
@ -59,19 +59,24 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
"RECEIVED_DATE, STATUS) VALUES (?, ?, ?, ?, ?)";
|
|
|
|
"RECEIVED_DATE, STATUS) VALUES (?, ?, ?, ?, ?)";
|
|
|
|
|
|
|
|
|
|
|
|
stmt = conn.prepareStatement(createDBQuery);
|
|
|
|
stmt = conn.prepareStatement(createDBQuery);
|
|
|
|
stmt.setString(1, deviceOperation.getDeviceId());
|
|
|
|
stmt.setString(1, mblDeviceOperationMapping.getDeviceId());
|
|
|
|
stmt.setLong(2, deviceOperation.getOperationId());
|
|
|
|
stmt.setLong(2, mblDeviceOperationMapping.getOperationId());
|
|
|
|
stmt.setLong(3, deviceOperation.getSentDate());
|
|
|
|
stmt.setLong(3, mblDeviceOperationMapping.getSentDate());
|
|
|
|
stmt.setLong(4, deviceOperation.getReceivedDate());
|
|
|
|
stmt.setLong(4, mblDeviceOperationMapping.getReceivedDate());
|
|
|
|
stmt.setString(5, deviceOperation.getStatus().name());
|
|
|
|
stmt.setString(5, mblDeviceOperationMapping.getStatus().name());
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
if (rows > 0) {
|
|
|
|
if (rows > 0) {
|
|
|
|
status = true;
|
|
|
|
status = true;
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
|
|
|
log.debug("Added a MobileDevice-Mapping DeviceId : " + mblDeviceOperationMapping
|
|
|
|
|
|
|
|
.getDeviceId() + ", " +
|
|
|
|
|
|
|
|
"OperationId : " + mblDeviceOperationMapping.getOperationId() + " to the MDM database.");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
String msg = "Error occurred while adding device id - '" +
|
|
|
|
String msg = "Error occurred while adding device id - '" +
|
|
|
|
deviceOperation.getDeviceId() + " and operation id - " +
|
|
|
|
mblDeviceOperationMapping.getDeviceId() + " and operation id - " +
|
|
|
|
deviceOperation.getOperationId() +
|
|
|
|
mblDeviceOperationMapping.getOperationId() +
|
|
|
|
" to mapping table MBL_DEVICE_OPERATION";
|
|
|
|
" to mapping table MBL_DEVICE_OPERATION";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
@ -82,7 +87,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean updateMobileDeviceOperationMapping(MobileDeviceOperationMapping deviceOperation)
|
|
|
|
public boolean updateMobileDeviceOperationMapping(MobileDeviceOperationMapping mblDeviceOperation)
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
boolean status = false;
|
|
|
|
boolean status = false;
|
|
|
|
Connection conn = null;
|
|
|
|
Connection conn = null;
|
|
|
@ -93,19 +98,23 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
"UPDATE MBL_DEVICE_OPERATION_MAPPING SET SENT_DATE = ?, RECEIVED_DATE = ?, " +
|
|
|
|
"UPDATE MBL_DEVICE_OPERATION_MAPPING SET SENT_DATE = ?, RECEIVED_DATE = ?, " +
|
|
|
|
"STATUS = ? WHERE DEVICE_ID = ? AND OPERATION_ID=?";
|
|
|
|
"STATUS = ? WHERE DEVICE_ID = ? AND OPERATION_ID=?";
|
|
|
|
stmt = conn.prepareStatement(updateDBQuery);
|
|
|
|
stmt = conn.prepareStatement(updateDBQuery);
|
|
|
|
stmt.setLong(1, deviceOperation.getSentDate());
|
|
|
|
stmt.setLong(1, mblDeviceOperation.getSentDate());
|
|
|
|
stmt.setLong(2, deviceOperation.getReceivedDate());
|
|
|
|
stmt.setLong(2, mblDeviceOperation.getReceivedDate());
|
|
|
|
stmt.setString(3, deviceOperation.getStatus().name());
|
|
|
|
stmt.setString(3, mblDeviceOperation.getStatus().name());
|
|
|
|
stmt.setString(4, deviceOperation.getDeviceId());
|
|
|
|
stmt.setString(4, mblDeviceOperation.getDeviceId());
|
|
|
|
stmt.setInt(5, deviceOperation.getOperationId());
|
|
|
|
stmt.setInt(5, mblDeviceOperation.getOperationId());
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
if (rows > 0) {
|
|
|
|
if (rows > 0) {
|
|
|
|
status = true;
|
|
|
|
status = true;
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
|
|
|
log.debug("Updated MobileDevice-Mapping DeviceId : " + mblDeviceOperation.getDeviceId() + " , " +
|
|
|
|
|
|
|
|
"OperationId : " + mblDeviceOperation.getOperationId());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
String msg = "Error occurred while updating device id - '" +
|
|
|
|
String msg = "Error occurred while updating device id - '" +
|
|
|
|
deviceOperation.getDeviceId() + " and operation id - " +
|
|
|
|
mblDeviceOperation.getDeviceId() + " and operation id - " +
|
|
|
|
deviceOperation.getOperationId() + " in table MBL_DEVICE_OPERATION";
|
|
|
|
mblDeviceOperation.getOperationId() + " in table MBL_DEVICE_OPERATION";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
@ -115,7 +124,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean updateMobileDeviceOperationMappingToInProgress(String deviceId, int operationId)
|
|
|
|
public boolean updateMobileDeviceOperationMappingToInProgress(String mblDeviceId, int operationId)
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
boolean status = false;
|
|
|
|
boolean status = false;
|
|
|
|
Connection conn = null;
|
|
|
|
Connection conn = null;
|
|
|
@ -128,16 +137,20 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
stmt = conn.prepareStatement(updateDBQuery);
|
|
|
|
stmt = conn.prepareStatement(updateDBQuery);
|
|
|
|
stmt.setLong(1, new Date().getTime());
|
|
|
|
stmt.setLong(1, new Date().getTime());
|
|
|
|
stmt.setString(2, MobileDeviceOperationMapping.Status.INPROGRESS.name());
|
|
|
|
stmt.setString(2, MobileDeviceOperationMapping.Status.INPROGRESS.name());
|
|
|
|
stmt.setString(3, deviceId);
|
|
|
|
stmt.setString(3, mblDeviceId);
|
|
|
|
stmt.setInt(4, operationId);
|
|
|
|
stmt.setInt(4, operationId);
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
if (rows > 0) {
|
|
|
|
if (rows > 0) {
|
|
|
|
status = true;
|
|
|
|
status = true;
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
|
|
|
log.debug("Updated status of MobileDevice-Mapping DeviceId : " + mblDeviceId + " , " +
|
|
|
|
|
|
|
|
"OperationId : " + operationId + " to In-Progress state");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
String msg =
|
|
|
|
String msg =
|
|
|
|
"Error occurred while updating the Status of operation to in-progress of device id - '" +
|
|
|
|
"Error occurred while updating the Status of operation to in-progress of device id - '" +
|
|
|
|
deviceId + " and operation id - " +
|
|
|
|
mblDeviceId + " and operation id - " +
|
|
|
|
operationId + " in table MBL_DEVICE_OPERATION";
|
|
|
|
operationId + " in table MBL_DEVICE_OPERATION";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
@ -148,7 +161,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean updateMobileDeviceOperationMappingToCompleted(String deviceId,
|
|
|
|
public boolean updateMobileDeviceOperationMappingToCompleted(String mblDeviceId,
|
|
|
|
int operationId)
|
|
|
|
int operationId)
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
boolean status = false;
|
|
|
|
boolean status = false;
|
|
|
@ -162,16 +175,20 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
stmt = conn.prepareStatement(updateDBQuery);
|
|
|
|
stmt = conn.prepareStatement(updateDBQuery);
|
|
|
|
stmt.setLong(1, new Date().getTime());
|
|
|
|
stmt.setLong(1, new Date().getTime());
|
|
|
|
stmt.setString(2, MobileDeviceOperationMapping.Status.COMPLETED.name());
|
|
|
|
stmt.setString(2, MobileDeviceOperationMapping.Status.COMPLETED.name());
|
|
|
|
stmt.setString(3, deviceId);
|
|
|
|
stmt.setString(3, mblDeviceId);
|
|
|
|
stmt.setInt(4, operationId);
|
|
|
|
stmt.setInt(4, operationId);
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
if (rows > 0) {
|
|
|
|
if (rows > 0) {
|
|
|
|
status = true;
|
|
|
|
status = true;
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
|
|
|
log.debug("Updated status of MobileDevice-Mapping DeviceId : " + mblDeviceId + " , " +
|
|
|
|
|
|
|
|
"OperationId : " + operationId + " to Completed state");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
String msg =
|
|
|
|
String msg =
|
|
|
|
"Error occurred while updating the Status of operation to completed of device id - '" +
|
|
|
|
"Error occurred while updating the Status of operation to completed of device id - '" +
|
|
|
|
deviceId + " and operation id - " +
|
|
|
|
mblDeviceId + " and operation id - " +
|
|
|
|
operationId + " in table MBL_DEVICE_OPERATION";
|
|
|
|
operationId + " in table MBL_DEVICE_OPERATION";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
@ -182,7 +199,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean deleteMobileDeviceOperationMapping(String deviceId, int operationId)
|
|
|
|
public boolean deleteMobileDeviceOperationMapping(String mblDeviceId, int operationId)
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
boolean status = false;
|
|
|
|
boolean status = false;
|
|
|
|
Connection conn = null;
|
|
|
|
Connection conn = null;
|
|
|
@ -193,16 +210,20 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
"DELETE FROM MBL_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID = ? AND " +
|
|
|
|
"DELETE FROM MBL_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID = ? AND " +
|
|
|
|
"OPERATION_ID = ?";
|
|
|
|
"OPERATION_ID = ?";
|
|
|
|
stmt = conn.prepareStatement(deleteDBQuery);
|
|
|
|
stmt = conn.prepareStatement(deleteDBQuery);
|
|
|
|
stmt.setString(1, deviceId);
|
|
|
|
stmt.setString(1, mblDeviceId);
|
|
|
|
stmt.setInt(2, operationId);
|
|
|
|
stmt.setInt(2, operationId);
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
if (rows > 0) {
|
|
|
|
if (rows > 0) {
|
|
|
|
status = true;
|
|
|
|
status = true;
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
|
|
|
log.debug("Deleted MobileDevice-Mapping DeviceId : " + mblDeviceId + " , " +
|
|
|
|
|
|
|
|
"OperationId : " + operationId + "from MDM database.");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
String msg =
|
|
|
|
String msg =
|
|
|
|
"Error occurred while deleting the table entry MBL_DEVICE_OPERATION with " +
|
|
|
|
"Error occurred while deleting the table entry MBL_DEVICE_OPERATION with " +
|
|
|
|
" device id - '" + deviceId + " and operation id - " + operationId;
|
|
|
|
" device id - '" + mblDeviceId + " and operation id - " + operationId;
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
@ -212,7 +233,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public MobileDeviceOperationMapping getMobileDeviceOperationMapping(String deviceId,
|
|
|
|
public MobileDeviceOperationMapping getMobileDeviceOperationMapping(String mblDeviceId,
|
|
|
|
int operationId)
|
|
|
|
int operationId)
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
Connection conn = null;
|
|
|
|
Connection conn = null;
|
|
|
@ -224,7 +245,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
"SELECT DEVICE_ID, OPERATION_ID, SENT_DATE, RECEIVED_DATE, STATUS FROM " +
|
|
|
|
"SELECT DEVICE_ID, OPERATION_ID, SENT_DATE, RECEIVED_DATE, STATUS FROM " +
|
|
|
|
"MBL_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID = ? AND OPERATION_ID = ?";
|
|
|
|
"MBL_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID = ? AND OPERATION_ID = ?";
|
|
|
|
stmt = conn.prepareStatement(selectDBQuery);
|
|
|
|
stmt = conn.prepareStatement(selectDBQuery);
|
|
|
|
stmt.setString(1, deviceId);
|
|
|
|
stmt.setString(1, mblDeviceId);
|
|
|
|
stmt.setInt(2, operationId);
|
|
|
|
stmt.setInt(2, operationId);
|
|
|
|
ResultSet resultSet = stmt.executeQuery();
|
|
|
|
ResultSet resultSet = stmt.executeQuery();
|
|
|
|
if (resultSet.next()) {
|
|
|
|
if (resultSet.next()) {
|
|
|
@ -234,11 +255,15 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
mblDeviceOperation.setSentDate(resultSet.getInt(3));
|
|
|
|
mblDeviceOperation.setSentDate(resultSet.getInt(3));
|
|
|
|
mblDeviceOperation.setReceivedDate(resultSet.getInt(4));
|
|
|
|
mblDeviceOperation.setReceivedDate(resultSet.getInt(4));
|
|
|
|
mblDeviceOperation.setStatus(resultSet.getString(5));
|
|
|
|
mblDeviceOperation.setStatus(resultSet.getString(5));
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
|
|
|
log.debug("Fetched MobileDevice-Mapping of DeviceId : " + mblDeviceId + " , " +
|
|
|
|
|
|
|
|
"OperationId : " + operationId );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
String msg =
|
|
|
|
String msg =
|
|
|
|
"Error occurred while fetching table MBL_DEVICE_OPERATION entry with device id - '" +
|
|
|
|
"Error occurred while fetching table MBL_DEVICE_OPERATION entry with device id - '" +
|
|
|
|
deviceId + " and operation id - " + operationId;
|
|
|
|
mblDeviceId + " and operation id - " + operationId;
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
@ -249,7 +274,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<MobileDeviceOperationMapping> getAllMobileDeviceOperationMappingsOfDevice(
|
|
|
|
public List<MobileDeviceOperationMapping> getAllMobileDeviceOperationMappingsOfDevice(
|
|
|
|
String deviceId)
|
|
|
|
String mblDeviceId)
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
Connection conn = null;
|
|
|
|
Connection conn = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
@ -262,7 +287,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
"SELECT DEVICE_ID, OPERATION_ID, SENT_DATE, RECEIVED_DATE, STATUS FROM " +
|
|
|
|
"SELECT DEVICE_ID, OPERATION_ID, SENT_DATE, RECEIVED_DATE, STATUS FROM " +
|
|
|
|
"MBL_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID = ?";
|
|
|
|
"MBL_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID = ?";
|
|
|
|
stmt = conn.prepareStatement(selectDBQuery);
|
|
|
|
stmt = conn.prepareStatement(selectDBQuery);
|
|
|
|
stmt.setString(1, deviceId);
|
|
|
|
stmt.setString(1, mblDeviceId);
|
|
|
|
ResultSet resultSet = stmt.executeQuery();
|
|
|
|
ResultSet resultSet = stmt.executeQuery();
|
|
|
|
while (resultSet.next()) {
|
|
|
|
while (resultSet.next()) {
|
|
|
|
mblDeviceOperation = new MobileDeviceOperationMapping();
|
|
|
|
mblDeviceOperation = new MobileDeviceOperationMapping();
|
|
|
@ -273,10 +298,13 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
mblDeviceOperation.setStatus(resultSet.getString(5));
|
|
|
|
mblDeviceOperation.setStatus(resultSet.getString(5));
|
|
|
|
mblDeviceOperations.add(mblDeviceOperation);
|
|
|
|
mblDeviceOperations.add(mblDeviceOperation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
|
|
|
log.debug("Fetched all MobileDevice-Mappings of DeviceId : " + mblDeviceId);
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
String msg =
|
|
|
|
String msg =
|
|
|
|
"Error occurred while fetching mapping table MBL_DEVICE_OPERATION entries of " +
|
|
|
|
"Error occurred while fetching mapping table MBL_DEVICE_OPERATION entries of " +
|
|
|
|
"device id - '" + deviceId;
|
|
|
|
"device id - '" + mblDeviceId;
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
@ -287,7 +315,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<MobileDeviceOperationMapping> getAllPendingOperationMappingsOfMobileDevice(
|
|
|
|
public List<MobileDeviceOperationMapping> getAllPendingOperationMappingsOfMobileDevice(
|
|
|
|
String deviceId)
|
|
|
|
String mblDeviceId)
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
Connection conn = null;
|
|
|
|
Connection conn = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
@ -301,7 +329,7 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
"SELECT DEVICE_ID, OPERATION_ID, SENT_DATE, RECEIVED_DATE, STATUS FROM" +
|
|
|
|
"SELECT DEVICE_ID, OPERATION_ID, SENT_DATE, RECEIVED_DATE, STATUS FROM" +
|
|
|
|
" MBL_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID = ? AND STATUS = ?";
|
|
|
|
" MBL_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID = ? AND STATUS = ?";
|
|
|
|
stmt = conn.prepareStatement(selectDBQuery);
|
|
|
|
stmt = conn.prepareStatement(selectDBQuery);
|
|
|
|
stmt.setString(1, deviceId);
|
|
|
|
stmt.setString(1, mblDeviceId);
|
|
|
|
stmt.setString(2, MobileDeviceOperationMapping.Status.NEW.name());
|
|
|
|
stmt.setString(2, MobileDeviceOperationMapping.Status.NEW.name());
|
|
|
|
ResultSet resultSet = stmt.executeQuery();
|
|
|
|
ResultSet resultSet = stmt.executeQuery();
|
|
|
|
while (resultSet.next()) {
|
|
|
|
while (resultSet.next()) {
|
|
|
@ -313,10 +341,13 @@ public class MobileDeviceOperationMappingDAOImpl implements MobileDeviceOperatio
|
|
|
|
mblDeviceOperation.setStatus(resultSet.getString(5));
|
|
|
|
mblDeviceOperation.setStatus(resultSet.getString(5));
|
|
|
|
mblDeviceOperations.add(mblDeviceOperation);
|
|
|
|
mblDeviceOperations.add(mblDeviceOperation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
|
|
|
log.debug("Fetched all pending MobileDevice-Mappings of DeviceId : " + mblDeviceId);
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
String msg =
|
|
|
|
String msg =
|
|
|
|
"Error occurred while fetching mapping table MBL_DEVICE_OPERATION entries of" +
|
|
|
|
"Error occurred while fetching mapping table MBL_DEVICE_OPERATION entries of" +
|
|
|
|
" device id - '" + deviceId;
|
|
|
|
" device id - '" + mblDeviceId;
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|