diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/plugin/impl/AndroidSenseManager.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/plugin/impl/AndroidSenseManager.java index f5bd7e61e3..fff692b379 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/plugin/impl/AndroidSenseManager.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/plugin/impl/AndroidSenseManager.java @@ -25,7 +25,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.FeatureManager; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.iot.androidsense.plugin.exception.AndroidSenseDeviceMgtPluginException; @@ -49,14 +49,14 @@ public class AndroidSenseManager implements DeviceManager { } @Override - public boolean saveConfiguration(TenantConfiguration tenantConfiguration) + public boolean saveConfiguration(PlatformConfiguration PlatformConfiguration) throws DeviceManagementException { //TODO implement this return false; } @Override - public TenantConfiguration getConfiguration() throws DeviceManagementException { + public PlatformConfiguration getConfiguration() throws DeviceManagementException { //TODO implement this return null; } diff --git a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/plugin/impl/ArduinoManager.java b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/plugin/impl/ArduinoManager.java index 35dbdb4ea5..c3d80d8d6f 100644 --- a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/plugin/impl/ArduinoManager.java +++ b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/plugin/impl/ArduinoManager.java @@ -27,7 +27,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.FeatureManager; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.iot.arduino.plugin.exception.ArduinoDeviceMgtPluginException; @@ -51,14 +51,14 @@ public class ArduinoManager implements DeviceManager { } @Override - public boolean saveConfiguration(TenantConfiguration tenantConfiguration) + public boolean saveConfiguration(PlatformConfiguration PlatformConfiguration) throws DeviceManagementException { //TODO implement this return false; } @Override - public TenantConfiguration getConfiguration() throws DeviceManagementException { + public PlatformConfiguration getConfiguration() throws DeviceManagementException { //TODO implement this return null; } diff --git a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/plugin/impl/RaspberrypiManager.java b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/plugin/impl/RaspberrypiManager.java index eec07bf7cf..00370b8bf5 100644 --- a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/plugin/impl/RaspberrypiManager.java +++ b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/plugin/impl/RaspberrypiManager.java @@ -26,7 +26,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.FeatureManager; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.exception.RaspberrypiDeviceMgtPluginException; @@ -49,13 +49,13 @@ public class RaspberrypiManager implements DeviceManager { } @Override - public boolean saveConfiguration(TenantConfiguration tenantConfiguration) + public boolean saveConfiguration(PlatformConfiguration tenantConfiguration) throws DeviceManagementException { return false; } @Override - public TenantConfiguration getConfiguration() throws DeviceManagementException { + public PlatformConfiguration getConfiguration() throws DeviceManagementException { return null; } diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/VirtualFireAlarmManager.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/VirtualFireAlarmManager.java index 557376624f..96617f47b4 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/VirtualFireAlarmManager.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/impl/VirtualFireAlarmManager.java @@ -26,7 +26,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.FeatureManager; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.exception.VirtualFirealarmDeviceMgtPluginException; @@ -50,13 +50,13 @@ public class VirtualFireAlarmManager implements DeviceManager { } @Override - public boolean saveConfiguration(TenantConfiguration tenantConfiguration) + public boolean saveConfiguration(PlatformConfiguration PlatformConfiguration) throws DeviceManagementException { return false; } @Override - public TenantConfiguration getConfiguration() throws DeviceManagementException { + public PlatformConfiguration getConfiguration() throws DeviceManagementException { return null; } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/configuration/ConfigurationMgtService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/configuration/ConfigurationMgtService.java index f47999149b..c05579aafc 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/configuration/ConfigurationMgtService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/configuration/ConfigurationMgtService.java @@ -19,7 +19,7 @@ package org.wso2.carbon.mdm.services.android.services.configuration; import io.swagger.annotations.*; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -46,14 +46,14 @@ public interface ConfigurationMgtService { @ApiResponse(code = 500, message = "Internal Server Error") }) Response configureSettings(@ApiParam(name = "configuration", value = "AndroidPlatformConfiguration") - TenantConfiguration configuration) throws AndroidAgentException; + PlatformConfiguration configuration) throws AndroidAgentException; @GET @ApiOperation( httpMethod = "GET", value = "Getting Android Platform Configurations", notes = "Get the Android platform configuration details using this REST API", - response = TenantConfiguration.class + response = PlatformConfiguration.class ) @ApiResponses(value = { @ApiResponse(code = 200, message = "Get Android Configurations"), @@ -75,5 +75,5 @@ public interface ConfigurationMgtService { "Android platform") }) Response updateConfiguration(@ApiParam(name = "configuration", value = "AndroidPlatformConfiguration") - TenantConfiguration configuration) throws AndroidAgentException; + PlatformConfiguration configuration) throws AndroidAgentException; } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/configuration/impl/ConfigurationMgtServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/configuration/impl/ConfigurationMgtServiceImpl.java index 9517f88e43..57f5d7693d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/configuration/impl/ConfigurationMgtServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/configuration/impl/ConfigurationMgtServiceImpl.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException; import org.wso2.carbon.mdm.services.android.services.configuration.ConfigurationMgtService; @@ -45,7 +45,7 @@ public class ConfigurationMgtServiceImpl implements ConfigurationMgtService { private static Log log = LogFactory.getLog(ConfigurationMgtServiceImpl.class); @POST - public Response configureSettings(TenantConfiguration configuration) + public Response configureSettings(PlatformConfiguration configuration) throws AndroidAgentException { Message responseMsg = new Message(); @@ -87,15 +87,15 @@ public class ConfigurationMgtServiceImpl implements ConfigurationMgtService { @GET public Response getConfiguration() throws AndroidAgentException { String msg; - TenantConfiguration tenantConfiguration = null; + PlatformConfiguration PlatformConfiguration = null; List configs; try { - tenantConfiguration = AndroidAPIUtils.getDeviceManagementService(). + PlatformConfiguration = AndroidAPIUtils.getDeviceManagementService(). getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); - if (tenantConfiguration != null) { - configs = tenantConfiguration.getConfiguration(); + if (PlatformConfiguration != null) { + configs = PlatformConfiguration.getConfiguration(); } else { - tenantConfiguration = new TenantConfiguration(); + PlatformConfiguration = new PlatformConfiguration(); configs = new ArrayList<>(); } @@ -109,18 +109,18 @@ public class ConfigurationMgtServiceImpl implements ConfigurationMgtService { entry.setName(AndroidConstants.TenantConfigProperties.LICENSE_KEY); entry.setValue(license.getText()); configs.add(entry); - tenantConfiguration.setConfiguration(configs); + PlatformConfiguration.setConfiguration(configs); } } catch (DeviceManagementException e) { msg = "Error occurred while retrieving the Android tenant configuration"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } - return Response.status(Response.Status.OK).entity(tenantConfiguration).build(); + return Response.status(Response.Status.OK).entity(PlatformConfiguration).build(); } @PUT - public Response updateConfiguration(TenantConfiguration configuration) throws AndroidAgentException { + public Response updateConfiguration(PlatformConfiguration configuration) throws AndroidAgentException { String msg; Message responseMsg = new Message(); ConfigurationEntry licenseEntry = null; @@ -145,7 +145,7 @@ public class ConfigurationMgtServiceImpl implements ConfigurationMgtService { } configuration.setConfiguration(configs); AndroidAPIUtils.getDeviceManagementService().saveConfiguration(configuration); - AndroidAPIUtils.getGCMService().resetTenantConfigCache(); + //AndroidAPIUtils.getGCMService().resetTenantConfigCache(); Response.status(Response.Status.ACCEPTED); responseMsg.setResponseMessage("Android platform configuration has updated successfully."); responseMsg.setResponseCode(Response.Status.ACCEPTED.toString()); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java index 778d1d80b2..acb487d68f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java @@ -46,7 +46,6 @@ import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceDetailsMgtExcept import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager; import org.wso2.carbon.device.mgt.core.search.mgt.impl.Utils; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; -import org.wso2.carbon.device.mgt.mobile.impl.android.gcm.GCMService; import org.wso2.carbon.mdm.services.android.bean.DeviceState; import org.wso2.carbon.policy.mgt.common.monitor.PolicyComplianceException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; @@ -94,16 +93,16 @@ public class AndroidAPIUtils { return deviceManagementProviderService; } - public static GCMService getGCMService() { - PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - GCMService gcmService = (GCMService) ctx.getOSGiService(GCMService.class, null); - if (gcmService == null) { - String msg = "GCM service has not initialized."; - log.error(msg); - throw new IllegalStateException(msg); - } - return gcmService; - } +// public static GCMService getGCMService() { +// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); +// GCMService gcmService = (GCMService) ctx.getOSGiService(GCMService.class, null); +// if (gcmService == null) { +// String msg = "GCM service has not initialized."; +// log.error(msg); +// throw new IllegalStateException(msg); +// } +// return gcmService; +// } public static MediaType getResponseMediaType(String acceptHeader) { MediaType responseMediaType; @@ -126,17 +125,17 @@ public class AndroidAPIUtils { List validDeviceIds = deviceIDHolder.getValidDeviceIDList(); Activity activity = getDeviceManagementService().addOperation( DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, operation, validDeviceIds); - if (activity != null) { - GCMService gcmService = getGCMService(); - if (gcmService.isGCMEnabled()) { - List deviceIDList = deviceIDHolder.getValidDeviceIDList(); - List devices = new ArrayList(deviceIDList.size()); - for (DeviceIdentifier deviceIdentifier : deviceIDList) { - devices.add(getDeviceManagementService().getDevice(deviceIdentifier)); - } - getGCMService().sendNotification(operation.getCode(), devices); - } - } +// if (activity != null) { +// GCMService gcmService = getGCMService(); +// if (gcmService.isGCMEnabled()) { +// List deviceIDList = deviceIDHolder.getValidDeviceIDList(); +// List devices = new ArrayList(deviceIDList.size()); +// for (DeviceIdentifier deviceIdentifier : deviceIDList) { +// devices.add(getDeviceManagementService().getDevice(deviceIdentifier)); +// } +// getGCMService().sendNotification(operation.getCode(), devices); +// } +// } if (!deviceIDHolder.getErrorDeviceIdList().isEmpty()) { return javax.ws.rs.core.Response.status(AndroidConstants.StatusCodes. MULTI_STATUS_HTTP_CODE).type( diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManager.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManager.java index 545de690a4..951dd27e1f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManager.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManager.java @@ -27,7 +27,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.FeatureManager; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager; @@ -85,7 +85,7 @@ public class AndroidDeviceManager implements DeviceManager { } @Override - public boolean saveConfiguration(TenantConfiguration tenantConfiguration) + public boolean saveConfiguration(PlatformConfiguration tenantConfiguration) throws DeviceManagementException { boolean status; try { @@ -96,7 +96,7 @@ public class AndroidDeviceManager implements DeviceManager { DeviceManagementConstants. MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); StringWriter writer = new StringWriter(); - JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); + JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class); Marshaller marshaller = context.createMarshaller(); marshaller.marshal(tenantConfiguration, writer); @@ -119,7 +119,7 @@ public class AndroidDeviceManager implements DeviceManager { } @Override - public TenantConfiguration getConfiguration() throws DeviceManagementException { + public PlatformConfiguration getConfiguration() throws DeviceManagementException { Resource resource; try { String androidRegPath = @@ -127,9 +127,9 @@ public class AndroidDeviceManager implements DeviceManager { MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); resource = MobileDeviceManagementUtil.getRegistryResource(androidRegPath); if (resource != null) { - JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); + JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class); Unmarshaller unmarshaller = context.createUnmarshaller(); - return (TenantConfiguration) unmarshaller.unmarshal( + return (PlatformConfiguration) unmarshaller.unmarshal( new StringReader(new String((byte[]) resource.getContent(), Charset. forName(MobilePluginConstants.CHARSET_UTF8)))); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/gcm/GCMUtil.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/gcm/GCMUtil.java index ba41698e8a..c896714030 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/gcm/GCMUtil.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/gcm/GCMUtil.java @@ -27,7 +27,7 @@ import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.mobile.android.impl.util.AndroidPluginConstants; import org.wso2.carbon.device.mgt.mobile.android.internal.AndroidDeviceManagementDataHolder; @@ -56,7 +56,7 @@ public class GCMUtil { private static final int TIME_TO_LIVE = 60; private static final int HTTP_STATUS_CODE_OK = 200; - private static HashMap tenantConfigurationCache = new HashMap<>(); + private static HashMap tenantConfigurationCache = new HashMap<>(); public static GCMResult sendWakeUpCall(String message, List devices) { GCMResult result = new GCMResult(); @@ -163,7 +163,7 @@ public class GCMUtil { getAndroidDeviceManagementService(); try { //Get the TenantConfiguration from cache if not we'll get it from DM service - TenantConfiguration tenantConfiguration = getTenantConfigurationFromCache(); + PlatformConfiguration tenantConfiguration = getTenantConfigurationFromCache(); if (tenantConfiguration == null) { tenantConfiguration = androidDMService.getDeviceManager().getConfiguration(); if (tenantConfiguration != null) { @@ -190,11 +190,11 @@ public class GCMUtil { tenantConfigurationCache.remove(getTenantId()); } - private static void addTenantConfigurationToCache(TenantConfiguration tenantConfiguration) { + private static void addTenantConfigurationToCache(PlatformConfiguration tenantConfiguration) { tenantConfigurationCache.put(getTenantId(), tenantConfiguration); } - private static TenantConfiguration getTenantConfigurationFromCache() { + private static PlatformConfiguration getTenantConfigurationFromCache() { return tenantConfigurationCache.get(getTenantId()); } diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManager.java b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManager.java index c69e6b0cb5..803af9478e 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManager.java +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManager.java @@ -21,7 +21,7 @@ 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.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager; @@ -79,7 +79,7 @@ public class AndroidDeviceManager implements DeviceManager { } @Override - public boolean saveConfiguration(TenantConfiguration tenantConfiguration) + public boolean saveConfiguration(PlatformConfiguration tenantConfiguration) throws DeviceManagementException { boolean status; try { @@ -90,7 +90,7 @@ public class AndroidDeviceManager implements DeviceManager { DeviceManagementConstants. MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); StringWriter writer = new StringWriter(); - JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); + JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class); Marshaller marshaller = context.createMarshaller(); marshaller.marshal(tenantConfiguration, writer); @@ -113,7 +113,7 @@ public class AndroidDeviceManager implements DeviceManager { } @Override - public TenantConfiguration getConfiguration() throws DeviceManagementException { + public PlatformConfiguration getConfiguration() throws DeviceManagementException { Resource resource; try { String androidRegPath = @@ -121,9 +121,9 @@ public class AndroidDeviceManager implements DeviceManager { MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); resource = MobileDeviceManagementUtil.getRegistryResource(androidRegPath); if (resource != null) { - JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); + JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class); Unmarshaller unmarshaller = context.createUnmarshaller(); - return (TenantConfiguration) unmarshaller.unmarshal( + return (PlatformConfiguration) unmarshaller.unmarshal( new StringReader(new String((byte[]) resource.getContent(), Charset. forName(MobilePluginConstants.CHARSET_UTF8)))); } diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java index 19f594bc83..01fc7c8e7f 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java @@ -25,7 +25,7 @@ import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.mobile.impl.android.util.AndroidPluginConstants; import org.wso2.carbon.device.mgt.mobile.internal.MobileDeviceManagementDataHolder; @@ -50,7 +50,7 @@ public class GCMUtil { private static final int TIME_TO_LIVE = 60; private static final int HTTP_STATUS_CODE_OK = 200; - private static HashMap tenantConfigurationCache = new HashMap<>(); + private static HashMap tenantConfigurationCache = new HashMap<>(); public static GCMResult sendWakeUpCall(String message, List devices) { GCMResult result = new GCMResult(); @@ -157,7 +157,7 @@ public class GCMUtil { getAndroidDeviceManagementService(); try { //Get the TenantConfiguration from cache if not we'll get it from DM service - TenantConfiguration tenantConfiguration = getTenantConfigurationFromCache(); + PlatformConfiguration tenantConfiguration = getTenantConfigurationFromCache(); if (tenantConfiguration == null) { tenantConfiguration = androidDMService.getDeviceManager().getConfiguration(); if (tenantConfiguration != null) { @@ -184,11 +184,11 @@ public class GCMUtil { tenantConfigurationCache.remove(getTenantId()); } - private static void addTenantConfigurationToCache(TenantConfiguration tenantConfiguration) { + private static void addTenantConfigurationToCache(PlatformConfiguration tenantConfiguration) { tenantConfigurationCache.put(getTenantId(), tenantConfiguration); } - private static TenantConfiguration getTenantConfigurationFromCache() { + private static PlatformConfiguration getTenantConfigurationFromCache() { return tenantConfigurationCache.get(getTenantId()); } diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java index b9f03cf491..dd6a2c4fb3 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java @@ -21,7 +21,7 @@ package org.wso2.carbon.device.mgt.mobile.impl.windows; 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.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager; @@ -79,7 +79,7 @@ public class WindowsDeviceManager implements DeviceManager { } @Override - public boolean saveConfiguration(TenantConfiguration tenantConfiguration) throws DeviceManagementException { + public boolean saveConfiguration(PlatformConfiguration tenantConfiguration) throws DeviceManagementException { boolean status; Resource resource; try { @@ -89,7 +89,7 @@ public class WindowsDeviceManager implements DeviceManager { String resourcePath = MobileDeviceManagementUtil.getPlatformConfigPath( DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); StringWriter writer = new StringWriter(); - JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); + JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class); Marshaller marshaller = context.createMarshaller(); marshaller.marshal(tenantConfiguration, writer); @@ -112,16 +112,16 @@ public class WindowsDeviceManager implements DeviceManager { } @Override - public TenantConfiguration getConfiguration() throws DeviceManagementException { + public PlatformConfiguration getConfiguration() throws DeviceManagementException { Resource resource; try { String windowsTenantRegistryPath = MobileDeviceManagementUtil. getPlatformConfigPath(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); resource = MobileDeviceManagementUtil.getRegistryResource(windowsTenantRegistryPath); if (resource != null) { - JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); + JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class); Unmarshaller unmarshaller = context.createUnmarshaller(); - return (TenantConfiguration) unmarshaller.unmarshal(new StringReader( + return (PlatformConfiguration) unmarshaller.unmarshal(new StringReader( new String((byte[]) resource.getContent(), Charset. forName(MobilePluginConstants.CHARSET_UTF8)))); } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/common/util/WindowsAPIUtils.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/common/util/WindowsAPIUtils.java index 6b8462e9f2..13f1152408 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/common/util/WindowsAPIUtils.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/common/util/WindowsAPIUtils.java @@ -27,7 +27,7 @@ import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; @@ -165,7 +165,7 @@ public class WindowsAPIUtils { getDeviceManagementService().updateOperation(deviceIdentifier, operation); } - public static TenantConfiguration getTenantConfiguration() throws DeviceManagementException { + public static PlatformConfiguration getTenantConfiguration() throws DeviceManagementException { return getDeviceManagementService().getConfiguration( DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/ConfigurationMgtService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/ConfigurationMgtService.java index f943affb06..893964a6b0 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/ConfigurationMgtService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/ConfigurationMgtService.java @@ -21,7 +21,7 @@ package org.wso2.carbon.mdm.mobileservices.windows.services.configurationmgtserv import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException; import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message; @@ -56,7 +56,7 @@ public interface ConfigurationMgtService { @ApiResponse(code = 201, message = "Windows platform configuration saved successfully"), @ApiResponse(code = 500, message = "Internal Server Error") }) - Message ConfigureSettings(TenantConfiguration configuration) throws WindowsConfigurationException; + Message ConfigureSettings(PlatformConfiguration configuration) throws WindowsConfigurationException; /** * Retrieve Tenant configurations according to the device type. @@ -69,13 +69,13 @@ public interface ConfigurationMgtService { httpMethod = "GET", value = "Getting Windows Platform Configurations", notes = "Get the Windows platform configuration details using this REST API", - response = TenantConfiguration.class + response = PlatformConfiguration.class ) @ApiResponses(value = { @ApiResponse(code = 200, message = "Get Windows Configurations"), @ApiResponse(code = 500, message = "Server Error") }) - TenantConfiguration getConfiguration() throws WindowsConfigurationException; + PlatformConfiguration getConfiguration() throws WindowsConfigurationException; /** * Update Tenant Configurations for the specific Device type. @@ -97,5 +97,5 @@ public interface ConfigurationMgtService { @ApiResponse(code = 500, message = "Error occurred while modifying configuration settings of " + "windows platform") }) - Message updateConfiguration(TenantConfiguration configuration) throws WindowsConfigurationException; + Message updateConfiguration(PlatformConfiguration configuration) throws WindowsConfigurationException; } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/impl/ConfigurationMgtServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/impl/ConfigurationMgtServiceImpl.java index 1fd0b2c845..1c7734d422 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/impl/ConfigurationMgtServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/impl/ConfigurationMgtServiceImpl.java @@ -23,7 +23,8 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.mdm.mobileservices.windows.common.PluginConstants; import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException; @@ -54,7 +55,7 @@ public class ConfigurationMgtServiceImpl { * @throws WindowsConfigurationException */ @POST - public Message ConfigureSettings(TenantConfiguration configuration) throws WindowsConfigurationException { + public Message ConfigureSettings(PlatformConfiguration configuration) throws WindowsConfigurationException { Message responseMsg = new Message(); ConfigurationEntry licenseEntry = null; String message; @@ -106,15 +107,15 @@ public class ConfigurationMgtServiceImpl { * @throws WindowsConfigurationException */ @GET - public TenantConfiguration getConfiguration() throws WindowsConfigurationException { + public PlatformConfiguration getConfiguration() throws WindowsConfigurationException { String msg; - TenantConfiguration tenantConfiguration = null; + PlatformConfiguration PlatformConfiguration = null; try { if (WindowsAPIUtils.getDeviceManagementService(). getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS) != null) { - tenantConfiguration = WindowsAPIUtils.getDeviceManagementService(). + PlatformConfiguration = WindowsAPIUtils.getDeviceManagementService(). getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); - List configs = tenantConfiguration.getConfiguration(); + List configs = PlatformConfiguration.getConfiguration(); ConfigurationEntry entry = new ConfigurationEntry(); License license = WindowsAPIUtils.getDeviceManagementService().getLicense( DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS, PluginConstants. @@ -124,7 +125,7 @@ public class ConfigurationMgtServiceImpl { entry.setName(PluginConstants.TenantConfigProperties.LICENSE_KEY); entry.setValue(license.getText()); configs.add(entry); - tenantConfiguration.setConfiguration(configs); + PlatformConfiguration.setConfiguration(configs); } } } catch (DeviceManagementException e) { @@ -132,7 +133,7 @@ public class ConfigurationMgtServiceImpl { log.error(msg, e); throw new WindowsConfigurationException(msg, e); } - return tenantConfiguration; + return PlatformConfiguration; } /** @@ -143,7 +144,7 @@ public class ConfigurationMgtServiceImpl { * @throws WindowsConfigurationException */ @PUT - public Message updateConfiguration(TenantConfiguration configuration) throws WindowsConfigurationException { + public Message updateConfiguration(PlatformConfiguration configuration) throws WindowsConfigurationException { String message; Message responseMsg = new Message(); ConfigurationEntry licenseEntry = null; diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/wstep/impl/CertificateEnrollmentServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/wstep/impl/CertificateEnrollmentServiceImpl.java index b4e7a54ecd..b21304e8dd 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/wstep/impl/CertificateEnrollmentServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/wstep/impl/CertificateEnrollmentServiceImpl.java @@ -32,7 +32,7 @@ import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; -import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.mdm.mobileservices.windows.common.PluginConstants; import org.wso2.carbon.mdm.mobileservices.windows.common.beans.CacheEntry; import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.CertificateGenerationException; @@ -372,7 +372,7 @@ public class CertificateEnrollmentServiceImpl implements CertificateEnrollmentSe */ private List getTenantConfigurationData() throws DeviceManagementException { if (WindowsAPIUtils.getTenantConfiguration() != null) { - TenantConfiguration configuration = WindowsAPIUtils.getTenantConfiguration(); + PlatformConfiguration configuration = WindowsAPIUtils.getTenantConfiguration(); return configuration.getConfiguration(); } else { return null; diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsDeviceManager.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsDeviceManager.java index f3864fe4a4..30f6cb4f2a 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsDeviceManager.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsDeviceManager.java @@ -21,7 +21,7 @@ package org.wso2.carbon.device.mgt.mobile.windows.impl; 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.configuration.mgt.TenantConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager; @@ -79,7 +79,7 @@ public class WindowsDeviceManager implements DeviceManager { } @Override - public boolean saveConfiguration(TenantConfiguration tenantConfiguration) + public boolean saveConfiguration(PlatformConfiguration tenantConfiguration) throws DeviceManagementException { boolean status; Resource resource; @@ -91,7 +91,7 @@ public class WindowsDeviceManager implements DeviceManager { DeviceManagementConstants. MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); StringWriter writer = new StringWriter(); - JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); + JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class); Marshaller marshaller = context.createMarshaller(); marshaller.marshal(tenantConfiguration, writer); @@ -114,7 +114,7 @@ public class WindowsDeviceManager implements DeviceManager { } @Override - public TenantConfiguration getConfiguration() throws DeviceManagementException { + public PlatformConfiguration getConfiguration() throws DeviceManagementException { Resource resource; try { String windowsTenantRegistryPath = @@ -122,9 +122,9 @@ public class WindowsDeviceManager implements DeviceManager { MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); resource = MobileDeviceManagementUtil.getRegistryResource(windowsTenantRegistryPath); if (resource != null) { - JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); + JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class); Unmarshaller unmarshaller = context.createUnmarshaller(); - return (TenantConfiguration) unmarshaller.unmarshal( + return (PlatformConfiguration) unmarshaller.unmarshal( new StringReader(new String((byte[]) resource.getContent(), Charset. forName(MobilePluginConstants.CHARSET_UTF8)))); }