minor code consistency fixes #11

Merged
deenath merged 1 commits from traccar_consistency_issue into master 2 years ago

@ -491,9 +491,9 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
return false;
}
boolean status = deviceManager.modifyEnrollment(device);
int tenantId = this.getTenantId();
Device currentDevice = this.getDevice(deviceIdentifier, false);
try {
int tenantId = this.getTenantId();
Device currentDevice = this.getDevice(deviceIdentifier, false);
DeviceManagementDAOFactory.beginTransaction();
device.setId(currentDevice.getId());
if (device.getEnrolmentInfo().getId() == 0) {
@ -530,7 +530,6 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
//enroll Traccar device
if (HttpReportingUtil.isTrackerEnabled()) {
try {
int tenantId = this.getTenantId();
DeviceManagementDataHolder.getInstance().getDeviceAPIClientService().modifyDevice(device, tenantId);
} catch (ExecutionException e) {
log.error("ExecutionException : " + e);

@ -54,6 +54,7 @@ public interface DeviceAPIClientService {
* Updates device Traccar configuration records (like device name)
*
* @params device to be modifies
* @param tenantId of the device
* @throws TrackerManagementDAOException errors thrown while modifing a traccar device
*/
void modifyDevice(Device device, int tenantId) throws ExecutionException, InterruptedException;

@ -474,6 +474,7 @@ public class TraccarClientFactory {
*
* @param traccarDevice with DeviceName UniqueId, Status, Disabled LastUpdate, PositionId, GroupId
* Model, Contact, Category, fenceIds
* @param tenantId tentantId of the specific device
* @throws TrackerManagementDAOException Failed while add Traccar Device the operation
*/
public void modifyDevice(TraccarDevice traccarDevice, int tenantId) throws TrackerManagementDAOException, ExecutionException, InterruptedException {
@ -511,8 +512,7 @@ public class TraccarClientFactory {
try {
addDevice(traccarDevice, tenantId);
} catch (TrackerAlreadyExistException e) {
String msg = "The device already exist";
log.error(msg, e);
log.error("The device already exist", e);
}
}
}

@ -68,8 +68,7 @@ public class DeviceAPIClientServiceImpl implements DeviceAPIClientService {
try {
client.modifyDevice(traccarDevice, tenantId);
} catch (TrackerManagementDAOException e) {
String msg = "Error occurred while mapping with deviceId";
log.error(msg, e);
log.error("Error occurred while mapping with deviceId\"", e);
}
}

Loading…
Cancel
Save