revert-70aa11f8
geethkokila 10 years ago
commit ebc2e669cc

@ -19,6 +19,7 @@ package org.wso2.carbon.device.mgt.common.app.mgt;
import org.wso2.carbon.device.mgt.common.Application;
import org.wso2.carbon.device.mgt.common.Credential;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import java.util.List;

@ -18,10 +18,7 @@
package org.wso2.carbon.device.mgt.common.spi;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.FeatureManager;
import org.wso2.carbon.device.mgt.common.*;
import java.util.List;
@ -124,7 +121,7 @@ public interface DeviceManager {
* @param device Updated device information related data
* @throws DeviceManagementException If some unusual behaviour is observed while updating the device info
*/
boolean updateDeviceInfo(Device device) throws DeviceManagementException;
boolean updateDeviceInfo(Device device, List<Application> applicationList) throws DeviceManagementException;
/**
* Method to set the ownership type of a particular device. i.e. BYOD, COPE.

@ -378,10 +378,10 @@ public class DeviceManagementServiceProviderImpl implements DeviceManagementServ
}
@Override
public boolean updateDeviceInfo(Device device) throws DeviceManagementException {
public boolean updateDeviceInfo(Device device, List<Application> applicationList) throws DeviceManagementException {
DeviceManager dms =
this.getPluginRepository().getDeviceManagementProvider(device.getType());
return dms.updateDeviceInfo(device);
return dms.updateDeviceInfo(device,applicationList);
}
@Override

@ -17,18 +17,21 @@
*/
package org.wso2.carbon.device.mgt.core.app.mgt;
import org.wso2.carbon.device.mgt.common.Application;
import org.wso2.carbon.device.mgt.common.Credential;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.*;
import org.wso2.carbon.device.mgt.common.app.mgt.AppManagerConnector;
import org.wso2.carbon.device.mgt.common.app.mgt.AppManagerConnectorException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
import java.util.ArrayList;
import java.util.List;
public class AppManagementServiceImpl implements AppManagerConnector {
private static final Log log = LogFactory.getLog(AppManagementServiceImpl.class);
@Override
public Application[] getApplicationList(String domain, int pageNumber, int size) throws AppManagerConnectorException {
return DeviceManagementDataHolder.getInstance().getAppManager().getApplicationList(domain, pageNumber, size);
@ -55,6 +58,14 @@ public class AppManagementServiceImpl implements AppManagerConnector {
@Override
public void installApplication(Operation operation, List<DeviceIdentifier> deviceIdentifiers)
throws AppManagerConnectorException {
try {
DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().addOperation(operation,
deviceIdentifiers);
} catch (OperationManagementException opMgtEx) {
String errorMsg = "Error occurred when add operations at install application";
log.error(errorMsg, opMgtEx);
throw new AppManagerConnectorException();
}
DeviceManagementDataHolder.getInstance().getAppManager().installApplication(operation, deviceIdentifiers);
}

@ -98,8 +98,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
}
@Override
public boolean updateDeviceInfo(Device device) throws DeviceManagementException {
return DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().updateDeviceInfo(device);
public boolean updateDeviceInfo(Device device, List<Application> applicationList) throws DeviceManagementException {
return DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().
updateDeviceInfo(device, applicationList);
}
@Override

@ -79,7 +79,7 @@ public class TestDeviceManager implements DeviceMgtService {
}
@Override
public boolean updateDeviceInfo(Device device) throws DeviceManagementException {
public boolean updateDeviceInfo(Device device, List<Application> applicationList) throws DeviceManagementException {
return false;
}

Loading…
Cancel
Save