fixed issues raised through comments - commits

revert-70aa11f8
ayyoob 8 years ago
parent 035403495c
commit 1c3a89f57c

@ -32,6 +32,7 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration
import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager; import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager;
import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.ConfigProperties;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.DeviceTypeConfiguration; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.DeviceTypeConfiguration;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.Property; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.Property;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.PushNotificationProvider; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.PushNotificationProvider;
@ -113,13 +114,15 @@ public class DeviceTypeManagerService implements DeviceManagementService {
if (pushNotificationProvider != null) { if (pushNotificationProvider != null) {
if (pushNotificationProvider.isFileBasedProperties()) { if (pushNotificationProvider.isFileBasedProperties()) {
Map<String, String> staticProps = new HashMap<>(); Map<String, String> staticProps = new HashMap<>();
if (pushNotificationProvider.getConfigProperties() != null && ConfigProperties configProperties = pushNotificationProvider.getConfigProperties();
pushNotificationProvider.getConfigProperties().getProperty() != null && if (configProperties != null) {
pushNotificationProvider.getConfigProperties().getProperty().size() > 0) { List<Property> properties = configProperties.getProperty();
for (Property property : pushNotificationProvider.getConfigProperties().getProperty()) { if (properties != null && properties.size() > 0) {
for (Property property : properties) {
staticProps.put(property.getName(), property.getValue()); staticProps.put(property.getName(), property.getValue());
} }
} }
}
pushNotificationConfig = new PushNotificationConfig(pushNotificationProvider.getType(), pushNotificationConfig = new PushNotificationConfig(pushNotificationProvider.getType(),
pushNotificationProvider.isScheduled(), staticProps); pushNotificationProvider.isScheduled(), staticProps);
} else { } else {

@ -2121,17 +2121,13 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
operation.setType(Operation.Type.COMMAND); operation.setType(Operation.Type.COMMAND);
operation.setCode(str); operation.setCode(str);
try { try {
deviceManagementProviderService. deviceManagementProviderService.addOperation(deviceType, operation, deviceIdentifiers);
addOperation(deviceType,
operation, deviceIdentifiers);
} catch (OperationManagementException e) { } catch (OperationManagementException e) {
throw new DeviceManagementException( throw new DeviceManagementException("Unable to add the operation for the device with the id: '"
"Unable to find the device with the id: '" + deviceIdentifier.getId(), + deviceIdentifier.getId(), e);
e);
} catch (InvalidDeviceException e) { } catch (InvalidDeviceException e) {
throw new DeviceManagementException( throw new DeviceManagementException("Unable to find the device with the id: '"
"Unable to find the device with the id: '" + deviceIdentifier.getId(), + deviceIdentifier.getId(), e);
e);
} }
} }
} }

Loading…
Cancel
Save