|
|
@ -123,6 +123,7 @@ import org.wso2.carbon.device.mgt.core.DeviceManagementPluginRepository;
|
|
|
|
import org.wso2.carbon.device.mgt.core.cache.DeviceCacheKey;
|
|
|
|
import org.wso2.carbon.device.mgt.core.cache.DeviceCacheKey;
|
|
|
|
import org.wso2.carbon.device.mgt.core.cache.impl.BillingCacheManagerImpl;
|
|
|
|
import org.wso2.carbon.device.mgt.core.cache.impl.BillingCacheManagerImpl;
|
|
|
|
import org.wso2.carbon.device.mgt.core.cache.impl.DeviceCacheManagerImpl;
|
|
|
|
import org.wso2.carbon.device.mgt.core.cache.impl.DeviceCacheManagerImpl;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.common.Constants;
|
|
|
|
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
|
|
|
|
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
|
|
|
|
import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig;
|
|
|
|
import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig;
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.ApplicationDAO;
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.ApplicationDAO;
|
|
|
@ -146,6 +147,7 @@ import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.MetadataDAO;
|
|
|
|
import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOException;
|
|
|
|
import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOException;
|
|
|
|
import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory;
|
|
|
|
import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory;
|
|
|
|
import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation;
|
|
|
|
import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation;
|
|
|
|
import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
|
|
|
|
import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
|
|
|
|
import org.wso2.carbon.device.mgt.core.util.HttpReportingUtil;
|
|
|
|
import org.wso2.carbon.device.mgt.core.util.HttpReportingUtil;
|
|
|
|
import org.wso2.carbon.email.sender.core.ContentProviderInfo;
|
|
|
|
import org.wso2.carbon.email.sender.core.ContentProviderInfo;
|
|
|
@ -4877,4 +4879,34 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
paginationResult.setData(populateAllDeviceInfo(subscribedDeviceDetails));
|
|
|
|
paginationResult.setData(populateAllDeviceInfo(subscribedDeviceDetails));
|
|
|
|
return paginationResult;
|
|
|
|
return paginationResult;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public Boolean SendDeviceNameChangedNotification(Device device) throws DeviceManagementException {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
ProfileOperation operation = new ProfileOperation();
|
|
|
|
|
|
|
|
operation.setCode(Constants.SEND_USERNAME);
|
|
|
|
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
|
|
|
|
operation.setPayLoad(device.getName());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
|
|
|
|
|
|
|
|
deviceIdentifier.setId(device.getDeviceIdentifier());
|
|
|
|
|
|
|
|
deviceIdentifier.setType(device.getType());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DeviceIdentifier> deviceIdentifiers = new ArrayList<>();
|
|
|
|
|
|
|
|
deviceIdentifiers.add(deviceIdentifier);
|
|
|
|
|
|
|
|
Activity activity;
|
|
|
|
|
|
|
|
activity = addOperation(device.getType(), operation, deviceIdentifiers);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return activity != null;
|
|
|
|
|
|
|
|
} catch (OperationManagementException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred while sending operation";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
|
|
|
|
} catch (InvalidDeviceException e) {
|
|
|
|
|
|
|
|
String msg = "Invalid Device exception occurred";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|