|
|
@ -69,7 +69,6 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
|
|
|
|
private static final Log log = LogFactory.getLog(DeviceInformationManagerImpl.class);
|
|
|
|
private static final Log log = LogFactory.getLog(DeviceInformationManagerImpl.class);
|
|
|
|
private static final String LOCATION_EVENT_STREAM_DEFINITION = "org.wso2.iot.LocationStream";
|
|
|
|
private static final String LOCATION_EVENT_STREAM_DEFINITION = "org.wso2.iot.LocationStream";
|
|
|
|
private static final String DEVICE_INFO_EVENT_STREAM_DEFINITION = "org.wso2.iot.DeviceInfoStream";
|
|
|
|
private static final String DEVICE_INFO_EVENT_STREAM_DEFINITION = "org.wso2.iot.DeviceInfoStream";
|
|
|
|
private static final String IS_EVENT_PUBLISHING_ENABED = "isEventPublishingEnabled";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DeviceInformationManagerImpl() {
|
|
|
|
public DeviceInformationManagerImpl() {
|
|
|
|
this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
|
|
|
|
this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
|
|
|
@ -183,7 +182,8 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
|
|
|
|
|
|
|
|
|
|
|
|
private void publishEvents(Device device, DeviceInfo deviceInfo) {
|
|
|
|
private void publishEvents(Device device, DeviceInfo deviceInfo) {
|
|
|
|
String reportingHost = HttpReportingUtil.getReportingHost();
|
|
|
|
String reportingHost = HttpReportingUtil.getReportingHost();
|
|
|
|
if (!StringUtils.isBlank(reportingHost) && isPublishingEnabledForTenant()) {
|
|
|
|
if (!StringUtils.isBlank(reportingHost)
|
|
|
|
|
|
|
|
&& HttpReportingUtil.isPublishingEnabledForTenant()) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
DeviceDetailsWrapper deviceDetailsWrapper = new DeviceDetailsWrapper();
|
|
|
|
DeviceDetailsWrapper deviceDetailsWrapper = new DeviceDetailsWrapper();
|
|
|
|
deviceDetailsWrapper.setDevice(device);
|
|
|
|
deviceDetailsWrapper.setDevice(device);
|
|
|
@ -220,14 +220,6 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private boolean isPublishingEnabledForTenant() {
|
|
|
|
|
|
|
|
Object configuration = DeviceManagerUtil.getConfiguration(IS_EVENT_PUBLISHING_ENABED);
|
|
|
|
|
|
|
|
if (configuration != null) {
|
|
|
|
|
|
|
|
return Boolean.valueOf(configuration.toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public DeviceInfo getDeviceInfo(DeviceIdentifier deviceId) throws DeviceDetailsMgtException {
|
|
|
|
public DeviceInfo getDeviceInfo(DeviceIdentifier deviceId) throws DeviceDetailsMgtException {
|
|
|
|
Device device = getDevice(deviceId);
|
|
|
|
Device device = getDevice(deviceId);
|
|
|
|