mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
removed unwanted codes
This commit is contained in:
parent
e88d5e9c3b
commit
6f79180920
@ -421,14 +421,13 @@ public class TraccarClientImpl implements TraccarClient {
|
||||
authorizedKey(HttpReportingUtil.trackerUser(), HttpReportingUtil.trackerPassword()),
|
||||
serverUrl(HttpReportingUtil.trackerServer())));
|
||||
String result = res.get();
|
||||
log.info("---------res--------" + result);
|
||||
log.info("---------result--------");
|
||||
if(result.charAt(0)=='{'){
|
||||
JSONObject obj = new JSONObject(result);
|
||||
if (obj.has("id")){
|
||||
int traccarDeviceId = obj.getInt("id");
|
||||
int deviceId = traccarDevice.getId();
|
||||
log.info("TraccarDeviceId - " + traccarDeviceId);
|
||||
log.info("DeviceId - " + deviceId);
|
||||
try {
|
||||
TrackerManagementDAOFactory.beginTransaction();
|
||||
trackerDAO.addTrackerDevice(traccarDeviceId, deviceId, tenantId);
|
||||
@ -486,6 +485,7 @@ public class TraccarClientImpl implements TraccarClient {
|
||||
addDevice(device, tenantId);
|
||||
}else{
|
||||
//Update Location
|
||||
log.info("Updating Location");
|
||||
String method = TraccarHandlerConstants.Methods.GET;
|
||||
String url = locationUpdatePort+"/?id="+deviceInfo.getDeviceIdentifier()+
|
||||
"×tamp="+deviceInfo.getTimestamp()+"&lat="+deviceInfo.getLat()+
|
||||
@ -494,7 +494,7 @@ public class TraccarClientImpl implements TraccarClient {
|
||||
|
||||
executor.submit(new OkHttpClientThreadPool(url, null, method,
|
||||
authorizedKey(HttpReportingUtil.trackerUser(), HttpReportingUtil.trackerPassword()),
|
||||
serverUrl(HttpReportingUtil.trackerServer())));
|
||||
"http://localhost:"));
|
||||
//executor.shutdown();
|
||||
}
|
||||
}
|
||||
@ -515,9 +515,6 @@ public class TraccarClientImpl implements TraccarClient {
|
||||
|
||||
log.info("------deviceId-----" + deviceId);
|
||||
log.info(trackerDeviceInfo);
|
||||
log.info(new Gson().toJson(trackerDeviceInfo));
|
||||
log.info(trackerDeviceInfo.getDeviceId());
|
||||
log.info(trackerDeviceInfo.getTraccarDeviceId());
|
||||
if(trackerDeviceInfo!=null){
|
||||
//trackerDevice = new JSONObject(trackerDeviceInfo);
|
||||
int status = trackerDAO.removeTrackerDevice(deviceId, tenantId);
|
||||
@ -540,11 +537,7 @@ public class TraccarClientImpl implements TraccarClient {
|
||||
TrackerManagementDAOFactory.closeConnection();
|
||||
}
|
||||
|
||||
log.info("__________________");
|
||||
log.info(new Gson().toJson(trackerPermissionInfo));
|
||||
log.info(trackerPermissionInfo.get(0));
|
||||
log.info(new Gson().toJson(trackerPermissionInfo.get(0)));
|
||||
log.info("__________________");
|
||||
log.info("--------Disenrolling Device--------");
|
||||
//Delete from traccar
|
||||
if(trackerDeviceInfo!=null){
|
||||
String method = TraccarHandlerConstants.Methods.DELETE;
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<Properties>
|
||||
<Property name="sample-property">sample</Property>
|
||||
<Property name="api-endpoint">http://localhost:</Property>
|
||||
<Property name="default-port">8085</Property>
|
||||
<Property name="default-port"></Property>
|
||||
<Property name="location-update-port">5055</Property>
|
||||
<Property name="authorization">Authorization</Property>
|
||||
<Property name="authorization-key">Basic YWRtaW46YWRtaW4=</Property>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user