Renaming TenantConfiguration as PlatformConfiguration

4.x.x
prabathabey 9 years ago
parent 4462c353b4
commit ebefd60533

@ -20,7 +20,7 @@ package org.wso2.carbon.device.mgt.jaxrs.api;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.wso2.carbon.apimgt.annotations.api.*; import org.wso2.carbon.apimgt.annotations.api.*;
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
import javax.ws.rs.*; import javax.ws.rs.*;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
@ -55,7 +55,7 @@ public interface Configuration {
@Permission(scope = "configuration-modify", permissions = {"/permission/admin/device-mgt/admin/platform-configs/modify"}) @Permission(scope = "configuration-modify", permissions = {"/permission/admin/device-mgt/admin/platform-configs/modify"})
Response saveTenantConfiguration(@ApiParam(name = "configuration", value = "The required properties to " Response saveTenantConfiguration(@ApiParam(name = "configuration", value = "The required properties to "
+ "update the platform configurations the as the <JSON_PAYLOAD> value", + "update the platform configurations the as the <JSON_PAYLOAD> value",
required = true) TenantConfiguration configuration); required = true) PlatformConfiguration configuration);
@GET @GET
@ApiOperation( @ApiOperation(
@ -64,7 +64,7 @@ public interface Configuration {
httpMethod = "GET", httpMethod = "GET",
value = "Getting General Platform Configurations", value = "Getting General Platform Configurations",
notes = "Get the general platform level configuration details using this REST API", notes = "Get the general platform level configuration details using this REST API",
response = TenantConfiguration.class) response = PlatformConfiguration.class)
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(code = 200, message = "OK"), @ApiResponse(code = 200, message = "OK"),
@ApiResponse(code = 500, message = "Error occurred while retrieving the tenant configuration") @ApiResponse(code = 500, message = "Error occurred while retrieving the tenant configuration")
@ -86,6 +86,6 @@ public interface Configuration {
@Permission(scope = "configuration-modify", permissions = {"/permission/admin/device-mgt/admin/platform-configs/modify"}) @Permission(scope = "configuration-modify", permissions = {"/permission/admin/device-mgt/admin/platform-configs/modify"})
Response updateConfiguration(@ApiParam(name = "configuration", value = "The required properties to update" Response updateConfiguration(@ApiParam(name = "configuration", value = "The required properties to update"
+ " the platform configurations the as the <JSON_PAYLOAD> value", + " the platform configurations the as the <JSON_PAYLOAD> value",
required = true) TenantConfiguration configuration); required = true) PlatformConfiguration configuration);
} }

@ -23,7 +23,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException;
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.jaxrs.api.Configuration; import org.wso2.carbon.device.mgt.jaxrs.api.Configuration;
import org.wso2.carbon.device.mgt.jaxrs.api.util.DeviceMgtAPIUtils; import org.wso2.carbon.device.mgt.jaxrs.api.util.DeviceMgtAPIUtils;
import org.wso2.carbon.device.mgt.jaxrs.api.util.MDMAppConstants; import org.wso2.carbon.device.mgt.jaxrs.api.util.MDMAppConstants;
@ -51,7 +51,7 @@ public class ConfigurationImpl implements Configuration{
private static Log log = LogFactory.getLog(ConfigurationImpl.class); private static Log log = LogFactory.getLog(ConfigurationImpl.class);
@POST @POST
public Response saveTenantConfiguration(TenantConfiguration configuration) { public Response saveTenantConfiguration(PlatformConfiguration configuration) {
ResponsePayload responseMsg = new ResponsePayload(); ResponsePayload responseMsg = new ResponsePayload();
try { try {
DeviceMgtAPIUtils.getTenantConfigurationManagementService().saveConfiguration(configuration, DeviceMgtAPIUtils.getTenantConfigurationManagementService().saveConfiguration(configuration,
@ -72,7 +72,7 @@ public class ConfigurationImpl implements Configuration{
public Response getConfiguration() { public Response getConfiguration() {
String msg; String msg;
try { try {
TenantConfiguration tenantConfiguration = DeviceMgtAPIUtils.getTenantConfigurationManagementService(). PlatformConfiguration tenantConfiguration = DeviceMgtAPIUtils.getTenantConfigurationManagementService().
getConfiguration(MDMAppConstants.RegistryConstants.GENERAL_CONFIG_RESOURCE_PATH); getConfiguration(MDMAppConstants.RegistryConstants.GENERAL_CONFIG_RESOURCE_PATH);
ConfigurationEntry configurationEntry = new ConfigurationEntry(); ConfigurationEntry configurationEntry = new ConfigurationEntry();
configurationEntry.setContentType("text"); configurationEntry.setContentType("text");
@ -93,7 +93,7 @@ public class ConfigurationImpl implements Configuration{
} }
@PUT @PUT
public Response updateConfiguration(TenantConfiguration configuration) { public Response updateConfiguration(PlatformConfiguration configuration) {
ResponsePayload responseMsg = new ResponsePayload(); ResponsePayload responseMsg = new ResponsePayload();
try { try {
DeviceMgtAPIUtils.getTenantConfigurationManagementService().saveConfiguration(configuration, DeviceMgtAPIUtils.getTenantConfigurationManagementService().saveConfiguration(configuration,

@ -24,12 +24,12 @@ import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService
import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.analytics.dashboard.GadgetDataService; import org.wso2.carbon.device.mgt.analytics.dashboard.GadgetDataService;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService;
import org.wso2.carbon.device.mgt.jaxrs.api.common.MDMAPIException; import org.wso2.carbon.device.mgt.jaxrs.api.common.MDMAPIException;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.PaginationResult; import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; 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.TenantConfigurationManagementService;
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService;
import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService; import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService;
import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager; import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager;
@ -57,7 +57,7 @@ public class DeviceMgtAPIUtils {
private static final String NOTIFIER_FREQUENCY = "notifierFrequency"; private static final String NOTIFIER_FREQUENCY = "notifierFrequency";
private static Log log = LogFactory.getLog(DeviceMgtAPIUtils.class); private static Log log = LogFactory.getLog(DeviceMgtAPIUtils.class);
public static int getNotifierFrequency(TenantConfiguration tenantConfiguration) { public static int getNotifierFrequency(PlatformConfiguration tenantConfiguration) {
List<ConfigurationEntry> configEntryList = tenantConfiguration.getConfiguration(); List<ConfigurationEntry> configEntryList = tenantConfiguration.getConfiguration();
if (configEntryList != null && !configEntryList.isEmpty()) { if (configEntryList != null && !configEntryList.isEmpty()) {
for(ConfigurationEntry entry : configEntryList) { for(ConfigurationEntry entry : configEntryList) {
@ -234,10 +234,10 @@ public class DeviceMgtAPIUtils {
return policyManagementService; return policyManagementService;
} }
public static TenantConfigurationManagementService getTenantConfigurationManagementService() { public static PlatformConfigurationManagementService getTenantConfigurationManagementService() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
TenantConfigurationManagementService tenantConfigurationManagementService = PlatformConfigurationManagementService tenantConfigurationManagementService =
(TenantConfigurationManagementService) ctx.getOSGiService(TenantConfigurationManagementService.class, null); (PlatformConfigurationManagementService) ctx.getOSGiService(PlatformConfigurationManagementService.class, null);
if (tenantConfigurationManagementService == null) { if (tenantConfigurationManagementService == null) {
String msg = "Tenant configuration Management service not initialized."; String msg = "Tenant configuration Management service not initialized.";
log.error(msg); log.error(msg);

@ -17,7 +17,7 @@
*/ */
package org.wso2.carbon.device.mgt.common; package 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.License;
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
@ -40,14 +40,14 @@ public interface DeviceManager {
* *
* @return Returns the status of the operation * @return Returns the status of the operation
*/ */
boolean saveConfiguration(TenantConfiguration configuration) throws DeviceManagementException; boolean saveConfiguration(PlatformConfiguration configuration) throws DeviceManagementException;
/** /**
* Method to get platform specific Configuration. * Method to get platform specific Configuration.
* *
* @return Returns the platform specific tenant configurations * @return Returns the platform specific tenant configurations
*/ */
TenantConfiguration getConfiguration() throws DeviceManagementException; PlatformConfiguration getConfiguration() throws DeviceManagementException;
/** /**
* Method to enrolling a particular device of type mobile, IoT, etc within CDM. * Method to enrolling a particular device of type mobile, IoT, etc within CDM.

@ -31,12 +31,12 @@ import java.util.List;
/** /**
* Represents the tenant configuration for a device platform. * Represents the tenant configuration for a device platform.
*/ */
@XmlRootElement(name = "tenantConfiguration") @XmlRootElement(name = "PlatformConfiguration")
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
@ApiModel(value = "TenantConfiguration", @ApiModel(value = "PlatformConfiguration",
description = "This class carries all information related to a Tenant configuration") description = "This class carries all information related to a Tenant configuration")
public class TenantConfiguration implements Serializable { public class PlatformConfiguration implements Serializable {
@XmlElement(name = "type") @XmlElement(name = "type")
@ApiModelProperty(name = "type", value = "type of device", required = true) @ApiModelProperty(name = "type", value = "type of device", required = true)

@ -21,7 +21,7 @@ package org.wso2.carbon.device.mgt.common.configuration.mgt;
* This represents the tenant configuration management functionality which should be implemented by * This represents the tenant configuration management functionality which should be implemented by
* the device type plugins. * the device type plugins.
*/ */
public interface TenantConfigurationManagementService { public interface PlatformConfigurationManagementService {
/** /**
* Method to add a operation to a device or a set of devices. * Method to add a operation to a device or a set of devices.
@ -31,7 +31,7 @@ public interface TenantConfigurationManagementService {
* @throws org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException If some unusual behaviour is observed while adding the * @throws org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException If some unusual behaviour is observed while adding the
* configuration. * configuration.
*/ */
boolean saveConfiguration(TenantConfiguration tenantConfiguration, String resourcePath) throws boolean saveConfiguration(PlatformConfiguration tenantConfiguration, String resourcePath) throws
ConfigurationManagementException; ConfigurationManagementException;
/** /**
@ -41,6 +41,6 @@ public interface TenantConfigurationManagementService {
* @throws org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException If some unusual behaviour is observed while fetching the * @throws org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException If some unusual behaviour is observed while fetching the
* operation list. * operation list.
*/ */
TenantConfiguration getConfiguration(String resourcePath) throws ConfigurationManagementException; PlatformConfiguration getConfiguration(String resourcePath) throws ConfigurationManagementException;
} }

@ -20,8 +20,8 @@ package org.wso2.carbon.device.mgt.core.config.tenant;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException;
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.TenantConfigurationManagementService; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService;
import org.wso2.carbon.device.mgt.core.config.ConfigurationManagerConstants; import org.wso2.carbon.device.mgt.core.config.ConfigurationManagerConstants;
import org.wso2.carbon.device.mgt.core.config.util.ConfigurationManagerUtil; import org.wso2.carbon.device.mgt.core.config.util.ConfigurationManagerUtil;
import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.registry.api.Resource;
@ -36,17 +36,17 @@ import java.io.StringWriter;
import java.nio.charset.Charset; import java.nio.charset.Charset;
/** /**
* This class implements all the functionality exposed as part of the TenantConfigurationManagementService. * This class implements all the functionality exposed as part of the PlatformConfigurationManagementService.
* Main usage of this module is saving/retrieving tenant configurations to the registry. * Main usage of this module is saving/retrieving tenant configurations to the registry.
* *
*/ */
public class TenantConfigurationManagementServiceImpl public class TenantConfigurationManagementServiceImpl
implements TenantConfigurationManagementService { implements PlatformConfigurationManagementService {
private static final Log log = LogFactory.getLog(TenantConfigurationManagementServiceImpl.class); private static final Log log = LogFactory.getLog(TenantConfigurationManagementServiceImpl.class);
@Override @Override
public boolean saveConfiguration(TenantConfiguration tenantConfiguration, String resourcePath) public boolean saveConfiguration(PlatformConfiguration tenantConfiguration, String resourcePath)
throws ConfigurationManagementException { throws ConfigurationManagementException {
boolean status; boolean status;
try { try {
@ -54,7 +54,7 @@ public class TenantConfigurationManagementServiceImpl
log.debug("Persisting tenant configurations in Registry"); log.debug("Persisting tenant configurations in Registry");
} }
StringWriter writer = new StringWriter(); StringWriter writer = new StringWriter();
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class);
Marshaller marshaller = context.createMarshaller(); Marshaller marshaller = context.createMarshaller();
marshaller.marshal(tenantConfiguration, writer); marshaller.marshal(tenantConfiguration, writer);
@ -74,19 +74,19 @@ public class TenantConfigurationManagementServiceImpl
} }
@Override @Override
public TenantConfiguration getConfiguration(String resourcePath) public PlatformConfiguration getConfiguration(String resourcePath)
throws ConfigurationManagementException { throws ConfigurationManagementException {
Resource resource; Resource resource;
try { try {
resource = ConfigurationManagerUtil.getRegistryResource(resourcePath); resource = ConfigurationManagerUtil.getRegistryResource(resourcePath);
if(resource != null){ if(resource != null){
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class);
Unmarshaller unmarshaller = context.createUnmarshaller(); Unmarshaller unmarshaller = context.createUnmarshaller();
return (TenantConfiguration) unmarshaller.unmarshal( return (PlatformConfiguration) unmarshaller.unmarshal(
new StringReader(new String((byte[]) resource.getContent(), Charset new StringReader(new String((byte[]) resource.getContent(), Charset
.forName(ConfigurationManagerConstants.CharSets.CHARSET_UTF8)))); .forName(ConfigurationManagerConstants.CharSets.CHARSET_UTF8))));
} }
return new TenantConfiguration(); return new PlatformConfiguration();
} catch (JAXBException e) { } catch (JAXBException e) {
throw new ConfigurationManagementException( throw new ConfigurationManagementException(
"Error occurred while parsing the Tenant configuration : " + e.getMessage(), e); "Error occurred while parsing the Tenant configuration : " + e.getMessage(), e);

@ -25,13 +25,11 @@ import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService; import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService;
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfigurationManagementService; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService;
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager;
import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagerService; import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagerService;
import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationProvider;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import org.wso2.carbon.device.mgt.core.DeviceManagementConstants; import org.wso2.carbon.device.mgt.core.DeviceManagementConstants;
import org.wso2.carbon.device.mgt.core.DeviceManagementPluginRepository; import org.wso2.carbon.device.mgt.core.DeviceManagementPluginRepository;
@ -51,7 +49,6 @@ import org.wso2.carbon.device.mgt.core.notification.mgt.dao.NotificationManageme
import org.wso2.carbon.device.mgt.core.operation.mgt.OperationManagerImpl; import org.wso2.carbon.device.mgt.core.operation.mgt.OperationManagerImpl;
import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import org.wso2.carbon.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.permission.mgt.PermissionManagerServiceImpl; import org.wso2.carbon.device.mgt.core.permission.mgt.PermissionManagerServiceImpl;
import org.wso2.carbon.device.mgt.core.push.notification.mgt.PushNotificationConfigRepository;
import org.wso2.carbon.device.mgt.core.push.notification.mgt.PushNotificationProviderRepository; import org.wso2.carbon.device.mgt.core.push.notification.mgt.PushNotificationProviderRepository;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl;
@ -221,9 +218,9 @@ public class DeviceManagementServiceComponent {
bundleContext.registerService(GroupManagementProviderService.class.getName(), groupManagementProvider, null); bundleContext.registerService(GroupManagementProviderService.class.getName(), groupManagementProvider, null);
/* Registering Tenant Configuration Management Service */ /* Registering Tenant Configuration Management Service */
TenantConfigurationManagementService PlatformConfigurationManagementService
tenantConfiguration = new TenantConfigurationManagementServiceImpl(); tenantConfiguration = new TenantConfigurationManagementServiceImpl();
bundleContext.registerService(TenantConfigurationManagementService.class.getName(), tenantConfiguration, null); bundleContext.registerService(PlatformConfigurationManagementService.class.getName(), tenantConfiguration, null);
/* Registering Notification Service */ /* Registering Notification Service */
NotificationManagementService notificationManagementService NotificationManagementService notificationManagementService

@ -24,12 +24,11 @@ import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.common.FeatureManager;
import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationResult; import org.wso2.carbon.device.mgt.common.PaginationResult;
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.License;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; 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.OperationManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager;
import org.wso2.carbon.device.mgt.core.dto.DeviceType; import org.wso2.carbon.device.mgt.core.dto.DeviceType;
import java.util.List; import java.util.List;
@ -78,7 +77,7 @@ public interface DeviceManagementProviderService {
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the * @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* configuration. * configuration.
*/ */
TenantConfiguration getConfiguration(String deviceType) throws DeviceManagementException; PlatformConfiguration getConfiguration(String deviceType) throws DeviceManagementException;
/** /**
* Method to get the list of devices owned by an user with paging information. * Method to get the list of devices owned by an user with paging information.
@ -187,9 +186,9 @@ public interface DeviceManagementProviderService {
boolean enrollDevice(Device device) throws DeviceManagementException; boolean enrollDevice(Device device) throws DeviceManagementException;
TenantConfiguration getConfiguration() throws DeviceManagementException; PlatformConfiguration getConfiguration() throws DeviceManagementException;
boolean saveConfiguration(TenantConfiguration configuration) throws DeviceManagementException; boolean saveConfiguration(PlatformConfiguration configuration) throws DeviceManagementException;
boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException; boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException;

@ -30,7 +30,7 @@ import org.wso2.carbon.device.mgt.common.FeatureManager;
import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationResult; import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.device.mgt.common.TransactionManagementException; import org.wso2.carbon.device.mgt.common.TransactionManagementException;
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.License;
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
@ -93,7 +93,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
} }
@Override @Override
public boolean saveConfiguration(TenantConfiguration configuration) throws DeviceManagementException { public boolean saveConfiguration(PlatformConfiguration configuration) throws DeviceManagementException {
DeviceManager dms = DeviceManager dms =
pluginRepository.getDeviceManagementService(configuration.getType(), pluginRepository.getDeviceManagementService(configuration.getType(),
this.getTenantId()).getDeviceManager(); this.getTenantId()).getDeviceManager();
@ -101,12 +101,12 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
} }
@Override @Override
public TenantConfiguration getConfiguration() throws DeviceManagementException { public PlatformConfiguration getConfiguration() throws DeviceManagementException {
return null; return null;
} }
@Override @Override
public TenantConfiguration getConfiguration(String deviceType) throws DeviceManagementException { public PlatformConfiguration getConfiguration(String deviceType) throws DeviceManagementException {
DeviceManager dms = DeviceManager dms =
pluginRepository.getDeviceManagementService(deviceType, this.getTenantId()).getDeviceManager(); pluginRepository.getDeviceManagementService(deviceType, this.getTenantId()).getDeviceManager();
if (dms == null) { if (dms == null) {

@ -16,7 +16,7 @@
package org.wso2.carbon.device.mgt.core; package org.wso2.carbon.device.mgt.core;
import org.wso2.carbon.device.mgt.common.*; 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.License;
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
@ -34,12 +34,12 @@ public class TestDeviceManager implements DeviceManager {
} }
@Override @Override
public boolean saveConfiguration(TenantConfiguration configuration) public boolean saveConfiguration(PlatformConfiguration configuration)
throws DeviceManagementException { throws DeviceManagementException {
return false; return false;
} }
@Override public TenantConfiguration getConfiguration() throws DeviceManagementException { @Override public PlatformConfiguration getConfiguration() throws DeviceManagementException {
return null; return null;
} }

@ -24,8 +24,8 @@ import org.w3c.dom.Document;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException;
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.TenantConfigurationManagementService; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService;
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
@ -198,8 +198,8 @@ public class PolicyManagerUtil {
public static int getMonitoringFequency() { public static int getMonitoringFequency() {
TenantConfigurationManagementService configMgtService = new TenantConfigurationManagementServiceImpl(); PlatformConfigurationManagementService configMgtService = new TenantConfigurationManagementServiceImpl();
TenantConfiguration tenantConfiguration = null; PlatformConfiguration tenantConfiguration = null;
int monitoringFrequency = 0; int monitoringFrequency = 0;
try { try {
tenantConfiguration = configMgtService.getConfiguration(GENERAL_CONFIG_RESOURCE_PATH); tenantConfiguration = configMgtService.getConfiguration(GENERAL_CONFIG_RESOURCE_PATH);

Loading…
Cancel
Save