mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Incorporating API changes introduced into the device management core
This commit is contained in:
parent
7f436f4f75
commit
fd7ab1aa54
@ -19,6 +19,9 @@
|
||||
package org.wso2.carbon.device.mgt.mobile;
|
||||
|
||||
import org.wso2.carbon.device.mgt.common.*;
|
||||
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.common.operation.mgt.OperationManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -20,12 +20,12 @@ package org.wso2.carbon.device.mgt.mobile.impl.android;
|
||||
|
||||
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.spi.DeviceManagerService;
|
||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManager;
|
||||
import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException;
|
||||
import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory;
|
||||
import org.wso2.carbon.device.mgt.mobile.dto.MobileDevice;
|
||||
import org.wso2.carbon.device.mgt.mobile.util.MobileDeviceManagementUtil;
|
||||
import org.wso2.carbon.device.mgt.common.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -33,21 +33,21 @@ import java.util.List;
|
||||
/**
|
||||
* This represents the Android implementation of DeviceManagerService.
|
||||
*/
|
||||
public class AndroidDeviceManagerService implements DeviceManagerService {
|
||||
public class AndroidDeviceManagerService implements DeviceManager {
|
||||
|
||||
private static final Log log = LogFactory.getLog(AndroidDeviceManagerService.class);
|
||||
private OperationManager operationManager;
|
||||
|
||||
public AndroidDeviceManagerService() {
|
||||
this.operationManager = new AndroidMobileOperationManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProviderType() {
|
||||
return DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public FeatureManager getFeatureManager() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enrollDevice(Device device) throws DeviceManagementException {
|
||||
boolean status;
|
||||
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
|
||||
@ -180,9 +180,4 @@ public class AndroidDeviceManagerService implements DeviceManagerService {
|
||||
return devices;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationManager getOperationManager() throws DeviceManagementException {
|
||||
return operationManager;
|
||||
}
|
||||
|
||||
}
|
||||
@ -21,6 +21,8 @@ package org.wso2.carbon.device.mgt.mobile.impl.android;
|
||||
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.operation.mgt.Operation;
|
||||
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
||||
import org.wso2.carbon.device.mgt.mobile.AbstractMobileOperationManager;
|
||||
import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException;
|
||||
import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory;
|
||||
@ -35,160 +37,156 @@ import java.util.List;
|
||||
|
||||
public class AndroidMobileOperationManager extends AbstractMobileOperationManager {
|
||||
|
||||
private static final Log log = LogFactory.getLog(AndroidMobileOperationManager.class);
|
||||
private static final Log log = LogFactory.getLog(AndroidMobileOperationManager.class);
|
||||
|
||||
@Override
|
||||
public boolean addOperation(Operation operation, List<DeviceIdentifier> devices) throws
|
||||
OperationManagementException {
|
||||
boolean status = false;
|
||||
try {
|
||||
MobileDeviceOperationMapping mobileDeviceOperationMapping = null;
|
||||
MobileOperation mobileOperation =
|
||||
MobileDeviceManagementUtil.convertToMobileOperation(operation);
|
||||
int operationId = MobileDeviceManagementDAOFactory.getMobileOperationDAO()
|
||||
.addMobileOperation(mobileOperation);
|
||||
if (operationId > 0) {
|
||||
for (MobileOperationProperty operationProperty : mobileOperation.getProperties()) {
|
||||
operationProperty.setOperationId(operationId);
|
||||
status = MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO()
|
||||
.addMobileOperationProperty(
|
||||
operationProperty);
|
||||
}
|
||||
for (DeviceIdentifier deviceIdentifier : devices) {
|
||||
mobileDeviceOperationMapping = new MobileDeviceOperationMapping();
|
||||
mobileDeviceOperationMapping.setOperationId(operationId);
|
||||
mobileDeviceOperationMapping.setDeviceId(deviceIdentifier.getId());
|
||||
mobileDeviceOperationMapping.setStatus(MobileDeviceOperationMapping.Status.NEW);
|
||||
status = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO()
|
||||
.addMobileDeviceOperationMapping(
|
||||
mobileDeviceOperationMapping);
|
||||
}
|
||||
}
|
||||
} catch (MobileDeviceManagementDAOException e) {
|
||||
String msg =
|
||||
"Error while adding an operation " + operation.getCode() + "to Android devices";
|
||||
log.error(msg, e);
|
||||
throw new OperationManagementException(msg, e);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@Override
|
||||
public boolean addOperation(Operation operation,
|
||||
List<DeviceIdentifier> devices) throws OperationManagementException {
|
||||
boolean status = false;
|
||||
try {
|
||||
MobileDeviceOperationMapping mobileDeviceOperationMapping = null;
|
||||
MobileOperation mobileOperation =
|
||||
MobileDeviceManagementUtil.convertToMobileOperation(operation);
|
||||
int operationId = MobileDeviceManagementDAOFactory.getMobileOperationDAO()
|
||||
.addMobileOperation(mobileOperation);
|
||||
if (operationId > 0) {
|
||||
for (MobileOperationProperty operationProperty : mobileOperation.getProperties()) {
|
||||
operationProperty.setOperationId(operationId);
|
||||
status = MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO()
|
||||
.addMobileOperationProperty(
|
||||
operationProperty);
|
||||
}
|
||||
for (DeviceIdentifier deviceIdentifier : devices) {
|
||||
mobileDeviceOperationMapping = new MobileDeviceOperationMapping();
|
||||
mobileDeviceOperationMapping.setOperationId(operationId);
|
||||
mobileDeviceOperationMapping.setDeviceId(deviceIdentifier.getId());
|
||||
mobileDeviceOperationMapping.setStatus(MobileDeviceOperationMapping.Status.NEW);
|
||||
status = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO()
|
||||
.addMobileDeviceOperationMapping(
|
||||
mobileDeviceOperationMapping);
|
||||
}
|
||||
}
|
||||
} catch (MobileDeviceManagementDAOException e) {
|
||||
String msg = "Error while adding an operation " + operation.getCode() + "to Android devices";
|
||||
log.error(msg, e);
|
||||
throw new OperationManagementException(msg, e);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Operation> getOperations(DeviceIdentifier deviceIdentifier)
|
||||
throws OperationManagementException {
|
||||
List<Operation> operations = new ArrayList<Operation>();
|
||||
List<MobileDeviceOperationMapping> mobileDeviceOperationMappings = null;
|
||||
List<MobileOperationProperty> operationProperties = null;
|
||||
MobileOperation mobileOperation = null;
|
||||
try {
|
||||
mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO()
|
||||
.getAllMobileDeviceOperationMappingsOfDevice(
|
||||
deviceIdentifier
|
||||
.getId());
|
||||
if (mobileDeviceOperationMappings.size() > 0) {
|
||||
List<Integer> operationIds = MobileDeviceManagementUtil
|
||||
.getMobileOperationIdsFromMobileDeviceOperations(
|
||||
mobileDeviceOperationMappings);
|
||||
for (Integer operationId : operationIds) {
|
||||
mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO()
|
||||
.getMobileOperation(
|
||||
operationId);
|
||||
operationProperties =
|
||||
MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO()
|
||||
.getAllMobileOperationPropertiesOfOperation(
|
||||
operationId);
|
||||
mobileOperation.setProperties(operationProperties);
|
||||
operations.add(MobileDeviceManagementUtil
|
||||
.convertMobileOperationToOperation(mobileOperation));
|
||||
}
|
||||
}
|
||||
} catch (MobileDeviceManagementDAOException e) {
|
||||
String msg =
|
||||
"Error while fetching the operations for the android device " +
|
||||
deviceIdentifier.getId();
|
||||
log.error(msg, e);
|
||||
throw new OperationManagementException(msg, e);
|
||||
}
|
||||
return operations;
|
||||
}
|
||||
@Override
|
||||
public List<Operation> getOperations(DeviceIdentifier deviceIdentifier)
|
||||
throws OperationManagementException {
|
||||
List<Operation> operations = new ArrayList<Operation>();
|
||||
List<MobileDeviceOperationMapping> mobileDeviceOperationMappings = null;
|
||||
List<MobileOperationProperty> operationProperties = null;
|
||||
MobileOperation mobileOperation = null;
|
||||
try {
|
||||
mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO()
|
||||
.getAllMobileDeviceOperationMappingsOfDevice(
|
||||
deviceIdentifier
|
||||
.getId());
|
||||
if (mobileDeviceOperationMappings.size() > 0) {
|
||||
List<Integer> operationIds = MobileDeviceManagementUtil
|
||||
.getMobileOperationIdsFromMobileDeviceOperations(
|
||||
mobileDeviceOperationMappings);
|
||||
for (Integer operationId : operationIds) {
|
||||
mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO().getMobileOperation(
|
||||
operationId);
|
||||
operationProperties =
|
||||
MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO()
|
||||
.getAllMobileOperationPropertiesOfOperation(
|
||||
operationId);
|
||||
mobileOperation.setProperties(operationProperties);
|
||||
operations.add(MobileDeviceManagementUtil.convertMobileOperationToOperation(mobileOperation));
|
||||
}
|
||||
}
|
||||
} catch (MobileDeviceManagementDAOException e) {
|
||||
String msg =
|
||||
"Error while fetching the operations for the android device " +
|
||||
deviceIdentifier.getId();
|
||||
log.error(msg, e);
|
||||
throw new OperationManagementException(msg, e);
|
||||
}
|
||||
return operations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Operation> getPendingOperations(DeviceIdentifier deviceIdentifier)
|
||||
throws OperationManagementException {
|
||||
List<Operation> operations = new ArrayList<Operation>();
|
||||
List<MobileDeviceOperationMapping> mobileDeviceOperationMappings = null;
|
||||
List<MobileOperationProperty> operationProperties = null;
|
||||
MobileOperation mobileOperation = null;
|
||||
try {
|
||||
//Get the list of pending operations for the given device
|
||||
mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO()
|
||||
.getAllPendingOperationMappingsOfMobileDevice(
|
||||
deviceIdentifier
|
||||
.getId());
|
||||
//Go through each operation mapping for retrieving the data corresponding to each operation
|
||||
for (MobileDeviceOperationMapping operation : mobileDeviceOperationMappings) {
|
||||
//Get the MobileOperation data
|
||||
mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO()
|
||||
.getMobileOperation(operation
|
||||
.getOperationId());
|
||||
//Get properties of the operation
|
||||
operationProperties =
|
||||
MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO()
|
||||
.getAllMobileOperationPropertiesOfOperation(
|
||||
operation.getOperationId());
|
||||
mobileOperation.setProperties(operationProperties);
|
||||
operations.add(MobileDeviceManagementUtil
|
||||
.convertMobileOperationToOperation(mobileOperation));
|
||||
//Update the MobileDeviceOperationMapping data to the In-Progress state
|
||||
operation.setStatus(MobileDeviceOperationMapping.Status.INPROGRESS);
|
||||
operation.setSentDate(new Date().getTime());
|
||||
MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO()
|
||||
.updateMobileDeviceOperationMappingToInProgress(
|
||||
operation.getDeviceId(),
|
||||
operation.getOperationId());
|
||||
}
|
||||
} catch (MobileDeviceManagementDAOException e) {
|
||||
String msg =
|
||||
"Error while fetching the operations for the android device " +
|
||||
deviceIdentifier.getId();
|
||||
log.error(msg, e);
|
||||
throw new OperationManagementException(msg, e);
|
||||
}
|
||||
return operations;
|
||||
}
|
||||
@Override
|
||||
public List<Operation> getPendingOperations(DeviceIdentifier deviceIdentifier)
|
||||
throws OperationManagementException {
|
||||
List<Operation> operations = new ArrayList<Operation>();
|
||||
List<MobileDeviceOperationMapping> mobileDeviceOperationMappings = null;
|
||||
List<MobileOperationProperty> operationProperties = null;
|
||||
MobileOperation mobileOperation = null;
|
||||
try {
|
||||
//Get the list of pending operations for the given device
|
||||
mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO()
|
||||
.getAllPendingOperationMappingsOfMobileDevice(
|
||||
deviceIdentifier
|
||||
.getId());
|
||||
//Go through each operation mapping for retrieving the data corresponding to each operation
|
||||
for (MobileDeviceOperationMapping operation : mobileDeviceOperationMappings) {
|
||||
//Get the MobileOperation data
|
||||
mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO()
|
||||
.getMobileOperation(operation
|
||||
.getOperationId());
|
||||
//Get properties of the operation
|
||||
operationProperties =
|
||||
MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO()
|
||||
.getAllMobileOperationPropertiesOfOperation(
|
||||
operation.getOperationId());
|
||||
mobileOperation.setProperties(operationProperties);
|
||||
operations.add(MobileDeviceManagementUtil
|
||||
.convertMobileOperationToOperation(mobileOperation));
|
||||
//Update the MobileDeviceOperationMapping data to the In-Progress state
|
||||
operation.setStatus(MobileDeviceOperationMapping.Status.INPROGRESS);
|
||||
operation.setSentDate(new Date().getTime());
|
||||
MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO()
|
||||
.updateMobileDeviceOperationMappingToInProgress(
|
||||
operation.getDeviceId(),
|
||||
operation.getOperationId());
|
||||
}
|
||||
} catch (MobileDeviceManagementDAOException e) {
|
||||
String msg =
|
||||
"Error while fetching the operations for the android device " +
|
||||
deviceIdentifier.getId();
|
||||
log.error(msg, e);
|
||||
throw new OperationManagementException(msg, e);
|
||||
}
|
||||
return operations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Feature> getFeatures(String deviceType) throws FeatureManagementException {
|
||||
MobileFeatureDAO featureDAO = MobileDeviceManagementDAOFactory.getFeatureDAO();
|
||||
MobileFeaturePropertyDAO featurePropertyDAO = MobileDeviceManagementDAOFactory.getFeaturePropertyDAO();
|
||||
List<Feature> features = new ArrayList<Feature>();
|
||||
try {
|
||||
List<MobileFeature> mobileFeatures = featureDAO.getMobileFeatureByDeviceType(deviceType);
|
||||
for (MobileFeature mobileFeature : mobileFeatures) {
|
||||
Feature feature = new Feature();
|
||||
feature.setId(mobileFeature.getId());
|
||||
feature.setDeviceType(mobileFeature.getDeviceType());
|
||||
feature.setName(mobileFeature.getName());
|
||||
feature.setDescription(mobileFeature.getDescription());
|
||||
List<Feature.MetadataEntry> metadataEntries = new ArrayList<Feature.MetadataEntry>();
|
||||
List<MobileFeatureProperty> properties =
|
||||
featurePropertyDAO.getFeaturePropertiesOfFeature(mobileFeature.getId());
|
||||
for (MobileFeatureProperty property : properties) {
|
||||
Feature.MetadataEntry metaEntry = new Feature.MetadataEntry();
|
||||
metaEntry.setId(property.getFeatureID());
|
||||
metaEntry.setValue(property.getProperty());
|
||||
metadataEntries.add(metaEntry);
|
||||
}
|
||||
feature.setMetadataEntries(metadataEntries);
|
||||
features.add(feature);
|
||||
}
|
||||
} catch (MobileDeviceManagementDAOException e) {
|
||||
String msg = "Error while fetching the features for the device type " + deviceType;
|
||||
log.error(msg, e);
|
||||
throw new FeatureManagementException(msg, e);
|
||||
}
|
||||
return features;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Feature> getFeaturesForDeviceType(String deviceType) throws FeatureManagementException {
|
||||
MobileFeatureDAO featureDAO = MobileDeviceManagementDAOFactory.getFeatureDAO();
|
||||
MobileFeaturePropertyDAO featurePropertyDAO = MobileDeviceManagementDAOFactory.getFeaturePropertyDAO();
|
||||
List<Feature> features = new ArrayList<Feature>();
|
||||
try {
|
||||
List<MobileFeature> mobileFeatures = featureDAO.getMobileFeatureByDeviceType(deviceType);
|
||||
for (MobileFeature mobileFeature : mobileFeatures) {
|
||||
Feature feature = new Feature();
|
||||
feature.setId(mobileFeature.getId());
|
||||
feature.setDeviceType(mobileFeature.getDeviceType());
|
||||
feature.setName(mobileFeature.getName());
|
||||
feature.setDescription(mobileFeature.getDescription());
|
||||
List<Feature.MetadataEntry> metadataEntries = new ArrayList<Feature.MetadataEntry>();
|
||||
List<MobileFeatureProperty> properties =
|
||||
featurePropertyDAO.getFeaturePropertiesOfFeature(mobileFeature.getId());
|
||||
for (MobileFeatureProperty property : properties) {
|
||||
Feature.MetadataEntry metaEntry = new Feature.MetadataEntry();
|
||||
metaEntry.setId(property.getFeatureID());
|
||||
metaEntry.setValue(property.getProperty());
|
||||
metadataEntries.add(metaEntry);
|
||||
}
|
||||
feature.setMetadataEntries(metadataEntries);
|
||||
features.add(feature);
|
||||
}
|
||||
} catch (MobileDeviceManagementDAOException e) {
|
||||
String msg =
|
||||
"Error while fetching the features for the device type " +
|
||||
deviceType;
|
||||
log.error(msg, e);
|
||||
throw new FeatureManagementException(msg, e);
|
||||
}
|
||||
return features;
|
||||
}
|
||||
}
|
||||
@ -19,20 +19,25 @@
|
||||
package org.wso2.carbon.device.mgt.mobile.impl.ios;
|
||||
|
||||
import org.wso2.carbon.device.mgt.common.*;
|
||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService;
|
||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This represents the iOS implementation of DeviceManagerService.
|
||||
*/
|
||||
public class IOSDeviceManagerService implements DeviceManagerService {
|
||||
public class IOSDeviceManagerService implements DeviceManager {
|
||||
|
||||
@Override
|
||||
public String getProviderType() {
|
||||
return DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_IOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureManager getFeatureManager() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enrollDevice(Device device) throws DeviceManagementException {
|
||||
return true;
|
||||
@ -80,11 +85,6 @@ public class IOSDeviceManagerService implements DeviceManagerService {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationManager getOperationManager() throws DeviceManagementException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateDeviceInfo(Device device) throws DeviceManagementException {
|
||||
return true;
|
||||
|
||||
@ -19,20 +19,25 @@
|
||||
package org.wso2.carbon.device.mgt.mobile.impl.windows;
|
||||
|
||||
import org.wso2.carbon.device.mgt.common.*;
|
||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService;
|
||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This represents the Windows implementation of DeviceManagerService.
|
||||
*/
|
||||
public class WindowsDeviceManagerService implements DeviceManagerService {
|
||||
public class WindowsDeviceManagerService implements DeviceManager {
|
||||
|
||||
@Override
|
||||
public String getProviderType() {
|
||||
return DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureManager getFeatureManager() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enrollDevice(Device device) throws DeviceManagementException {
|
||||
return true;
|
||||
@ -79,11 +84,6 @@ public class WindowsDeviceManagerService implements DeviceManagerService {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationManager getOperationManager() throws DeviceManagementException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateDeviceInfo(Device device) throws DeviceManagementException {
|
||||
return true;
|
||||
|
||||
@ -25,17 +25,17 @@ import org.wso2.carbon.apimgt.api.APIManagementException;
|
||||
import org.wso2.carbon.apimgt.api.APIProvider;
|
||||
import org.wso2.carbon.apimgt.impl.APIManagerFactory;
|
||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService;
|
||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManager;
|
||||
import org.wso2.carbon.device.mgt.mobile.DataSourceListener;
|
||||
import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManagerService;
|
||||
import org.wso2.carbon.device.mgt.mobile.config.APIConfig;
|
||||
import org.wso2.carbon.device.mgt.mobile.config.MobileDeviceConfigurationManager;
|
||||
import org.wso2.carbon.device.mgt.mobile.config.MobileDeviceManagementConfig;
|
||||
import org.wso2.carbon.device.mgt.mobile.config.datasource.MobileDataSourceConfig;
|
||||
import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory;
|
||||
import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManagerService;
|
||||
import org.wso2.carbon.device.mgt.mobile.impl.ios.IOSDeviceManagerService;
|
||||
import org.wso2.carbon.device.mgt.mobile.util.DeviceManagementAPIPublisherUtil;
|
||||
import org.wso2.carbon.device.mgt.mobile.impl.windows.WindowsDeviceManagerService;
|
||||
import org.wso2.carbon.device.mgt.mobile.util.DeviceManagementAPIPublisherUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -69,13 +69,13 @@ public class MobileDeviceManagementBundleActivator implements BundleActivator, B
|
||||
MobileDeviceManagementDAOFactory.setMobileDataSourceConfig(dsConfig);
|
||||
|
||||
androidServiceRegRef =
|
||||
bundleContext.registerService(DeviceManagerService.class.getName(),
|
||||
bundleContext.registerService(DeviceManager.class.getName(),
|
||||
new AndroidDeviceManagerService(), null);
|
||||
iOSServiceRegRef =
|
||||
bundleContext.registerService(DeviceManagerService.class.getName(),
|
||||
bundleContext.registerService(DeviceManager.class.getName(),
|
||||
new IOSDeviceManagerService(), null);
|
||||
windowsServiceRegRef =
|
||||
bundleContext.registerService(DeviceManagerService.class.getName(),
|
||||
bundleContext.registerService(DeviceManager.class.getName(),
|
||||
new WindowsDeviceManagerService(), null);
|
||||
|
||||
/* Initialize all API configurations with corresponding API Providers */
|
||||
|
||||
@ -23,14 +23,10 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceRegistration;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.wso2.carbon.apimgt.api.APIManagementException;
|
||||
import org.wso2.carbon.apimgt.api.APIProvider;
|
||||
import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService;
|
||||
import org.wso2.carbon.apimgt.impl.APIManagerFactory;
|
||||
import org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil;
|
||||
import org.wso2.carbon.core.ServerStartupObserver;
|
||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService;
|
||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManager;
|
||||
import org.wso2.carbon.device.mgt.mobile.MobileDeviceManagementStartupObserver;
|
||||
import org.wso2.carbon.device.mgt.mobile.config.APIConfig;
|
||||
import org.wso2.carbon.device.mgt.mobile.config.MobileDeviceConfigurationManager;
|
||||
@ -100,13 +96,13 @@ public class MobileDeviceManagementServiceComponent {
|
||||
}
|
||||
|
||||
androidServiceRegRef =
|
||||
bundleContext.registerService(DeviceManagerService.class.getName(),
|
||||
bundleContext.registerService(DeviceManager.class.getName(),
|
||||
new AndroidDeviceManagerService(), null);
|
||||
iOSServiceRegRef =
|
||||
bundleContext.registerService(DeviceManagerService.class.getName(),
|
||||
bundleContext.registerService(DeviceManager.class.getName(),
|
||||
new IOSDeviceManagerService(), null);
|
||||
windowsServiceRegRef =
|
||||
bundleContext.registerService(DeviceManagerService.class.getName(),
|
||||
bundleContext.registerService(DeviceManager.class.getName(),
|
||||
new WindowsDeviceManagerService(), null);
|
||||
|
||||
serverStartupObserverRef = bundleContext.registerService(ServerStartupObserver.class,
|
||||
|
||||
@ -23,7 +23,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.w3c.dom.Document;
|
||||
import org.wso2.carbon.device.mgt.common.Device;
|
||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||
import org.wso2.carbon.device.mgt.common.Operation;
|
||||
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
||||
import org.wso2.carbon.device.mgt.mobile.dto.MobileDevice;
|
||||
import org.wso2.carbon.device.mgt.mobile.dto.MobileDeviceOperationMapping;
|
||||
import org.wso2.carbon.device.mgt.mobile.dto.MobileOperation;
|
||||
@ -117,7 +117,7 @@ public class MobileDeviceManagementUtil {
|
||||
return device;
|
||||
}
|
||||
|
||||
public static MobileOperation convertToMobileOperation(org.wso2.carbon.device.mgt.common.Operation operation) {
|
||||
public static MobileOperation convertToMobileOperation(Operation operation) {
|
||||
MobileOperation mobileOperation = new MobileOperation();
|
||||
MobileOperationProperty operationProperty = null;
|
||||
List<MobileOperationProperty> properties = new LinkedList<MobileOperationProperty>();
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<parent>
|
||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||
@ -35,7 +36,7 @@
|
||||
<url>http://wso2.org</url>
|
||||
|
||||
<modules>
|
||||
<module>org.wso2.carbon.device.mgt.mobile.feature</module>
|
||||
<module>org.wso2.carbon.device.mgt.mobile.feature</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
|
||||
16
pom.xml
16
pom.xml
@ -201,22 +201,22 @@
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
||||
<version>${cdm.core.version}</version>
|
||||
<version>${carbon.device.mgt.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
||||
<version>${cdm.core.version}</version>
|
||||
<version>${carbon.device.mgt.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<artifactId>org.wso2.carbon.policy.mgt.common</artifactId>
|
||||
<version>${cdm.core.version}</version>
|
||||
<version>${carbon.device.mgt.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||
<artifactId>org.wso2.carbon.policy.mgt.core</artifactId>
|
||||
<version>${cdm.core.version}</version>
|
||||
<version>${carbon.device.mgt.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--MDM dependencies-->
|
||||
@ -422,10 +422,6 @@
|
||||
<carbon.kernel.version>4.3.0</carbon.kernel.version>
|
||||
<carbon.kernel.version.range>[4.3.0, 4.4.0)</carbon.kernel.version.range>
|
||||
|
||||
<!--CDM versions-->
|
||||
<cdm.core.version>0.9.0</cdm.core.version>
|
||||
<cdm.core.version.range>[0.8.0, 2.0.0)</cdm.core.version.range>
|
||||
|
||||
<carbon.p2.plugin.version>1.5.4</carbon.p2.plugin.version>
|
||||
|
||||
<!--Maven build number plugin-->
|
||||
@ -445,7 +441,6 @@
|
||||
<orbit.tomcat.version>7.0.52.wso2v5</orbit.tomcat.version>
|
||||
<orbit.tomcat.jdbc.pooling.version>7.0.34.wso2v2</orbit.tomcat.jdbc.pooling.version>
|
||||
|
||||
|
||||
<!--CXF properties-->
|
||||
<cxf.version>2.6.1</cxf.version>
|
||||
<jackson.version>1.9.0</jackson.version>
|
||||
@ -470,7 +465,8 @@
|
||||
<carbon.governance.version>4.3.0</carbon.governance.version>
|
||||
|
||||
<!-- Device Management -->
|
||||
<carbon.device.mgt.version>0.9.0</carbon.device.mgt.version>
|
||||
<carbon.device.mgt.version>0.9.2-SNAPSHOT</carbon.device.mgt.version>
|
||||
<carbon.device.mgt.version.range>0.9.2-SNAPSHOT</carbon.device.mgt.version.range>
|
||||
|
||||
<!-- Mobile Device Management -->
|
||||
<carbon.mobile.device.mgt.version>1.9.1-SNAPSHOT</carbon.mobile.device.mgt.version>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user