mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
add reporting config
This commit is contained in:
parent
cf6714c7cf
commit
20a9a98eb1
@ -146,5 +146,6 @@ public final class DeviceManagementConstants {
|
||||
}
|
||||
public static final String REPORTING_CONTEXT = "/event";
|
||||
public static final String DEVICE_INFO_ENDPOINT = REPORTING_CONTEXT + "/device-info";
|
||||
public static final String REPORTING_EVENT_HOST = "iot.reporting.event.host";
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,12 +94,17 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
|
||||
device.getEnrolmentInfo().getId());
|
||||
DeviceManagementDAOFactory.commitTransaction();
|
||||
|
||||
DeviceDetailsWrapper deviceDetailsWrapper = new DeviceDetailsWrapper();
|
||||
deviceDetailsWrapper.setDevice(device);
|
||||
deviceDetailsWrapper.setDeviceInfo(deviceInfo);
|
||||
deviceDetailsWrapper.getJSONString();
|
||||
HttpReportingUtil.invokeApi(deviceDetailsWrapper.getJSONString(),
|
||||
"http://localhost:8081" + DeviceManagementConstants.Report.DEVICE_INFO_ENDPOINT);
|
||||
String reportingHost = System.getProperty(DeviceManagementConstants.Report
|
||||
.REPORTING_EVENT_HOST);
|
||||
if (reportingHost != null && !reportingHost.isEmpty()) {
|
||||
DeviceDetailsWrapper deviceDetailsWrapper = new DeviceDetailsWrapper();
|
||||
deviceDetailsWrapper.setDevice(device);
|
||||
deviceDetailsWrapper.setDeviceInfo(deviceInfo);
|
||||
deviceDetailsWrapper.getJSONString();
|
||||
|
||||
HttpReportingUtil.invokeApi(deviceDetailsWrapper.getJSONString(),
|
||||
reportingHost + DeviceManagementConstants.Report.DEVICE_INFO_ENDPOINT);
|
||||
}
|
||||
|
||||
//TODO :: This has to be fixed by adding the enrollment ID.
|
||||
if (DeviceManagerUtil.isPublishDeviceInfoResponseEnabled()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user