diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml new file mode 100644 index 0000000000..3f658001d7 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml @@ -0,0 +1,97 @@ + + + + + + android-plugin + org.wso2.carbon.devicemgt-plugins + 5.0.5-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.mobile.android.addons + bundle + WSO2 Carbon - Mobile Device Management Android Addons Impl + WSO2 Carbon - Mobile Device Management Android Addons Implementation + https://entgra.io/ + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.felix + maven-scr-plugin + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.artifactId} + ${project.artifactId} + ${carbon.devicemgt.plugins.version} + Device Management Mobile Android addons Impl Bundle + + com.google.gson.* + + + org.wso2.carbon.device.mgt.mobile.android.addons.* + + + + + + + + + + javax.servlet + servlet-api + provided + + + org.apache.cxf + cxf-rt-frontend-jaxws + provided + + + org.apache.cxf + cxf-rt-frontend-jaxrs + provided + + + org.apache.cxf + cxf-rt-transports-http + provided + + + org.hibernate + hibernate-validator + + + org.wso2.carbon + org.wso2.carbon.logging + + + 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/ApiOriginFilter.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ApiOriginFilter.java similarity index 84% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/ApiOriginFilter.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ApiOriginFilter.java index 455d582bb2..e9c4c69dac 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/ApiOriginFilter.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ApiOriginFilter.java @@ -16,9 +16,14 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.addons; -import javax.servlet.*; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletResponse; import java.io.IOException; 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/common/ValidationInterceptor.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ValidationInterceptor.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ValidationInterceptor.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ValidationInterceptor.java index a563f09d11..adc298e180 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ValidationInterceptor.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ValidationInterceptor.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.common; +package org.wso2.carbon.device.mgt.mobile.android.addons; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -29,7 +29,11 @@ import org.apache.cxf.message.MessageContentsList; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; -import javax.validation.*; +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; +import javax.validation.Validation; +import javax.validation.Validator; +import javax.validation.ValidatorFactory; import javax.validation.executable.ExecutableValidator; import java.lang.reflect.Method; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml index 1855a35d47..d902ed5246 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml @@ -49,44 +49,6 @@ api#device-mgt#android#v1.0 - - org.jacoco - jacoco-maven-plugin - - ${basedir}/target/coverage-reports/jacoco-unit.exec - - - - jacoco-initialize - - prepare-agent - - - - jacoco-site - test - - report - - - ${basedir}/target/coverage-reports/jacoco-unit.exec - ${basedir}/target/coverage-reports/site - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - file:src/test/resources/log4j.properties - - - src/test/resources/testng.xml - - - @@ -99,7 +61,7 @@ org.apache.maven.plugins maven-antrun-plugin - 1.7 + 1.8 compile @@ -118,54 +80,6 @@ - - org.jacoco - jacoco-maven-plugin - - ${basedir}/target/coverage-reports/jacoco-unit.exec - - - - jacoco-initialize - - prepare-agent - - - - jacoco-site - test - - report - - - ${basedir}/target/coverage-reports/jacoco-unit.exec - ${basedir}/target/coverage-reports/site - - - - - - - - - - client - - test - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - test - - java - - - - @@ -212,32 +126,6 @@ org.wso2.carbon.apimgt.annotations provided - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.core - provided - - - org.slf4j - slf4j-api - - - - - org.wso2.carbon.devicemgt - org.wso2.carbon.policy.mgt.common - provided - - - org.wso2.carbon.devicemgt - org.wso2.carbon.policy.mgt.core - provided - - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.mobile.android - provided - commons-httpclient.wso2 commons-httpclient @@ -287,11 +175,7 @@ - - javax.servlet - servlet-api - provided - + org.hibernate hibernate-validator @@ -300,78 +184,49 @@ javax.ws.rs javax.ws.rs-api + - org.testng - testng - test - - - org.powermock - powermock-module-testng - test - - - org.powermock - powermock-api-mockito - test - - - com.h2database.wso2 - h2-database-engine - test - - - org.wso2.carbon - org.wso2.carbon.queuing - test - - - org.wso2.carbon - org.wso2.carbon.ndatasource.core - test - - - commons-dbcp.wso2 - commons-dbcp - test + org.codehaus.jackson + jackson-core-asl - commons-pool.wso2 - commons-pool - test + com.google.apis + google-api-services-androidenterprise + v1-rev186-1.25.0 - org.wso2.carbon - javax.cache.wso2 - test + org.wso2.carbon.devicemgt + org.wso2.carbon.device.application.mgt.common + provided - javassist - javassist - test + org.apache.httpcomponents + httpclient + - org.codehaus.jackson - jackson-core-asl + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.common + provided - org.wso2.carbon.devicemgt - org.wso2.carbon.apimgt.application.extension + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.addons provided - com.google.apis - google-api-services-androidenterprise - v1-rev186-1.25.0 + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.core + provided org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + org.wso2.carbon.policy.mgt.common provided - org.apache.httpcomponents - httpclient + org.wso2.carbon.devicemgt + org.wso2.carbon.policy.mgt.core 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/AndroidEnterpriseService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/AndroidEnterpriseAPI.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/AndroidEnterpriseService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/AndroidEnterpriseAPI.java index a76a57ada9..3ffd40654f 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/AndroidEnterpriseService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/AndroidEnterpriseAPI.java @@ -15,9 +15,8 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.services; +package org.wso2.carbon.device.mgt.mobile.android.api; -import com.google.api.services.androidenterprise.model.Device; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -32,22 +31,17 @@ import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationPolicyDTO; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.mdm.services.android.bean.DeviceState; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStoreCluster; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePage; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePageLinks; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseInstallPolicy; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseUser; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EventBeanWrapper; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; - -import javax.validation.Valid; -import javax.validation.constraints.Size; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStoreCluster; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePage; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePageLinks; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseInstallPolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; + import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; @@ -69,10 +63,11 @@ import javax.ws.rs.core.Response; } ), tags = { - @Tag(name = "android,device_management", description = "") + @Tag(name = "android,device_management", description = "Android Device Management Service") } ) -@Api(value = "Android Enterprise Service", description = "Android Enterprise Service ") + +@Api(value = "Android Enterprise Service") @Path("/enterprise") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @@ -92,7 +87,7 @@ import javax.ws.rs.core.Response; ) } ) -public interface AndroidEnterpriseService { +public interface AndroidEnterpriseAPI { @POST @Path("/user") @@ -148,8 +143,7 @@ public interface AndroidEnterpriseService { }) Response addUser(@ApiParam( name = "user", - value = "Enterprise user and device data.") - EnterpriseUser enterpriseUser); + value = "Enterprise user and device data.") EnterpriseUser enterpriseUser); //###################################################################################################################### //###################################################################################################################### @@ -209,8 +203,7 @@ public interface AndroidEnterpriseService { }) Response updateUser(@ApiParam( name = "device", - value = "Enterprise user and device data.") - EnterpriseInstallPolicy device); + value = "Enterprise user and device data.") EnterpriseInstallPolicy device); //###################################################################################################################### //###################################################################################################################### @@ -269,43 +262,38 @@ public interface AndroidEnterpriseService { Response getStoreUrl( @ApiParam( name = "approveApps", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) + value = "Boolean flag indicating whether to permanently delete the device.") @QueryParam("approveApps") boolean approveApps, @ApiParam( name = "searchEnabled", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) + value = "Boolean flag indicating whether to permanently delete the device.") @QueryParam("searchEnabled") boolean searchEnabled, @ApiParam( name = "isPrivateAppsEnabled", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) @QueryParam("isPrivateAppsEnabled") boolean isPrivateAppsEnabled, + value = "Boolean flag indicating whether to permanently delete the device.") + @QueryParam("isPrivateAppsEnabled") boolean isPrivateAppsEnabled, @ApiParam( name = "isWebAppEnabled", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) @QueryParam("isWebAppEnabled") boolean isWebAppEnabled, + value = "Boolean flag indicating whether to permanently delete the device.") + @QueryParam("isWebAppEnabled") boolean isWebAppEnabled, @ApiParam( name = "isOrganizeAppPageVisible", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) @QueryParam("isOrganizeAppPageVisible") boolean isOrganizeAppPageVisible, + value = "Boolean flag indicating whether to permanently delete the device.") + @QueryParam("isOrganizeAppPageVisible") boolean isOrganizeAppPageVisible, @ApiParam( name = "isManagedConfigEnabled", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) @QueryParam("isManagedConfigEnabled") boolean isManagedConfigEnabled, + value = "Boolean flag indicating whether to permanently delete the device.") + @QueryParam("isManagedConfigEnabled") boolean isManagedConfigEnabled, @ApiParam(name = "host", value = "Boolean flag indicating whether to permanently delete the device.", required = true) @QueryParam("host") String host); - - - @GET @Path("/products/sync") @ApiOperation( @@ -416,8 +404,7 @@ public interface AndroidEnterpriseService { }) Response addPage(@ApiParam( name = "page", - value = "Enterprise page.") - EnterpriseStorePage page); + value = "Enterprise page.") EnterpriseStorePage page); //###################################################################################################################### //###################################################################################################################### @@ -777,8 +764,7 @@ public interface AndroidEnterpriseService { }) Response addCluster(@ApiParam( name = "storeCluster", - value = "Enterprise cluster.") - EnterpriseStoreCluster storeCluster); + value = "Enterprise cluster.") EnterpriseStoreCluster storeCluster); //###################################################################################################################### //###################################################################################################################### @@ -965,7 +951,7 @@ public interface AndroidEnterpriseService { @ApiParam( name = "pageId", value = "The unique page pageId") - @PathParam("pageId") String pageId); + @PathParam("id") String pageId); //###################################################################################################################### //###################################################################################################################### @@ -1025,8 +1011,7 @@ public interface AndroidEnterpriseService { }) Response updateLinks(@ApiParam( name = "links", - value = "Enterprise page links.") - EnterpriseStorePageLinks links); + value = "Enterprise page links.") EnterpriseStorePageLinks links); //###################################################################################################################### //###################################################################################################################### 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/DeviceManagementService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAPI.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAPI.java index a3910c8700..73db4dd71a 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/DeviceManagementService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAPI.java @@ -32,16 +32,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.services; +package org.wso2.carbon.device.mgt.mobile.android.api; import io.swagger.annotations.*; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidApplication; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidDevice; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidApplication; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidDevice; import javax.validation.Valid; import javax.validation.constraints.NotNull; @@ -73,11 +73,10 @@ import java.util.List; } ), tags = { - @Tag(name = "android,device_management", description = "") + @Tag(name = "android,device_management", description = "Android Device Management Service") } ) -@Api(value = "Android Device Management", - description = "This carries all the resources related to the Android device management functionalities.") +@Api(value = "Android Device Management") @Path("/devices") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @@ -97,7 +96,7 @@ import java.util.List; ) } ) -public interface DeviceManagementService { +public interface DeviceManagementAPI { @PUT @Path("/{id}/applications") @@ -211,8 +210,7 @@ public interface DeviceManagementService { Response getPendingOperations( @ApiParam( name = "disableGoogleApps", - value = "Specifically disable having Google apps installed.", - required = false) + value = "Specifically disable having Google apps installed.") @QueryParam("disableGoogleApps") boolean disableGoogleApps, @ApiParam( name = "id", @@ -223,8 +221,7 @@ public interface DeviceManagementService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200.", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200.") @HeaderParam("If-Modified-Since") String ifModifiedSince, @ApiParam( name = "resultOperations", @@ -339,8 +336,7 @@ public interface DeviceManagementService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200") @HeaderParam("If-Modified-Since") String ifModifiedSince); @PUT 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/DeviceManagementAdminService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAdminAPI.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAdminAPI.java index 89787ea686..118874beca 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/DeviceManagementAdminService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAdminAPI.java @@ -33,7 +33,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services; +package org.wso2.carbon.device.mgt.mobile.android.api; import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Info; @@ -49,8 +49,26 @@ import io.swagger.annotations.ResponseHeader; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; -import org.wso2.carbon.mdm.services.android.bean.wrapper.*; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationInstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationRestrictionBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUninstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUpdateBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.BlacklistApplicationsBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.CameraBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.DeviceLockBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.DisplayMessageBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EncryptionBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.FileTransferBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.GlobalProxyBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.LockCodeBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.NotificationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.PasswordPolicyBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.UpgradeFirmwareBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.VpnBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WebClipBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WifiBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WipeDataBeanWrapper; import javax.validation.Valid; import javax.ws.rs.Consumes; @@ -75,11 +93,11 @@ import java.util.List; } ), tags = { - @Tag(name = "android,device_management", description = "") + @Tag(name = "android,device_management", description = "Android Device Management Admin Service") } ) @Path("/admin/devices") -@Api(value = "Android Device Management Administrative Service", description = "Device management related admin APIs.") +@Api(value = "Android Device Management Administrative Service") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Scopes( @@ -266,7 +284,7 @@ import java.util.List; ) } ) -public interface DeviceManagementAdminService { +public interface DeviceManagementAdminAPI { @POST @Path("/file-transfer") @@ -632,8 +650,7 @@ public interface DeviceManagementAdminService { "Disable the camera on the device by assigning true as the value or enable the " + "camera on the device to function by defining false as the value and the ID of the Android device. " + "Multiple device IDs can be added by using comma separated values. ", - required = true) - CameraBeanWrapper cameraBeanWrapper); + required = true) CameraBeanWrapper cameraBeanWrapper); @POST @Path("/info") @@ -880,8 +897,7 @@ public interface DeviceManagementAdminService { name = "wipeData", value = "Provide the the passcode, which is the passcode that the Android agent prompts the device owner to set at the time of device enrollment, " + "to enable the factory reset operation, and the ID of the Android device. Multiple device IDs can be added by using comma separated values. ", - required = true) - WipeDataBeanWrapper wipeDataBeanWrapper); + required = true) WipeDataBeanWrapper wipeDataBeanWrapper); @POST @Path("/applications") @@ -1248,8 +1264,7 @@ public interface DeviceManagementAdminService { value = "Properties required to install an application on Android devices. Provide the the package name, type," + " URL and name of the application, the date and time for the scheduled installation, and the ID of the " + "Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper); + required = true) ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper); @POST @Path("/update-application") @@ -1313,8 +1328,7 @@ public interface DeviceManagementAdminService { value = "Properties required to update an application on Android devices. Provide the the package name, type," + "URL and name of the application, the date and time for the scheduled installation, and the ID of the" + "Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - ApplicationUpdateBeanWrapper applicationUpdateBeanWrapper); + required = true) ApplicationUpdateBeanWrapper applicationUpdateBeanWrapper); @POST @Path("/uninstall-application") @@ -1375,8 +1389,7 @@ public interface DeviceManagementAdminService { value = "Properties required to uninstall an application. Provide the the package name, type," + "URL and name of the application, the date and time for the scheduled installation, and the ID of the" + "Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - ApplicationUninstallationBeanWrapper applicationUninstallationBeanWrapper); + required = true) ApplicationUninstallationBeanWrapper applicationUninstallationBeanWrapper); @POST @Path("/blacklist-applications") @@ -1504,8 +1517,7 @@ public interface DeviceManagementAdminService { "yyyy-MM-dd'T'HH:mm:ss.SSSXXX format, the OTA upgrade server URL in one of the following formats " + "(example: http//abc.com, http://abc.com/ota), " + "and the ID of the Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - UpgradeFirmwareBeanWrapper upgradeFirmwareBeanWrapper); + required = true) UpgradeFirmwareBeanWrapper upgradeFirmwareBeanWrapper); @POST @Path("/configure-vpn") @@ -1565,8 +1577,7 @@ public interface DeviceManagementAdminService { @ApiParam( name = "vpnBean", value = "VPN configuration and DeviceIds", - required = true) - VpnBeanWrapper vpnBeanWrapper); + required = true) VpnBeanWrapper vpnBeanWrapper); @POST @Path("/send-notification") @@ -1626,8 +1637,7 @@ public interface DeviceManagementAdminService { name = "notification", value = "The properties required to send a notification. Provide the message you wish to send and the ID of the " + "Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - NotificationBeanWrapper notificationBeanWrapper); + required = true) NotificationBeanWrapper notificationBeanWrapper); @POST @Path("/configure-wifi") @@ -1688,8 +1698,7 @@ public interface DeviceManagementAdminService { value = "The properties required to configure Wi-Fi. Provide the password to connect to the specified Wi-Fi network," + "the ssid or the name of the Wi-Fi network that you wish to configure and the ID of the Android device." + " Multiple device IDs can be added by using comma separated values.", - required = true) - WifiBeanWrapper wifiBeanWrapper); + required = true) WifiBeanWrapper wifiBeanWrapper); @POST @Path("/encrypt-storage") @@ -1750,8 +1759,7 @@ public interface DeviceManagementAdminService { value = "Properties required to encrypt the storage. Encrypt the storage on the device by assigning " + "true as the value or do not encrypt the storage on the device by assigning false as the value and " + "provide the ID of the Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - EncryptionBeanWrapper encryptionBeanWrapper); + required = true) EncryptionBeanWrapper encryptionBeanWrapper); @POST @Path("/change-lock-code") @@ -1812,8 +1820,7 @@ public interface DeviceManagementAdminService { value = "The properties to change th lock code. Provide the lock code that will replace the current lock code on Android devices and " + "the ID of the Android device. Multiple device IDs can be added by using comma separated values. " + "If a passcode policy has been set in EMM, the lock code should comply to the passcode policy.\t", - required = true) - LockCodeBeanWrapper lockCodeBeanWrapper); + required = true) LockCodeBeanWrapper lockCodeBeanWrapper); @POST @Path("/set-password-policy") @@ -1872,8 +1879,7 @@ public interface DeviceManagementAdminService { @ApiParam( name = "passwordPolicy", value = "The properties required to set a password policy.", - required = true) - PasswordPolicyBeanWrapper passwordPolicyBeanWrapper); + required = true) PasswordPolicyBeanWrapper passwordPolicyBeanWrapper); @POST @Path("/set-webclip") @@ -1932,8 +1938,7 @@ public interface DeviceManagementAdminService { @ApiParam( name = "webClip", value = "The properties to set the web clip.", - required = true) - WebClipBeanWrapper webClipBeanWrapper); + required = true) WebClipBeanWrapper webClipBeanWrapper); @POST @Path("/send-app-conf") @ApiOperation( @@ -1994,8 +1999,7 @@ public interface DeviceManagementAdminService { value = "The properties required to send application restrictions. Provide the restriction you " + "wish to send and the ID of the Android device. Multiple device IDs can be added by using" + " comma separated values.", - required = true) - ApplicationRestrictionBeanWrapper applicationRestrictionBeanWrapper); + required = true) ApplicationRestrictionBeanWrapper applicationRestrictionBeanWrapper); @POST @Path("/configure-global-proxy") @@ -2056,8 +2060,7 @@ public interface DeviceManagementAdminService { @ApiParam( name = "globalProxyInfo", value = "The properties to set the global proxy settings.", - required = true) - GlobalProxyBeanWrapper globalProxyBeanWrapper); + required = true) GlobalProxyBeanWrapper globalProxyBeanWrapper); @POST @Path("/configure-display-message") @@ -2107,6 +2110,5 @@ public interface DeviceManagementAdminService { name = "display-message", value = "The properties required to send a messages. Provide the message you wish to send and the ID of the " + "Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - DisplayMessageBeanWrapper displayMessageBeanWrapper); + required = true) DisplayMessageBeanWrapper displayMessageBeanWrapper); } 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/DeviceTypeConfigurationService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceTypeConfigurationService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java index 5e24409413..6e8e324ea4 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/DeviceTypeConfigurationService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services; +package org.wso2.carbon.device.mgt.mobile.android.api; import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Info; @@ -32,9 +32,9 @@ import io.swagger.annotations.ResponseHeader; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; -import org.wso2.carbon.mdm.services.android.bean.AndroidPlatformConfiguration; -import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.AndroidPlatformConfiguration; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidAgentException; import javax.validation.Valid; import javax.ws.rs.*; @@ -55,10 +55,10 @@ import javax.ws.rs.core.Response; } ), tags = { - @Tag(name = "android,device_management", description = "") + @Tag(name = "android,device_management", description = "Device Type Configuration Service") } ) -@Api(value = "Android Configuration Management", description = "This API carries all the resource used to mange the Android platform configurations.") +@Api(value = "Android Configuration Management") @Path("/configuration") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @@ -84,7 +84,7 @@ import javax.ws.rs.core.Response; ) } ) -public interface DeviceTypeConfigurationService { +public interface DeviceTypeConfigurationAPI { @GET @ApiOperation( @@ -136,8 +136,7 @@ public interface DeviceTypeConfigurationService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200") @HeaderParam("If-Modified-Since") String ifModifiedSince); @PUT @@ -245,8 +244,7 @@ public interface DeviceTypeConfigurationService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200.", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200.") @HeaderParam("If-Modified-Since") String ifModifiedSince) 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/EventReceiverService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/EventReceiverAPI.java similarity index 92% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/EventReceiverAPI.java index 93b914a5ff..09f61943c1 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/EventReceiverService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/EventReceiverAPI.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services; +package org.wso2.carbon.device.mgt.mobile.android.api; import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Info; @@ -31,9 +31,9 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ResponseHeader; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.mdm.services.android.bean.DeviceState; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EventBeanWrapper; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceState; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EventBeanWrapper; import javax.validation.Valid; import javax.validation.constraints.Size; @@ -53,12 +53,10 @@ import javax.ws.rs.core.Response; } ), tags = { - @Tag(name = "android,device_management", description = "") + @Tag(name = "android,device_management", description = "Android Even Receiver Service") } ) -@Api(value = "Event Receiver", description = "Event publishing/retrieving related APIs. To enable event publishing/retrieving you need to" + - " configure WSO2 EMM as explained in https://docs.wso2.com/display/EMM220/Managing+Event+Publishing+with+WSO2+Data+Analytics+Server, " + - "https://docs.wso2.com/display/EMM220/Creating+a+New+Event+Stream+and+Receiver") +@Api(value = "Event Receiver") @Path("/events") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @@ -72,7 +70,7 @@ import javax.ws.rs.core.Response; ) } ) -public interface EventReceiverService { +public interface EventReceiverAPI { @POST @Path("/publish") @@ -131,8 +129,7 @@ public interface EventReceiverService { @ApiParam( name = "eventBeanWrapper", value = "Information of the agent event to be published on DAS.") - @Valid - EventBeanWrapper eventBeanWrapper); + @Valid EventBeanWrapper eventBeanWrapper); @GET @ApiOperation( @@ -207,8 +204,7 @@ public interface EventReceiverService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200") @HeaderParam("If-Modified-Since") String ifModifiedSince); } 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/exception/GlobalThrowableMapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/GlobalThrowableMapper.java similarity index 88% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/GlobalThrowableMapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/GlobalThrowableMapper.java index 31370bd88e..f45df54d32 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/GlobalThrowableMapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/GlobalThrowableMapper.java @@ -16,12 +16,17 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.api.exception; import com.google.gson.JsonParseException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.ErrorDTO; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.ForbiddenException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.NotFoundException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import javax.naming.AuthenticationException; import javax.validation.ConstraintViolationException; 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/exception/ParameterValidationException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/ParameterValidationException.java similarity index 89% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ParameterValidationException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/ParameterValidationException.java index efb38a3d7a..bf729a9e92 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ParameterValidationException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/ParameterValidationException.java @@ -16,10 +16,10 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.api.exception; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import javax.validation.ConstraintViolation; import javax.ws.rs.WebApplicationException; 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/impl/AndroidEnterpriseServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/AndroidEnterpriseAPIImpl.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/AndroidEnterpriseServiceImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/AndroidEnterpriseAPIImpl.java index 26805efd7b..e4b541506f 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/impl/AndroidEnterpriseServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/AndroidEnterpriseAPIImpl.java @@ -16,9 +16,8 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services.impl; +package org.wso2.carbon.device.mgt.mobile.android.api.impl; -import com.google.api.services.androidenterprise.model.AppRestrictionsSchema; import com.google.api.services.androidenterprise.model.ProductsListResponse; import com.google.api.services.androidenterprise.model.StoreCluster; import com.google.api.services.androidenterprise.model.StoreLayout; @@ -33,29 +32,29 @@ import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManage import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.policy.mgt.ProfileFeature; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseConfigs; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStoreCluster; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePackages; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePage; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePageLinks; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseTokenUrl; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.GoogleAppSyncResponse; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseApp; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseInstallPolicy; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseUser; -import org.wso2.carbon.mdm.services.android.bean.wrapper.TokenWrapper; -import org.wso2.carbon.mdm.services.android.common.GoogleAPIInvoker; -import org.wso2.carbon.mdm.services.android.exception.BadRequestException; -import org.wso2.carbon.mdm.services.android.exception.NotFoundException; -import org.wso2.carbon.mdm.services.android.services.AndroidEnterpriseService; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidEnterpriseUtils; +import org.wso2.carbon.device.mgt.mobile.android.api.AndroidEnterpriseAPI; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.GoogleAPIInvoker; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseConfigs; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStoreCluster; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePackages; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePage; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePageLinks; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseTokenUrl; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.GoogleAppSyncResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseApp; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseInstallPolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.TokenWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.NotFoundException; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidEnterpriseUtils; import org.wso2.carbon.policy.mgt.common.FeatureManagementException; import javax.ws.rs.Consumes; @@ -76,8 +75,8 @@ import java.util.List; @Path("/enterprise") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public class AndroidEnterpriseServiceImpl implements AndroidEnterpriseService { - private static final Log log = LogFactory.getLog(AndroidEnterpriseServiceImpl.class); +public class AndroidEnterpriseAPIImpl implements AndroidEnterpriseAPI { + private static final Log log = LogFactory.getLog(AndroidEnterpriseAPIImpl.class); @Override @Produces(MediaType.APPLICATION_JSON) @@ -784,9 +783,7 @@ public class AndroidEnterpriseServiceImpl implements AndroidEnterpriseService { log.error(errorMessage); throw new NotFoundException( new ErrorResponse.ErrorResponseBuilder().setCode(Response.Status.INTERNAL_SERVER_ERROR - .getStatusCode()).setMessage(errorMessage).build()); - } - + .getStatusCode()).setMessage(errorMessage).build()); } } if (sentToDevice) { 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/impl/DeviceManagementServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAPIImpl.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAPIImpl.java index 1ffadb887b..ac075fb6f9 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/impl/DeviceManagementServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAPIImpl.java @@ -32,7 +32,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.services.impl; +package org.wso2.carbon.device.mgt.mobile.android.api.impl; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -54,17 +54,19 @@ import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceExce import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceDetailsMgtException; import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager; import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidApplication; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidDevice; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseUser; -import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; -import org.wso2.carbon.mdm.services.android.services.DeviceManagementService; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; -import org.wso2.carbon.mdm.services.android.util.Message; +import org.wso2.carbon.device.mgt.mobile.android.api.DeviceManagementAPI; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.Message; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidApplication; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidDevice; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.NotFoundException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; @@ -90,10 +92,10 @@ import java.util.List; @Path("/devices") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public class DeviceManagementServiceImpl implements DeviceManagementService { +public class DeviceManagementAPIImpl implements DeviceManagementAPI { private static final String OPERATION_ERROR_STATUS = "ERROR"; - private static final Log log = LogFactory.getLog(DeviceManagementServiceImpl.class); + private static final Log log = LogFactory.getLog(DeviceManagementAPIImpl.class); public static final String GOOGLE_AFW_EMM_ANDROID_ID = "googleEMMAndroidId"; public static final String GOOGLE_AFW_DEVICE_ID = "googleEMMDeviceId"; @@ -233,7 +235,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { if (androidDevice == null) { String errorMessage = "The payload of the android device enrollment is incorrect."; log.error(errorMessage); - throw new org.wso2.carbon.mdm.services.android.exception.BadRequestException( + throw new BadRequestException( new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } try { @@ -264,7 +266,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { EnterpriseUser user = new EnterpriseUser(); user.setAndroidPlayDeviceId(googleEMMAndroidId); user.setEmmDeviceIdentifier(googleEMMDeviceId); - AndroidEnterpriseServiceImpl enterpriseService = new AndroidEnterpriseServiceImpl(); + AndroidEnterpriseAPIImpl enterpriseService = new AndroidEnterpriseAPIImpl(); token = enterpriseService.insertUser(user); } } @@ -427,13 +429,13 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { if (androidDevice == null) { String errorMessage = "The payload of the android device enrollment is incorrect."; log.error(errorMessage); - throw new org.wso2.carbon.mdm.services.android.exception.BadRequestException( + throw new BadRequestException( new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } if (device == null) { String errorMessage = "The device to be modified doesn't exist."; log.error(errorMessage); - throw new org.wso2.carbon.mdm.services.android.exception.NotFoundException( + throw new NotFoundException( new ErrorResponse.ErrorResponseBuilder().setCode(404l).setMessage(errorMessage).build()); } if(androidDevice.getEnrolmentInfo() != 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/impl/DeviceManagementAdminServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAdminAPIImpl.java similarity index 93% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAdminAPIImpl.java index 0ed723ccee..82bd09b53b 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/impl/DeviceManagementAdminServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAdminAPIImpl.java @@ -33,7 +33,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services.impl; +package org.wso2.carbon.device.mgt.mobile.android.api.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -45,51 +45,51 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation; import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationInstallation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationRestriction; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUninstallation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUpdate; -import org.wso2.carbon.mdm.services.android.bean.BlacklistApplications; -import org.wso2.carbon.mdm.services.android.bean.Camera; -import org.wso2.carbon.mdm.services.android.bean.DeviceEncryption; -import org.wso2.carbon.mdm.services.android.bean.DeviceLock; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.FileTransfer; -import org.wso2.carbon.mdm.services.android.bean.GlobalProxy; -import org.wso2.carbon.mdm.services.android.bean.LockCode; -import org.wso2.carbon.mdm.services.android.bean.DisplayMessage; -import org.wso2.carbon.mdm.services.android.bean.Notification; -import org.wso2.carbon.mdm.services.android.bean.PasscodePolicy; -import org.wso2.carbon.mdm.services.android.bean.UpgradeFirmware; -import org.wso2.carbon.mdm.services.android.bean.Vpn; -import org.wso2.carbon.mdm.services.android.bean.WebClip; -import org.wso2.carbon.mdm.services.android.bean.Wifi; -import org.wso2.carbon.mdm.services.android.bean.WipeData; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationInstallationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationRestrictionBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUninstallationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUpdateBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.BlacklistApplicationsBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.CameraBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.DeviceLockBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EncryptionBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.FileTransferBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.GlobalProxyBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.LockCodeBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.DisplayMessageBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.NotificationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.PasswordPolicyBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.UpgradeFirmwareBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.VpnBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WebClipBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WifiBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WipeDataBeanWrapper; -import org.wso2.carbon.mdm.services.android.exception.BadRequestException; -import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; -import org.wso2.carbon.mdm.services.android.services.DeviceManagementAdminService; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; +import org.wso2.carbon.device.mgt.mobile.android.api.DeviceManagementAdminAPI; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationInstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationRestriction; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUninstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUpdate; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.BlacklistApplications; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Camera; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceEncryption; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceLock; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DisplayMessage; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.FileTransfer; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.GlobalProxy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.LockCode; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Notification; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.PasscodePolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.UpgradeFirmware; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Vpn; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WebClip; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Wifi; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WipeData; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationInstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationRestrictionBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUninstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUpdateBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.BlacklistApplicationsBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.CameraBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.DeviceLockBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.DisplayMessageBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EncryptionBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.FileTransferBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.GlobalProxyBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.LockCodeBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.NotificationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.PasswordPolicyBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.UpgradeFirmwareBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.VpnBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WebClipBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WifiBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WipeDataBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import javax.validation.Valid; import javax.ws.rs.Consumes; @@ -110,9 +110,9 @@ import java.util.List; @Path("/admin/devices") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminService { +public class DeviceManagementAdminAPIImpl implements DeviceManagementAdminAPI { - private static final Log log = LogFactory.getLog(DeviceManagementAdminServiceImpl.class); + private static final Log log = LogFactory.getLog(DeviceManagementAdminAPIImpl.class); private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ"; @POST @@ -140,7 +140,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe operation.setType(Operation.Type.PROFILE); operation.setEnabled(true); operation.setPayLoad(file.toJSON()); - Activity activity = AndroidDeviceUtils.getOperationResponse(fileTransferBeanWrapper.getDeviceIDs(), operation); + Activity activity = AndroidDeviceUtils + .getOperationResponse(fileTransferBeanWrapper.getDeviceIDs(), operation); return Response.status(Response.Status.CREATED).entity(activity).build(); } catch (InvalidDeviceException e) { String errorMessage = "Invalid Device Identifiers ( " + fileTransferBeanWrapper.getDeviceIDs() + " ) found."; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceTypeConfigurationAPIImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceTypeConfigurationAPIImpl.java new file mode 100644 index 0000000000..b2150f2159 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceTypeConfigurationAPIImpl.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.mobile.android.api.impl; + +import com.google.api.client.http.HttpStatusCodes; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.license.mgt.License; +import org.wso2.carbon.device.mgt.mobile.android.api.DeviceTypeConfigurationAPI; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.AndroidPlatformConfiguration; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestExceptionDup; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidService; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; + +import javax.validation.Valid; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/configuration") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public class DeviceTypeConfigurationAPIImpl implements DeviceTypeConfigurationAPI { + + private static final Log log = LogFactory.getLog(DeviceTypeConfigurationAPIImpl.class); + + @GET + @Override + public Response getConfiguration( + @HeaderParam("If-Modified-Since") String ifModifiedSince) { + try { + AndroidService androidService = AndroidAPIUtils.getAndroidnService(); + PlatformConfiguration platformConfiguration = androidService.getPlatformConfig(); + return Response.status(Response.Status.OK).entity(platformConfiguration).build(); + } catch (DeviceManagementException e) { + String msg = "Error occurred while retrieving the Android tenant configuration"; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(HttpStatusCodes.STATUS_CODE_SERVER_ERROR) + .setMessage(msg).build()); + } + } + + @PUT + @Override + public Response updateConfiguration( + @Valid AndroidPlatformConfiguration androidPlatformConfiguration) { + try { + AndroidService androidService = AndroidAPIUtils.getAndroidnService(); + androidService.updateConfiguration(androidPlatformConfiguration); + return Response.status(Response.Status.OK) + .entity("Android platform configuration has been updated successfully.").build(); + } catch (BadRequestExceptionDup e) { + String msg = "The payload of the android platform configuration is incorrect."; + log.error(msg, e); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(HttpStatusCodes.STATUS_CODE_BAD_REQUEST) + .setMessage(msg).build()); + } catch (AndroidDeviceMgtPluginException e) { + String msg = "Error occurred while modifying configuration settings of Android platform"; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(HttpStatusCodes.STATUS_CODE_SERVER_ERROR) + .setMessage(msg).build()); + } + + } + + @GET + @Path("/license") + @Produces(MediaType.TEXT_PLAIN) + public Response getLicense( + @HeaderParam("If-Modified-Since") String ifModifiedSince) { + try { + License license = AndroidAPIUtils.getDeviceManagementService() + .getLicense(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, + DeviceManagementConstants.LanguageCodes.LANGUAGE_CODE_ENGLISH_US); + return Response.status(Response.Status.OK).entity((license == null) ? null : license.getText()).build(); + } catch (DeviceManagementException e) { + String msg = "Error occurred while retrieving the license configured for Android device enrolment"; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(HttpStatusCodes.STATUS_CODE_SERVER_ERROR) + .setMessage(msg).build()); + } + } +} 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/impl/EventReceiverServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/EventReceiverAPIImpl.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/EventReceiverAPIImpl.java index 20c0f49217..3f3f855276 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/impl/EventReceiverServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/EventReceiverAPIImpl.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services.impl; +package org.wso2.carbon.device.mgt.mobile.android.api.impl; import com.google.gson.Gson; import com.google.gson.JsonObject; @@ -29,17 +29,17 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; -import org.wso2.carbon.mdm.services.android.bean.DeviceState; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EventBeanWrapper; -import org.wso2.carbon.mdm.services.android.exception.BadRequestException; -import org.wso2.carbon.mdm.services.android.exception.NotFoundException; -import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; -import org.wso2.carbon.mdm.services.android.services.EventReceiverService; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; -import org.wso2.carbon.mdm.services.android.util.Message; +import org.wso2.carbon.device.mgt.mobile.android.api.EventReceiverAPI; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.Message; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceState; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EventBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.NotFoundException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import javax.validation.Valid; import javax.validation.constraints.Size; @@ -52,9 +52,9 @@ import javax.ws.rs.core.Response; import java.util.List; @Path("/events") -public class EventReceiverServiceImpl implements EventReceiverService { +public class EventReceiverAPIImpl implements EventReceiverAPI { private static final String EVENT_STREAM_DEFINITION = "org.wso2.iot.LocationStream"; - private static final Log log = LogFactory.getLog(EventReceiverServiceImpl.class); + private static final Log log = LogFactory.getLog(EventReceiverAPIImpl.class); private Gson gson = new Gson(); private static final String LONGITUDE = "longitude"; 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/bean/ProxyType.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ProxyType.java deleted file mode 100644 index 3fdc4e1bae..0000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ProxyType.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.wso2.carbon.mdm.services.android.bean; - -public enum ProxyType { - MANUAL, AUTO -} 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/impl/DeviceTypeConfigurationServiceImpl.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/impl/DeviceTypeConfigurationServiceImpl.java deleted file mode 100644 index 385460e7c5..0000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. - * - * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.carbon.mdm.services.android.services.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.ServerConfiguration; -import org.wso2.carbon.device.mgt.common.Device; -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; -import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; -import org.wso2.carbon.device.mgt.common.EnrolmentInfo; -import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; -import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; -import org.wso2.carbon.device.mgt.common.license.mgt.License; -import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; -import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; -import org.wso2.carbon.mdm.services.android.bean.AndroidPlatformConfiguration; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.NotifierFrequency; -import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; -import org.wso2.carbon.mdm.services.android.services.DeviceTypeConfigurationService; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; - -import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.util.ArrayList; -import java.util.List; - -@Path("/configuration") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurationService { - - private static final Log log = LogFactory.getLog(DeviceTypeConfigurationServiceImpl.class); - - @GET - @Override - public Response getConfiguration( - @HeaderParam("If-Modified-Since") String ifModifiedSince) { - String msg; - PlatformConfiguration platformConfiguration; - List configs; - try { - platformConfiguration = AndroidAPIUtils.getDeviceManagementService(). - getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); - if (platformConfiguration != null) { - configs = platformConfiguration.getConfiguration(); - } else { - platformConfiguration = new PlatformConfiguration(); - configs = new ArrayList<>(); - } - ConfigurationEntry entry = new ConfigurationEntry(); - License license = AndroidAPIUtils.getDeviceManagementService().getLicense( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, AndroidConstants. - TenantConfigProperties.LANGUAGE_US); - - if (configs != null) { - ConfigurationEntry versionEntry = new ConfigurationEntry(); - versionEntry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); - versionEntry.setName(AndroidConstants.TenantConfigProperties.SERVER_VERSION); - versionEntry.setValue(ServerConfiguration.getInstance().getFirstProperty("Version")); - configs.add(versionEntry); - if (license != null) { - entry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); - entry.setName(AndroidConstants.TenantConfigProperties.LICENSE_KEY); - entry.setValue(license.getText()); - configs.add(entry); - } - platformConfiguration.setConfiguration(configs); - } - } catch (DeviceManagementException e) { - msg = "Error occurred while retrieving the Android tenant configuration"; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } - return Response.status(Response.Status.OK).entity(platformConfiguration).build(); - } - - @PUT - @Override - public Response updateConfiguration(@Valid AndroidPlatformConfiguration androidPlatformConfiguration) { - String msg; - ConfigurationEntry licenseEntry = null; - PlatformConfiguration configuration = new PlatformConfiguration(); - if (androidPlatformConfiguration == null) { - String errorMessage = "The payload of the android platform configuration is incorrect."; - log.error(errorMessage); - throw new org.wso2.carbon.mdm.services.android.exception.BadRequestException( - new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); - } - configuration.setConfiguration(androidPlatformConfiguration.getConfiguration()); - try { - configuration.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); - List configs = configuration.getConfiguration(); - NotifierFrequency notifierFrequency = new NotifierFrequency(); - for (ConfigurationEntry entry : configs) { - if (AndroidConstants.TenantConfigProperties.LICENSE_KEY.equals(entry.getName())) { - License license = new License(); - license.setName(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); - license.setLanguage(AndroidConstants.TenantConfigProperties.LANGUAGE_US); - license.setVersion("1.0.0"); - license.setText(entry.getValue().toString()); - AndroidAPIUtils.getDeviceManagementService().addLicense(DeviceManagementConstants. - MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, license); - licenseEntry = entry; - } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_FREQUENCY.equals(entry.getName())) { - if (entry.getValue() != null) { - notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString())); - } else { - return Response.status(Response.Status.BAD_REQUEST) - .entity("No value specified for notifierFrequency.").build(); - } - } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_TYPE.equals(entry.getName())) { - if (entry.getValue() != null) { - notifierFrequency.setType(Integer.parseInt(entry.getValue().toString())); - } else { - return Response.status(Response.Status.BAD_REQUEST) - .entity("No value specified for notifierType.").build(); - } - } - } - - if (licenseEntry != null) { - configs.remove(licenseEntry); - } - configuration.setConfiguration(configs); - AndroidAPIUtils.getDeviceManagementService().saveConfiguration(configuration); - notifyDevices(notifierFrequency); - } catch (DeviceManagementException e) { - msg = "Error occurred while modifying configuration settings of Android platform"; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } catch (NumberFormatException e) { - msg = "Error occurred while reading notification frequency."; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } catch (OperationManagementException e) { - msg = "Error occurred while modifying configuration settings of Android platform."; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } catch (InvalidDeviceException e) { - msg = "Error occurred with the device."; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } - return Response.status(Response.Status.OK) - .entity("Android platform configuration has been updated successfully.").build(); - } - - private void notifyDevices(NotifierFrequency notifierFrequency) throws DeviceManagementException, - OperationManagementException, InvalidDeviceException { - List deviceList = AndroidAPIUtils. - getDeviceManagementService(). - getAllDevices(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, false); - List deviceIdList = new ArrayList<>(); - for (Device device : deviceList) { - if (EnrolmentInfo.Status.REMOVED != device.getEnrolmentInfo().getStatus()) { - deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType())); - } - } - if (!deviceIdList.isEmpty()) { - ProfileOperation operation = new ProfileOperation(); - operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY); - operation.setPayLoad(notifierFrequency.toJSON()); - operation.setEnabled(true); - AndroidAPIUtils.getDeviceManagementService().addOperation( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, - operation, deviceIdList); - } - } - - @GET - @Path("/license") - @Produces(MediaType.TEXT_PLAIN) - public Response getLicense( - @HeaderParam("If-Modified-Since") String ifModifiedSince) { - License license; - try { - license = - AndroidAPIUtils.getDeviceManagementService().getLicense( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, - DeviceManagementConstants.LanguageCodes.LANGUAGE_CODE_ENGLISH_US); - } catch (DeviceManagementException e) { - String msg = "Error occurred while retrieving the license configured for Android device enrolment"; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } - return Response.status(Response.Status.OK).entity((license == null) ? null : license.getText()).build(); - } - -} 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/DeviceIDHolder.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/DeviceIDHolder.java deleted file mode 100644 index 7b09fc7008..0000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/DeviceIDHolder.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.carbon.mdm.services.android.util; - -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; - -import java.util.List; - -/** - * Holder class for storing valid & invalid device-ids. - */ -public class DeviceIDHolder { - - private List errorDeviceIdList; - private List validDeviceIDList; - - public List getErrorDeviceIdList() { - return errorDeviceIdList; - } - - public void setErrorDeviceIdList(List errorDeviceIdList) { - this.errorDeviceIdList = errorDeviceIdList; - } - - public List getValidDeviceIDList() { - return validDeviceIDList; - } - - public void setValidDeviceIDList(List validDeviceIDList) { - this.validDeviceIDList = validDeviceIDList; - } -} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 9b8fd84e18..4d74e7e7fa 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -44,8 +44,8 @@ - - + + @@ -60,13 +60,13 @@ - - - - - - - + + + + + + + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/web.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/web.xml index b624104319..33eca93f1b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/web.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/web.xml @@ -76,7 +76,7 @@ ApiOriginFilter - org.wso2.carbon.mdm.services.android.util.ApiOriginFilter + org.wso2.carbon.device.mgt.mobile.android.addons.ApiOriginFilter ApiOriginFilter diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementAdminServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementAdminServiceTests.java deleted file mode 100644 index a8a267bebe..0000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementAdminServiceTests.java +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.carbon.mdm.services.android; - -import org.mockito.MockitoAnnotations; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.testng.PowerMockObjectFactory; -import org.testng.Assert; -import org.testng.IObjectFactory; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.ObjectFactory; -import org.testng.annotations.Test; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; -import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; -import org.wso2.carbon.mdm.services.android.mocks.DeviceManagementProviderServiceMock; -import org.wso2.carbon.mdm.services.android.services.impl.DeviceManagementAdminServiceImpl; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.utils.TestUtils; - -import javax.ws.rs.core.Response; - -@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) -@PrepareForTest(AndroidAPIUtils.class) -public class DeviceManagementAdminServiceTests { - - private DeviceManagementAdminServiceImpl deviceManagementAdminService; - - @ObjectFactory - public IObjectFactory getObjectFactory() { - return new PowerMockObjectFactory(); - } - - @BeforeClass - public void init() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - MockitoAnnotations.initMocks(this); - deviceManagementAdminService = new DeviceManagementAdminServiceImpl(); - } - - private void mockDeviceManagementService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceManagementService")) - .toReturn(new DeviceManagementProviderServiceMock()); - } - - @Test - public void testConfigureDeviceLock() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.configureDeviceLock(TestUtils.getDeviceLockBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testConfigureDeviceUnlock() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.configureDeviceUnlock(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetDeviceLocation() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.getDeviceLocation(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testRemovePassword() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.removePassword(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testConfigureCamera() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.configureCamera(TestUtils.getCamerabeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetDeviceInformation() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.getDeviceInformation(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetDeviceLogcat() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.getDeviceLogcat(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testWipeDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.wipeDevice(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testWipeData() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.wipeData(TestUtils.getWipeDataBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetApplications() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.getApplications(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testRingDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.ringDevice(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testRebootDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.rebootDevice(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testChangeLockTask() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.changeLockTask(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testMuteDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.muteDevice(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testInstallApplication() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService - .installApplication(TestUtils.getApplicationInstallationBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testUpdateApplication() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.updateApplication(TestUtils.getApplicationUpdateBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testUninstallApplicationPublic() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService - .uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperPublic()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testUninstallApplicationWebApp() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService - .uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperWebApp()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testBlacklistApplications() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService - .blacklistApplications(TestUtils.getBlacklistApplicationsBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testUpgradeFirmware() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.upgradeFirmware(TestUtils.getUpgradeFirmwareBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testConfigureVPN() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.configureVPN(TestUtils.getVpnBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testSendNotification() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.sendNotification(TestUtils.getNotificationBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testConfigureWifi() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.configureWifi(TestUtils.getWifiBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testEncryptStorage() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.encryptStorage(TestUtils.getEncryptionBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testChangeLockCode() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.changeLockCode(TestUtils.getLockCodeBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testSetPasswordPolicy() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.setPasswordPolicy(TestUtils.getPasswordPolicyBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testSetWebClip() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.setWebClip(TestUtils.getWebClipBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - -} - diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementServiceTests.java deleted file mode 100644 index af08bb863f..0000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementServiceTests.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.carbon.mdm.services.android; - -import org.mockito.MockitoAnnotations; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.testng.PowerMockObjectFactory; -import org.testng.Assert; -import org.testng.IObjectFactory; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.ObjectFactory; -import org.testng.annotations.Test; -import org.wso2.carbon.device.mgt.common.Device; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; -import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidDevice; -import org.wso2.carbon.mdm.services.android.mocks.ApplicationManagementProviderServiceMock; -import org.wso2.carbon.mdm.services.android.mocks.DeviceInformationManagerServiceMock; -import org.wso2.carbon.mdm.services.android.mocks.DeviceManagementProviderServiceMock; -import org.wso2.carbon.mdm.services.android.mocks.NotificationManagementServiceMock; -import org.wso2.carbon.mdm.services.android.mocks.PolicyManagerServiceMock; -import org.wso2.carbon.mdm.services.android.services.impl.DeviceManagementServiceImpl; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.utils.TestUtils; - -import javax.ws.rs.core.Response; -import java.util.ArrayList; -import java.util.List; - -@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) -@PrepareForTest(AndroidAPIUtils.class) -public class DeviceManagementServiceTests { - - private DeviceManagementServiceImpl deviceManagementService; - - @ObjectFactory - public IObjectFactory getObjectFactory() { - return new PowerMockObjectFactory(); - } - - @BeforeClass - public void init() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - MockitoAnnotations.initMocks(this); - deviceManagementService = new DeviceManagementServiceImpl(); - } - - private void mockDeviceManagementService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceManagementService")) - .toReturn(new DeviceManagementProviderServiceMock()); - } - - private void mockApplicationManagerService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getApplicationManagerService")) - .toReturn(new ApplicationManagementProviderServiceMock()); - } - - private void mockPolicyManagerService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getPolicyManagerService")) - .toReturn(new PolicyManagerServiceMock()); - } - - private void mockDeviceInformationManagerService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceInformationManagerService")) - .toReturn(new DeviceInformationManagerServiceMock()); - } - - private void mockNotificationManagementService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getNotificationManagementService")) - .toReturn(new NotificationManagementServiceMock()); - } - - private void mockUser() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getAuthenticatedUser")) - .toReturn("admin"); - } - - @Test - public void testUpdateApplicationList() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockApplicationManagerService(); - Response response = deviceManagementService - .updateApplicationList(TestUtils.getDeviceId(), TestUtils.getAndroidApplications()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.ACCEPTED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsForNullDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - Response response = deviceManagementService - .getPendingOperations(true, null, null, null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode()); - } - - @Test - public void testGetPendingOperationsInvalidDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService - .getPendingOperations(true, "1234", null, null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); - } - - @Test - public void testGetPendingOperationsNullResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsWithMonitorResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockPolicyManagerService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, - TestUtils.getSuccessMonitorOperationResponse()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsWithApplicationResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockApplicationManagerService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, - TestUtils.getSuccessApplicationOperationResponse()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsWithDeviceInfoResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockDeviceInformationManagerService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, - TestUtils.getSuccessInfoOperationResponse()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsWithInProgressResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, - TestUtils.getInProgressOperationResponse()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsWithErrorResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockNotificationManagementService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, - TestUtils.getErrorOperationResponse()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testEnrollDeviceWithoutLocationSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockPolicyManagerService(); - mockUser(); - Response response = deviceManagementService.enrollDevice(TestUtils.getBasicAndroidDevice()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); - } - - @Test - public void testEnrollDeviceWithLocationSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockDeviceInformationManagerService(); - mockPolicyManagerService(); - mockUser(); - AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); - - List properties = new ArrayList<>(); - Device.Property property = new Device.Property(); - property.setName("LATITUDE"); - property.setValue("79.5"); - properties.add(property); - property = new Device.Property(); - property.setName("LONGITUDE"); - property.setValue("6.9"); - properties.add(property); - property = new Device.Property(); - property.setName("ALTITUDE"); - property.setValue("-59.8373726"); - properties.add(property); - property = new Device.Property(); - property.setName("SPEED"); - property.setValue("0.5123423333"); - properties.add(property); - property = new Device.Property(); - property.setName("BEARING"); - property.setValue("44.0"); - properties.add(property); - property = new Device.Property(); - property.setName("DISTANCE"); - property.setValue("44.0"); - properties.add(property); - androidDevice.setProperties(properties); - - Response response = deviceManagementService.enrollDevice(androidDevice); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); - } - - @Test - public void testEnrollDeviceUnSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockUser(); - AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); - androidDevice.setDeviceIdentifier("1234"); - Response response = deviceManagementService.enrollDevice(androidDevice); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); - } - - @Test - public void testIsEnrolledExists() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService.isEnrolled(TestUtils.getDeviceId(), null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); - } - - @Test - public void testIsEnrolledNonExist() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService.isEnrolled("1234", null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); - } - - @Test - public void testIsEnrolledNull() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService.isEnrolled(null, null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); - } - - @Test - public void testModifyEnrollmentSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockUser(); - Response response = deviceManagementService - .modifyEnrollment(TestUtils.getDeviceId(), TestUtils.getBasicAndroidDevice()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.ACCEPTED.getStatusCode()); - } - - @Test - public void testModifyEnrollmentUnSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockUser(); - AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); - androidDevice.setDeviceIdentifier("1234"); - Response response = deviceManagementService - .modifyEnrollment(TestUtils.getDeviceId(), androidDevice); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_MODIFIED.getStatusCode()); - } - - @Test - public void testDisEnrollDeviceSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService.disEnrollDevice(TestUtils.getDeviceId()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); - } - - @Test - public void testDisenrollUnSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService.disEnrollDevice("1234"); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); - } - -} - diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/pom.xml new file mode 100644 index 0000000000..b04328c702 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/pom.xml @@ -0,0 +1,117 @@ + + + + + + android-plugin + org.wso2.carbon.devicemgt-plugins + 5.0.5-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.mobile.android.common + bundle + WSO2 Carbon - Mobile Device Management Android Common Impl + WSO2 Carbon - Mobile Device Management Android Common Implementation + https://entgra.io/ + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.felix + maven-scr-plugin + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.artifactId} + ${project.artifactId} + ${carbon.devicemgt.plugins.version} + Device Management Mobile Android Impl Bundle + + io.swagger.annotations.*;resolution:=optional, + javax.validation.constraints, + javax.xml.bind.annotation.*, + javax.xml, + javax.xml.stream, + javax.xml.bind.*, + javax.xml.parsers; version=0.0.0, + javax.naming, + org.wso2.carbon.context, + org.wso2.carbon.utils.*, + org.wso2.carbon.device.mgt.common.*, + org.wso2.carbon.ndatasource.core, + org.wso2.carbon.policy.mgt.common.*, + org.wso2.carbon.device.mgt.extensions.license.mgt.registry, + com.google.gson.* + + + org.wso2.carbon.device.mgt.mobile.android.common.* + + + + + + + + + + org.wso2.carbon + org.wso2.carbon.logging + + + com.google.code.gson + gson + + + com.google.apis + google-api-services-androidenterprise + v1-rev186-1.25.0 + + + io.swagger + swagger-annotations + + + org.hibernate + hibernate-validator + + + org.wso2.carbon.devicemgt + org.wso2.carbon.device.mgt.common + provided + + + javax.ws.rs + javax.ws.rs-api + + + org.codehaus.jackson + jackson-core-asl + + + 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/AndroidConstants.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidConstants.java similarity index 99% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidConstants.java index e7d618b70f..d96c8d0e5b 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/AndroidConstants.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidConstants.java @@ -50,7 +50,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.common; /** * Defines constants used in Android-REST API bundle. 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/util/AndroidPluginConstants.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidPluginConstants.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/AndroidPluginConstants.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidPluginConstants.java index a0c7a332da..79835c2bb7 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/util/AndroidPluginConstants.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidPluginConstants.java @@ -34,7 +34,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.util; +package org.wso2.carbon.device.mgt.mobile.android.common; /** * Defines constants used by android plugin. 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/common/ErrorHandler.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorHandler.java similarity index 89% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ErrorHandler.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorHandler.java index 542cd6078b..2bcbbed6fa 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ErrorHandler.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorHandler.java @@ -15,9 +15,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.common; +package org.wso2.carbon.device.mgt.mobile.android.common; -import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidAgentException; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; 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/common/ErrorMessage.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorMessage.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ErrorMessage.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorMessage.java index fd880c04ce..793fb72911 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ErrorMessage.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorMessage.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.common; +package org.wso2.carbon.device.mgt.mobile.android.common; public class ErrorMessage { 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/common/GoogleAPIInvoker.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GoogleAPIInvoker.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/GoogleAPIInvoker.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GoogleAPIInvoker.java index 4e700a7e14..da1cc20234 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/GoogleAPIInvoker.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GoogleAPIInvoker.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.common; +package org.wso2.carbon.device.mgt.mobile.android.common; import com.google.api.client.auth.oauth2.Credential; import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; @@ -49,11 +49,11 @@ import com.google.api.services.androidenterprise.model.User; import com.google.common.collect.ImmutableList; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStoreCluster; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePackages; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePage; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseTokenUrl; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStoreCluster; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePackages; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePage; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseTokenUrl; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; import java.io.ByteArrayInputStream; import java.io.IOException; 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/common/GsonMessageBodyHandler.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GsonMessageBodyHandler.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/GsonMessageBodyHandler.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GsonMessageBodyHandler.java index 2976300290..9ffe273a4d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/GsonMessageBodyHandler.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GsonMessageBodyHandler.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.common; +package org.wso2.carbon.device.mgt.mobile.android.common; import com.google.gson.Gson; import com.google.gson.GsonBuilder; 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/Message.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/Message.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/Message.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/Message.java index 8cb5f6d147..b8168d8379 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/Message.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/Message.java @@ -16,9 +16,8 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.common; -import javax.ws.rs.core.MediaType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; 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/bean/AndroidOperation.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidOperation.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AndroidOperation.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidOperation.java index 3361b90dc7..aeccd384d9 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AndroidOperation.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidOperation.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import com.google.gson.Gson; /* 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/bean/AndroidPlatformConfiguration.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidPlatformConfiguration.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AndroidPlatformConfiguration.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidPlatformConfiguration.java index 9832c3f035..7dc0505ecd 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AndroidPlatformConfiguration.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidPlatformConfiguration.java @@ -16,12 +16,11 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; -import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; 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/bean/ApiRegistrationProfile.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApiRegistrationProfile.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApiRegistrationProfile.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApiRegistrationProfile.java index 6b14c0d385..a88a907e70 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApiRegistrationProfile.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApiRegistrationProfile.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; public class ApiRegistrationProfile { 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/bean/AppRestriction.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AppRestriction.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AppRestriction.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AppRestriction.java index 2c8d8c93db..4f82dcc7c2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AppRestriction.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AppRestriction.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/ApplicationInstallation.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationInstallation.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationInstallation.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationInstallation.java index 4c90d42cb6..3fcfc34a15 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationInstallation.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationInstallation.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/ApplicationRestriction.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationRestriction.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationRestriction.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationRestriction.java index b3773376df..1ed7f12435 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationRestriction.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationRestriction.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/ApplicationUninstallation.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUninstallation.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUninstallation.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUninstallation.java index a5356ae59c..e8efbdef09 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUninstallation.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUninstallation.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/ApplicationUpdate.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUpdate.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUpdate.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUpdate.java index 95241b4443..cd9084df1c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUpdate.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUpdate.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/BasicUserInfo.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BasicUserInfo.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/BasicUserInfo.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BasicUserInfo.java index 6117fb2463..1f361b3367 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/BasicUserInfo.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BasicUserInfo.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/BlacklistApplications.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BlacklistApplications.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/BlacklistApplications.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BlacklistApplications.java index b7db289767..cf99c2cf46 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/BlacklistApplications.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BlacklistApplications.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/Camera.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Camera.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Camera.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Camera.java index 0dad70364a..21ee35f082 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Camera.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Camera.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/DeviceEncryption.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceEncryption.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceEncryption.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceEncryption.java index 68ab6ae947..0b5473de1e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceEncryption.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceEncryption.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/DeviceLock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceLock.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceLock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceLock.java index e76ff6f1a1..f0475d7c3a 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceLock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceLock.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/DeviceState.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceState.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceState.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceState.java index fb23b0fcc9..911fe5f37d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceState.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceState.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/Disenrollment.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Disenrollment.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Disenrollment.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Disenrollment.java index c591d2ae0a..99e329c7dc 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Disenrollment.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Disenrollment.java @@ -16,11 +16,11 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; + import java.io.Serializable; @ApiModel(value = "Disenrollment", 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/bean/DisplayMessage.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DisplayMessage.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DisplayMessage.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DisplayMessage.java index 20531f6f92..eda4257388 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DisplayMessage.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DisplayMessage.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/EnterpriseConfigs.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseConfigs.java similarity index 90% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseConfigs.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseConfigs.java index 41abaa3809..81d58ec424 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseConfigs.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseConfigs.java @@ -1,4 +1,4 @@ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; public class EnterpriseConfigs { 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/bean/EnterpriseStoreCluster.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStoreCluster.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStoreCluster.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStoreCluster.java index a29e46e1a9..59d2eff9c0 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStoreCluster.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStoreCluster.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import java.util.List; 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/bean/EnterpriseStorePackages.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePackages.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePackages.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePackages.java index a93672892f..69dba56d99 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePackages.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePackages.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; public class EnterpriseStorePackages { 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/bean/EnterpriseStorePage.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePage.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePage.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePage.java index 841338d52e..b6b5788973 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePage.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePage.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import java.util.List; 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/bean/EnterpriseStorePageLinks.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePageLinks.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePageLinks.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePageLinks.java index 9fb4f5050c..73b5148302 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePageLinks.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePageLinks.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import java.util.List; 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/bean/EnterpriseTokenUrl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseTokenUrl.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseTokenUrl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseTokenUrl.java index e93e20c10b..7aaf2739d2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseTokenUrl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseTokenUrl.java @@ -17,7 +17,7 @@ * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; public class EnterpriseTokenUrl { 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/bean/ErrorListItem.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorListItem.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ErrorListItem.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorListItem.java index 1e48b01833..2d8ca08567 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ErrorListItem.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorListItem.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; 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/bean/ErrorResponse.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorResponse.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ErrorResponse.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorResponse.java index 457782adea..97b7eb7684 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ErrorResponse.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorResponse.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; 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/bean/FileTransfer.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/FileTransfer.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/FileTransfer.java index 2e8af23a7c..8677147f51 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/FileTransfer.java @@ -15,11 +15,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.AndroidOperation; import java.io.Serializable; 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/bean/GlobalProxy.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GlobalProxy.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/GlobalProxy.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GlobalProxy.java index 5414a14072..46fb31c736 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/GlobalProxy.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GlobalProxy.java @@ -17,7 +17,7 @@ * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/GoogleAppSyncResponse.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GoogleAppSyncResponse.java similarity index 77% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/GoogleAppSyncResponse.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GoogleAppSyncResponse.java index 3eafae848a..896eeef08b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/GoogleAppSyncResponse.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GoogleAppSyncResponse.java @@ -1,4 +1,4 @@ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; public class GoogleAppSyncResponse { 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/bean/LockCode.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/LockCode.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/LockCode.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/LockCode.java index 4c2764dade..0e139e9242 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/LockCode.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/LockCode.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/Notification.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Notification.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Notification.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Notification.java index 7cc4d46273..ade05a1a40 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Notification.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Notification.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/NotifierFrequency.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/NotifierFrequency.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/NotifierFrequency.java index b38a8b802a..f441ffb1e5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/NotifierFrequency.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/PasscodePolicy.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/PasscodePolicy.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/PasscodePolicy.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/PasscodePolicy.java index c2e48ce70c..8cd56e51ec 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/PasscodePolicy.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/PasscodePolicy.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ProxyType.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ProxyType.java new file mode 100644 index 0000000000..d638b071fc --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ProxyType.java @@ -0,0 +1,5 @@ +package org.wso2.carbon.device.mgt.mobile.android.common.bean; + +public enum ProxyType { + MANUAL, AUTO +} 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/bean/UpgradeFirmware.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/UpgradeFirmware.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/UpgradeFirmware.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/UpgradeFirmware.java index 748ee0e598..f07a519db7 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/UpgradeFirmware.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/UpgradeFirmware.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/Vpn.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Vpn.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Vpn.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Vpn.java index 188d44f8fc..76be3fc289 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Vpn.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Vpn.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/WebClip.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WebClip.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/WebClip.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WebClip.java index cf39b10703..06b815df42 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/WebClip.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WebClip.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/Wifi.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Wifi.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Wifi.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Wifi.java index 8cdf3c58bb..d8e1309870 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Wifi.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Wifi.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/WipeData.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WipeData.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/WipeData.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WipeData.java index 83efddc126..ff1c05bc0b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/WipeData.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WipeData.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/wrapper/AndroidApplication.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidApplication.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidApplication.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidApplication.java index 8dee1a60d0..1c1776350d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidApplication.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidApplication.java @@ -1,4 +1,4 @@ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/wrapper/AndroidDevice.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDevice.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDevice.java index 6c5fcec34d..274b6ec891 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDevice.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModelProperty; import org.wso2.carbon.device.mgt.common.Device; 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/bean/wrapper/AndroidDeviceInfo.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDeviceInfo.java similarity index 99% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDeviceInfo.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDeviceInfo.java index 41fbb58570..148d46d56e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDeviceInfo.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDeviceInfo.java @@ -1,4 +1,4 @@ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; 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/bean/wrapper/AppRestrictionBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AppRestrictionBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AppRestrictionBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AppRestrictionBeanWrapper.java index 64412336e0..70a520b89b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AppRestrictionBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AppRestrictionBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.AppRestriction; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.AppRestriction; import java.util.List; 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/bean/wrapper/ApplicationInstallationBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationInstallationBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationInstallationBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationInstallationBeanWrapper.java index b0bd54cf30..6887030803 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationInstallationBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationInstallationBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.ApplicationInstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationInstallation; import java.util.List; 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/bean/wrapper/ApplicationRestrictionBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationRestrictionBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationRestrictionBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationRestrictionBeanWrapper.java index 147a577da5..0f6e8b9796 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationRestrictionBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationRestrictionBeanWrapper.java @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.ApplicationRestriction; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationRestriction; import java.util.List; 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/bean/wrapper/ApplicationUninstallationBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUninstallationBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationUninstallationBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUninstallationBeanWrapper.java index 28c72c6cd0..ad88bbb355 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationUninstallationBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUninstallationBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUninstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUninstallation; import java.util.List; 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/bean/wrapper/ApplicationUpdateBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUpdateBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationUpdateBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUpdateBeanWrapper.java index b202bf8833..241cec506a 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationUpdateBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUpdateBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUpdate; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUpdate; import java.util.List; 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/bean/wrapper/BlacklistApplicationsBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/BlacklistApplicationsBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/BlacklistApplicationsBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/BlacklistApplicationsBeanWrapper.java index 32b107bf46..19f0e5a362 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/BlacklistApplicationsBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/BlacklistApplicationsBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.BlacklistApplications; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.BlacklistApplications; import javax.validation.Valid; import java.util.List; 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/bean/wrapper/CameraBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/CameraBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/CameraBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/CameraBeanWrapper.java index 9f9a014f2c..04ac86a90d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/CameraBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/CameraBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.Camera; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Camera; import java.util.List; 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/bean/wrapper/DeviceEnrollmentInfo.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceEnrollmentInfo.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DeviceEnrollmentInfo.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceEnrollmentInfo.java index b2f77cc31b..c6882a6e76 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DeviceEnrollmentInfo.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceEnrollmentInfo.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/wrapper/DeviceLockBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceLockBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DeviceLockBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceLockBeanWrapper.java index bd668fabaf..31e5e41aa8 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DeviceLockBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceLockBeanWrapper.java @@ -16,11 +16,11 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.DeviceLock; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceLock; import java.util.List; 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/bean/wrapper/DisenrollmentBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisenrollmentBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DisenrollmentBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisenrollmentBeanWrapper.java index fdcab01203..308da5161e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DisenrollmentBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisenrollmentBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.Disenrollment; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Disenrollment; import java.util.List; 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/bean/wrapper/DisplayMessageBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisplayMessageBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DisplayMessageBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisplayMessageBeanWrapper.java index 8ef1fe644b..ca1330b3c0 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DisplayMessageBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisplayMessageBeanWrapper.java @@ -16,11 +16,11 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.DisplayMessage; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DisplayMessage; import java.util.List; 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/bean/wrapper/EncryptionBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EncryptionBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EncryptionBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EncryptionBeanWrapper.java index aeb01400aa..557d395409 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EncryptionBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EncryptionBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.DeviceEncryption; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceEncryption; import java.util.List; 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/bean/wrapper/EnterpriseApp.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseApp.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseApp.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseApp.java index e20d1547d2..1d12d1d957 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseApp.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseApp.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import com.google.api.services.androidenterprise.model.VariableSet; 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/bean/wrapper/EnterpriseInstallPolicy.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseInstallPolicy.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseInstallPolicy.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseInstallPolicy.java index 677e6d33ca..fe659659bd 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseInstallPolicy.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseInstallPolicy.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import java.io.Serializable; import java.util.List; 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/bean/wrapper/EnterpriseUser.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseUser.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseUser.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseUser.java index 990e3fa4ec..ff9bc4b38e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseUser.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseUser.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; public class EnterpriseUser { 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/bean/wrapper/EventBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EventBeanWrapper.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EventBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EventBeanWrapper.java index c4fb13e07b..ed4e314d3e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EventBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EventBeanWrapper.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; 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/bean/wrapper/FileTransferBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/FileTransferBeanWrapper.java similarity index 93% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/FileTransferBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/FileTransferBeanWrapper.java index d34b00e664..4777c31339 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/FileTransferBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/FileTransferBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.FileTransfer; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.FileTransfer; import java.util.List; 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/bean/wrapper/GlobalProxyBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/GlobalProxyBeanWrapper.java similarity index 92% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/GlobalProxyBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/GlobalProxyBeanWrapper.java index 1063ee260f..09c3bc0e30 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/GlobalProxyBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/GlobalProxyBeanWrapper.java @@ -17,11 +17,11 @@ * */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.GlobalProxy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.GlobalProxy; import java.util.List; 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/bean/wrapper/LockCodeBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/LockCodeBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/LockCodeBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/LockCodeBeanWrapper.java index 364fd39d28..4cf164d46b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/LockCodeBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/LockCodeBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.LockCode; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.LockCode; import java.util.List; 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/bean/wrapper/NotificationBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/NotificationBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/NotificationBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/NotificationBeanWrapper.java index eb82e49ee7..97bb7f7069 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/NotificationBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/NotificationBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.Notification; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Notification; import java.util.List; 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/bean/wrapper/PasswordPolicyBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/PasswordPolicyBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/PasswordPolicyBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/PasswordPolicyBeanWrapper.java index e47ece1c5a..b9e728624b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/PasswordPolicyBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/PasswordPolicyBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.PasscodePolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.PasscodePolicy; import java.util.List; 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/bean/wrapper/TokenWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/TokenWrapper.java similarity index 72% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/TokenWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/TokenWrapper.java index a3a706efad..7bf731e183 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/TokenWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/TokenWrapper.java @@ -1,4 +1,4 @@ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; public class TokenWrapper { 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/bean/wrapper/UpgradeFirmwareBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/UpgradeFirmwareBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/UpgradeFirmwareBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/UpgradeFirmwareBeanWrapper.java index b881422c29..ed0231d6a2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/UpgradeFirmwareBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/UpgradeFirmwareBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.UpgradeFirmware; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.UpgradeFirmware; import java.util.List; 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/bean/wrapper/VpnBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/VpnBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/VpnBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/VpnBeanWrapper.java index e71270d229..1a2d67a59c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/VpnBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/VpnBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.Vpn; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Vpn; import java.util.List; 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/bean/wrapper/WebClipBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WebClipBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WebClipBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WebClipBeanWrapper.java index fb2edc239b..6f86673116 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WebClipBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WebClipBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.WebClip; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WebClip; import java.util.List; 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/bean/wrapper/WifiBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WifiBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WifiBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WifiBeanWrapper.java index 2d63a27d9c..85e6df2d33 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WifiBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WifiBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.Wifi; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Wifi; import java.util.List; 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/bean/wrapper/WipeDataBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WipeDataBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WipeDataBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WipeDataBeanWrapper.java index b7ebb2903c..fe753bd3f1 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WipeDataBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WipeDataBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.WipeData; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WipeData; import java.util.List; 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/config/datasource/AndroidDataSourceConfigurations.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/AndroidDataSourceConfigurations.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/AndroidDataSourceConfigurations.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/AndroidDataSourceConfigurations.java index 9409bab13f..a0d3fbbd79 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/config/datasource/AndroidDataSourceConfigurations.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/AndroidDataSourceConfigurations.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource; +package org.wso2.carbon.device.mgt.mobile.android.common.config.datasource; import javax.xml.bind.annotation.XmlElement; 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/config/datasource/DataSourceConfigAdapter.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/DataSourceConfigAdapter.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/DataSourceConfigAdapter.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/DataSourceConfigAdapter.java index 75a95c7c78..5b0aa5713f 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/config/datasource/DataSourceConfigAdapter.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/DataSourceConfigAdapter.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource; +package org.wso2.carbon.device.mgt.mobile.android.common.config.datasource; import javax.xml.bind.annotation.adapters.XmlAdapter; import java.util.HashMap; 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/config/datasource/JNDILookupDefinition.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/JNDILookupDefinition.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/JNDILookupDefinition.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/JNDILookupDefinition.java index d98022058d..770963989a 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/config/datasource/JNDILookupDefinition.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/JNDILookupDefinition.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource; +package org.wso2.carbon.device.mgt.mobile.android.common.config.datasource; import javax.xml.bind.annotation.*; import java.util.List; 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/config/datasource/MobileDataSourceConfig.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfig.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/MobileDataSourceConfig.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfig.java index cb0e78fb28..09bb84de4c 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/config/datasource/MobileDataSourceConfig.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfig.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource; +package org.wso2.carbon.device.mgt.mobile.android.common.config.datasource; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; 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/config/datasource/MobileDataSourceConfigurations.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfigurations.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/MobileDataSourceConfigurations.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfigurations.java index c698e78004..b4613bd994 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/config/datasource/MobileDataSourceConfigurations.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfigurations.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource; +package org.wso2.carbon.device.mgt.mobile.android.common.config.datasource; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; 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/config/task/TaskConfiguration.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/task/TaskConfiguration.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/task/TaskConfiguration.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/task/TaskConfiguration.java index 9c98306fbd..56b873c34f 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/config/task/TaskConfiguration.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/task/TaskConfiguration.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.task; +package org.wso2.carbon.device.mgt.mobile.android.common.config.task; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; 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/dto/AndroidEnterpriseManagedConfig.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseManagedConfig.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/AndroidEnterpriseManagedConfig.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseManagedConfig.java index 687327d6df..30e717dc73 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/dto/AndroidEnterpriseManagedConfig.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseManagedConfig.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; public class AndroidEnterpriseManagedConfig { 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/dto/AndroidEnterpriseUser.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseUser.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/AndroidEnterpriseUser.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseUser.java index 48bddbb039..afd64a12e5 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/dto/AndroidEnterpriseUser.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseUser.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; public class AndroidEnterpriseUser { String emmUsername; 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/exception/ErrorDTO.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/ErrorDTO.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ErrorDTO.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/ErrorDTO.java index ebd5ec8fc9..44e3385ca0 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ErrorDTO.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/ErrorDTO.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; import java.util.ArrayList; import java.util.List; 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/dto/MobileDevice.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDevice.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileDevice.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDevice.java index 2b064452ad..7644cb3ccc 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/dto/MobileDevice.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDevice.java @@ -16,10 +16,9 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; import java.io.Serializable; -import java.util.Date; import java.util.HashMap; import java.util.Map; 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/dto/MobileDeviceOperationMapping.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDeviceOperationMapping.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileDeviceOperationMapping.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDeviceOperationMapping.java index ae855e2ab2..279f93883f 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/dto/MobileDeviceOperationMapping.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDeviceOperationMapping.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; /** * DTO of Mobile Device Operation Mappings. 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/dto/MobileFeature.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileFeature.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileFeature.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileFeature.java index 1778f8560b..576fd92c7a 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/dto/MobileFeature.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileFeature.java @@ -34,7 +34,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; import java.io.Serializable; 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/dto/MobileOperation.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperation.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileOperation.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperation.java index fa97234844..5f1571394a 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/dto/MobileOperation.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperation.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; import java.util.List; 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/dto/MobileOperationProperty.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperationProperty.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileOperationProperty.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperationProperty.java index 5147bb004f..04f7b58d59 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/dto/MobileOperationProperty.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperationProperty.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; /** * DTO of Mobile Operation property. 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/exception/AndroidAgentException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidAgentException.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/AndroidAgentException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidAgentException.java index c12d035383..697fefa267 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/AndroidAgentException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidAgentException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; /** * 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/dao/impl/AndroidDeviceMgtPluginException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidDeviceMgtPluginException.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/AndroidDeviceMgtPluginException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidDeviceMgtPluginException.java index 4a0b6a1c73..117c429053 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/dao/impl/AndroidDeviceMgtPluginException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidDeviceMgtPluginException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; public class AndroidDeviceMgtPluginException extends Exception{ 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/exception/AndroidOperationException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidOperationException.java similarity index 89% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/AndroidOperationException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidOperationException.java index 8c68866d83..527c1b45e7 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/AndroidOperationException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidOperationException.java @@ -16,9 +16,9 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; -import org.wso2.carbon.mdm.services.android.util.Message; +import org.wso2.carbon.device.mgt.mobile.android.common.Message; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; 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/exception/BadRequestException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestException.java similarity index 87% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/BadRequestException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestException.java index 5fa5ededc6..3213a8ed7d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/BadRequestException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestException.java @@ -16,9 +16,9 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestExceptionDup.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestExceptionDup.java new file mode 100644 index 0000000000..0d1220e9dd --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestExceptionDup.java @@ -0,0 +1,32 @@ +/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.device.mgt.mobile.android.common.exception; + +/** + * Represents the exception thrown during validating the request. + */ +public class BadRequestExceptionDup extends AndroidDeviceMgtPluginException { + + public BadRequestExceptionDup(String message, Throwable ex) { + super(message, ex); + } + + public BadRequestExceptionDup(String message) { + super(message); + } +} 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/dao/EnterpriseManagementDAOException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseManagementDAOException.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/EnterpriseManagementDAOException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseManagementDAOException.java index 86af32e809..4b8c17276d 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/dao/EnterpriseManagementDAOException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseManagementDAOException.java @@ -33,7 +33,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; /** * Custom exception class for enterprise specific data access related exceptions. 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/EnterpriseServiceException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseServiceException.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/EnterpriseServiceException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseServiceException.java index d8b5e80df9..9153f59481 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/EnterpriseServiceException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseServiceException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; /** * Custom exception class for enterprise specific data access related exceptions. 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/exception/ForbiddenException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/ForbiddenException.java similarity index 87% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ForbiddenException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/ForbiddenException.java index 75113f8501..451a3e0336 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ForbiddenException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/ForbiddenException.java @@ -16,9 +16,10 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.ErrorDTO; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; 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/dao/MobileDeviceManagementDAOException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/MobileDeviceManagementDAOException.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileDeviceManagementDAOException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/MobileDeviceManagementDAOException.java index f87ddbfec9..395da6acdd 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/dao/MobileDeviceManagementDAOException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/MobileDeviceManagementDAOException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; /** * Custom exception class for mobile device specific data access related exceptions. 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/exception/NotFoundException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/NotFoundException.java similarity index 83% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/NotFoundException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/NotFoundException.java index 53863c3acd..3f412587da 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/NotFoundException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/NotFoundException.java @@ -16,10 +16,11 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.ErrorDTO; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; 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/exception/OperationConfigurationException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/OperationConfigurationException.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/OperationConfigurationException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/OperationConfigurationException.java index 1300b14812..93f677aa48 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/OperationConfigurationException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/OperationConfigurationException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; /** * 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/exception/UnexpectedServerErrorException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/UnexpectedServerErrorException.java similarity index 84% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/UnexpectedServerErrorException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/UnexpectedServerErrorException.java index a66c2f506c..b00a4e51ff 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/UnexpectedServerErrorException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/UnexpectedServerErrorException.java @@ -16,10 +16,11 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.ErrorDTO; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; 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/AndroidPluginService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidGoogleEnterpriseService.java similarity index 79% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/AndroidPluginService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidGoogleEnterpriseService.java index 7bc4ad3be6..a10fc418e2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/AndroidPluginService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidGoogleEnterpriseService.java @@ -16,15 +16,15 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android; +package org.wso2.carbon.device.mgt.mobile.android.common.spi; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; import java.util.List; -public interface AndroidPluginService { +public interface AndroidGoogleEnterpriseService { void addEnterpriseUser(AndroidEnterpriseUser androidEnterpriseUser) throws EnterpriseServiceException; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidService.java new file mode 100644 index 0000000000..406038e79e --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidService.java @@ -0,0 +1,31 @@ +/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.device.mgt.mobile.android.common.spi; + +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.AndroidPlatformConfiguration; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException; + +public interface AndroidService { + + PlatformConfiguration getPlatformConfig() throws DeviceManagementException; + + void updateConfiguration(AndroidPlatformConfiguration androidPlatformConfiguration) + throws AndroidDeviceMgtPluginException; +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/pom.xml similarity index 69% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/pom.xml index 99b4283021..ee22567e1c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/pom.xml @@ -27,10 +27,10 @@ 4.0.0 - org.wso2.carbon.device.mgt.mobile.android + org.wso2.carbon.device.mgt.mobile.android.core bundle - WSO2 Carbon - Mobile Device Management Android Impl - WSO2 Carbon - Mobile Device Management Android Implementation + WSO2 Carbon - Mobile Device Management Android Core Impl + WSO2 Carbon - Mobile Device Management Android Core Implementation http://wso2.org @@ -53,7 +53,7 @@ ${project.artifactId} ${carbon.devicemgt.plugins.version} Device Management Mobile Android Impl Bundle - org.wso2.carbon.device.mgt.mobile.android.internal + org.wso2.carbon.device.mgt.mobile.android.core.internal org.osgi.framework, org.osgi.service.component, @@ -78,8 +78,8 @@ com.google.gson.* - !org.wso2.carbon.device.mgt.mobile.android.internal, - org.wso2.carbon.device.mgt.mobile.android.* + !org.wso2.carbon.device.mgt.mobile.android.core.internal, + org.wso2.carbon.device.mgt.mobile.android.core.* @@ -134,10 +134,6 @@ org.wso2.carbon org.wso2.carbon.utils - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.common - org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.extensions @@ -146,29 +142,86 @@ org.wso2.carbon org.wso2.carbon.ndatasource.core + + org.wso2.carbon + org.wso2.carbon.registry.api + + + org.wso2.carbon + org.wso2.carbon.registry.core + + + org.apache.tomcat.wso2 + jdbc-pool + + + com.google.code.gson + gson + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.common + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.common + provided + + + org.wso2.carbon.devicemgt + org.wso2.carbon.device.application.mgt.common + provided + + + org.wso2.carbon.devicemgt + org.wso2.carbon.device.mgt.core + provided + + + org.slf4j + slf4j-api + + + org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.common + provided org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.core + provided - org.wso2.carbon - org.wso2.carbon.registry.api + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.application.extension + provided - org.wso2.carbon - org.wso2.carbon.registry.core + org.wso2.carbon.devicemgt + org.wso2.carbon.device.mgt.common + provided + + + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.annotations + provided org.testng testng + test - org.apache.tomcat.wso2 - jdbc-pool + org.powermock + powermock-module-testng + test + + + org.powermock + powermock-api-mockito + test com.h2database.wso2 @@ -176,8 +229,33 @@ test - com.google.code.gson - gson + org.wso2.carbon + org.wso2.carbon.queuing + test + + + org.wso2.carbon + org.wso2.carbon.ndatasource.core + + + commons-dbcp.wso2 + commons-dbcp + test + + + commons-pool.wso2 + commons-pool + test + + + org.wso2.carbon + javax.cache.wso2 + test + + + javassist + javassist + test 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/dao/AbstractMobileDeviceManagementDAOFactory.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AbstractMobileDeviceManagementDAOFactory.java similarity index 90% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/AbstractMobileDeviceManagementDAOFactory.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AbstractMobileDeviceManagementDAOFactory.java index 634951826d..e22bfabcc9 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/dao/AbstractMobileDeviceManagementDAOFactory.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AbstractMobileDeviceManagementDAOFactory.java @@ -16,14 +16,14 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.core.dao; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.JNDILookupDefinition; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.MobileDataSourceConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl.AndroidDeviceMgtPluginException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.util.MobileDeviceManagementDAOUtil; +import org.wso2.carbon.device.mgt.mobile.android.common.config.datasource.JNDILookupDefinition; +import org.wso2.carbon.device.mgt.mobile.android.common.config.datasource.MobileDataSourceConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.util.MobileDeviceManagementDAOUtil; import javax.sql.DataSource; import java.util.HashMap; 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/dao/AndroidDAOFactory.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AndroidDAOFactory.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/AndroidDAOFactory.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AndroidDAOFactory.java index 2ccd093747..d18cc0f8ad 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/dao/AndroidDAOFactory.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AndroidDAOFactory.java @@ -16,12 +16,13 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.core.dao; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl.EnterpriseDAOImpl; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.impl.EnterpriseDAOImpl; import javax.sql.DataSource; import java.sql.Connection; 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/dao/EnterpriseDAO.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/EnterpriseDAO.java similarity index 84% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/EnterpriseDAO.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/EnterpriseDAO.java index 87aafb814d..79c91e3e58 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/dao/EnterpriseDAO.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/EnterpriseDAO.java @@ -16,10 +16,11 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.core.dao; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseManagementDAOException; import java.util.List; 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/dao/MobileDeviceManagementDAOFactory.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/MobileDeviceManagementDAOFactory.java similarity index 92% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileDeviceManagementDAOFactory.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/MobileDeviceManagementDAOFactory.java index d4746f6237..6ba69f7234 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/dao/MobileDeviceManagementDAOFactory.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/MobileDeviceManagementDAOFactory.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.core.dao; public interface MobileDeviceManagementDAOFactory { 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/dao/impl/EnterpriseDAOImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/impl/EnterpriseDAOImpl.java similarity index 93% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/EnterpriseDAOImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/impl/EnterpriseDAOImpl.java index 8dbdb6e29a..0abfa811ce 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/dao/impl/EnterpriseDAOImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/impl/EnterpriseDAOImpl.java @@ -16,19 +16,16 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl; +package org.wso2.carbon.device.mgt.mobile.android.core.dao.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.AndroidDAOFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.EnterpriseDAO; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.EnterpriseManagementDAOException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.MobileDeviceManagementDAOException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.util.MobileDeviceManagementDAOUtil; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileDevice; -import org.wso2.carbon.device.mgt.mobile.android.impl.util.AndroidPluginConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.AndroidDAOFactory; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.EnterpriseDAO; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.util.MobileDeviceManagementDAOUtil; import java.sql.Connection; import java.sql.PreparedStatement; @@ -37,9 +34,7 @@ import java.sql.SQLException; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * Implements EnterpriseDAO for Android Devices. 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/dao/util/MobileDeviceManagementDAOUtil.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/util/MobileDeviceManagementDAOUtil.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/util/MobileDeviceManagementDAOUtil.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/util/MobileDeviceManagementDAOUtil.java index 1892ddecb0..decfbdb3b2 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/dao/util/MobileDeviceManagementDAOUtil.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/util/MobileDeviceManagementDAOUtil.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao.util; +package org.wso2.carbon.device.mgt.mobile.android.core.dao.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; 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/AndroidPluginServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidGoogleEnterpriseServiceImpl.java similarity index 90% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidPluginServiceImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidGoogleEnterpriseServiceImpl.java index 1fc0754f90..67d79b8f43 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/AndroidPluginServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidGoogleEnterpriseServiceImpl.java @@ -32,29 +32,30 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl; +package org.wso2.carbon.device.mgt.mobile.android.core.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.device.mgt.mobile.android.AndroidPluginService; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.AndroidDAOFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.EnterpriseDAO; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.EnterpriseManagementDAOException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidGoogleEnterpriseService; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.AndroidDAOFactory; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.EnterpriseDAO; import java.util.List; /** * This represents the Android implementation of DeviceManagerService. */ -public class AndroidPluginServiceImpl implements AndroidPluginService { +public class AndroidGoogleEnterpriseServiceImpl implements AndroidGoogleEnterpriseService { - private static final Log log = LogFactory.getLog(AndroidPluginServiceImpl.class); + private static final Log log = LogFactory.getLog(AndroidGoogleEnterpriseServiceImpl.class); private EnterpriseDAO enterpriseDAO; - public AndroidPluginServiceImpl() { + public AndroidGoogleEnterpriseServiceImpl() { enterpriseDAO = AndroidDAOFactory.getEnterpriseDAO(); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidPluginServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidPluginServiceImpl.java new file mode 100644 index 0000000000..a8a367c834 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidPluginServiceImpl.java @@ -0,0 +1,75 @@ +/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.device.mgt.mobile.android.core.impl; + +import org.wso2.carbon.base.ServerConfiguration; +import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; +import org.wso2.carbon.device.mgt.common.EnrolmentInfo; +import org.wso2.carbon.device.mgt.common.MDMAppConstants; +import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.license.mgt.License; +import org.wso2.carbon.device.mgt.common.spi.DeviceTypePluginService; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class AndroidPluginServiceImpl implements DeviceTypePluginService { + + @Override + public Map getEnrollmentQRCode() throws DeviceManagementException { + return null; + } + +// private void getPlatformConfig() { +// PlatformConfiguration platformConfiguration; +// List configs; +// try { +// platformConfiguration = AndroidAPIUtils.getDeviceManagementService(). +// getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); +// if (platformConfiguration != null) { +// configs = platformConfiguration.getConfiguration(); +// } else { +// platformConfiguration = new PlatformConfiguration(); +// configs = new ArrayList<>(); +// } +// ConfigurationEntry entry = new ConfigurationEntry(); +// License license = AndroidAPIUtils.getDeviceManagementService().getLicense( +// DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, MDMAppConstants.AndroidConstants. +// TenantConfigProperties.LANGUAGE_US); +// +// if (configs != null) { +// ConfigurationEntry versionEntry = new ConfigurationEntry(); +// versionEntry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); +// versionEntry.setName(AndroidConstants.TenantConfigProperties.SERVER_VERSION); +// versionEntry.setValue(ServerConfiguration.getInstance().getFirstProperty("Version")); +// configs.add(versionEntry); +// if (license != null) { +// entry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); +// entry.setName(AndroidConstants.TenantConfigProperties.LICENSE_KEY); +// entry.setValue(license.getText()); +// configs.add(entry); +// } +// platformConfiguration.setConfiguration(configs); +// } +// } +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java new file mode 100644 index 0000000000..78077948ff --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java @@ -0,0 +1,184 @@ +/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.device.mgt.mobile.android.core.impl; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.ServerConfiguration; +import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; +import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; +import org.wso2.carbon.device.mgt.common.EnrolmentInfo; +import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; +import org.wso2.carbon.device.mgt.common.license.mgt.License; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; +import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; +import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.AndroidPlatformConfiguration; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.NotifierFrequency; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestExceptionDup; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidService; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; + +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.List; + +public class AndroidServiceImpl implements AndroidService { + + private static final Log log = LogFactory.getLog(AndroidServiceImpl.class); + + @Override + public PlatformConfiguration getPlatformConfig() throws DeviceManagementException { + List configs; + PlatformConfiguration platformConfiguration; + + DeviceManagementProviderService deviceManagementProviderService = AndroidAPIUtils.getDeviceManagementService(); + platformConfiguration = deviceManagementProviderService. + getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + if (platformConfiguration != null) { + configs = platformConfiguration.getConfiguration(); + } else { + platformConfiguration = new PlatformConfiguration(); + configs = new ArrayList<>(); + } + + if (configs != null) { + ConfigurationEntry versionEntry = new ConfigurationEntry(); + versionEntry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); + versionEntry.setName(AndroidConstants.TenantConfigProperties.SERVER_VERSION); + versionEntry.setValue(ServerConfiguration.getInstance().getFirstProperty("Version")); + configs.add(versionEntry); + + License license = deviceManagementProviderService + .getLicense(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, + AndroidConstants. + TenantConfigProperties.LANGUAGE_US); + if (license != null) { + ConfigurationEntry entry = new ConfigurationEntry(); + entry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); + entry.setName(AndroidConstants.TenantConfigProperties.LICENSE_KEY); + entry.setValue(license.getText()); + configs.add(entry); + } + platformConfiguration.setConfiguration(configs); + } + return platformConfiguration; + } + + @Override + public void updateConfiguration(AndroidPlatformConfiguration androidPlatformConfiguration) throws + AndroidDeviceMgtPluginException { + ConfigurationEntry licenseEntry = null; + PlatformConfiguration configuration = new PlatformConfiguration(); + if (androidPlatformConfiguration == null) { + String errorMessage = "The payload of the android platform configuration is null."; + log.error(errorMessage); + throw new BadRequestExceptionDup(errorMessage); + } + configuration.setConfiguration(androidPlatformConfiguration.getConfiguration()); + try { + DeviceManagementProviderService deviceManagementProviderService = AndroidAPIUtils + .getDeviceManagementService(); + configuration.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + List configs = configuration.getConfiguration(); + NotifierFrequency notifierFrequency = new NotifierFrequency(); + for (ConfigurationEntry entry : configs) { + if (AndroidConstants.TenantConfigProperties.LICENSE_KEY.equals(entry.getName())) { + License license = new License(); + license.setName(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + license.setLanguage(AndroidConstants.TenantConfigProperties.LANGUAGE_US); + license.setVersion("1.0.0"); + license.setText(entry.getValue().toString()); + deviceManagementProviderService.addLicense(DeviceManagementConstants. + MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, license); + licenseEntry = entry; + } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_FREQUENCY.equals(entry.getName())) { + if (entry.getValue() != null) { + notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString())); + } else { + String msg = "No value specified for notifierFrequency."; + log.error(msg); + throw new BadRequestExceptionDup(msg); + } + } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_TYPE.equals(entry.getName())) { + if (entry.getValue() != null) { + notifierFrequency.setType(Integer.parseInt(entry.getValue().toString())); + } else { + String msg = "No value specified for notifierType."; + log.error(msg); + throw new BadRequestExceptionDup(msg); + } + } + } + + if (licenseEntry != null) { + configs.remove(licenseEntry); + } + configuration.setConfiguration(configs); + deviceManagementProviderService.saveConfiguration(configuration); + notifyDevices(notifierFrequency); + } catch (DeviceManagementException e) { + String msg = "Error occurred while getting device management service to modify Android config settings"; + log.error(msg, e); + throw new AndroidDeviceMgtPluginException(msg, e); + } catch (NumberFormatException e) { + String msg = "Error occurred while reading notification frequency."; + log.error(msg, e); + throw new AndroidDeviceMgtPluginException(msg, e); + } catch (OperationManagementException e) { + String msg = "Error occurred while modifying configuration settings of Android platform."; + log.error(msg, e); + throw new AndroidDeviceMgtPluginException(msg, e); + } catch (InvalidDeviceException e) { + String msg = "Error occurred with the device."; + log.error(msg, e); + throw new AndroidDeviceMgtPluginException(msg, e); + } + } + + private void notifyDevices(NotifierFrequency notifierFrequency) throws DeviceManagementException, + OperationManagementException, InvalidDeviceException { + List deviceList = AndroidAPIUtils. + getDeviceManagementService(). + getAllDevices(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, false); + List deviceIdList = new ArrayList<>(); + for (Device device : deviceList) { + if (EnrolmentInfo.Status.REMOVED != device.getEnrolmentInfo().getStatus()) { + deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType())); + } + } + if (!deviceIdList.isEmpty()) { + ProfileOperation operation = new ProfileOperation(); + operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY); + operation.setPayLoad(notifierFrequency.toJSON()); + operation.setEnabled(true); + AndroidAPIUtils.getDeviceManagementService().addOperation( + DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, + operation, deviceIdList); + } + } +} 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/internal/AndroidDeviceManagementDataHolder.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidDeviceManagementDataHolder.java similarity index 69% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/internal/AndroidDeviceManagementDataHolder.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidDeviceManagementDataHolder.java index 09d111fcae..9f47403133 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/internal/AndroidDeviceManagementDataHolder.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidDeviceManagementDataHolder.java @@ -16,10 +16,10 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.internal; +package org.wso2.carbon.device.mgt.mobile.android.core.internal; -import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; -import org.wso2.carbon.device.mgt.mobile.android.AndroidPluginService; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidGoogleEnterpriseService; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidService; import org.wso2.carbon.registry.core.service.RegistryService; /** @@ -28,7 +28,8 @@ import org.wso2.carbon.registry.core.service.RegistryService; public class AndroidDeviceManagementDataHolder { private RegistryService registryService; - private AndroidPluginService androidDeviceManagementService; + private AndroidGoogleEnterpriseService androidDeviceManagementService; + private AndroidService androidService; private static AndroidDeviceManagementDataHolder thisInstance = new AndroidDeviceManagementDataHolder(); @@ -47,13 +48,20 @@ public class AndroidDeviceManagementDataHolder { this.registryService = registryService; } - public AndroidPluginService getAndroidDeviceManagementService() { + public AndroidGoogleEnterpriseService getAndroidDeviceManagementService() { return androidDeviceManagementService; } public void setAndroidDeviceManagementService( - AndroidPluginService androidDeviceManagementService) { + AndroidGoogleEnterpriseService androidDeviceManagementService) { this.androidDeviceManagementService = androidDeviceManagementService; } + public AndroidService getAndroidService() { + return androidService; + } + + public void setAndroidService(AndroidService androidService) { + this.androidService = androidService; + } } 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/internal/AndroidPluginServiceComponent.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidPluginServiceComponent.java similarity index 80% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/internal/AndroidPluginServiceComponent.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidPluginServiceComponent.java index 08f0c1c951..2ee731c656 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/internal/AndroidPluginServiceComponent.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidPluginServiceComponent.java @@ -16,21 +16,23 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.internal; +package org.wso2.carbon.device.mgt.mobile.android.core.internal; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.device.mgt.mobile.android.AndroidPluginService; -import org.wso2.carbon.device.mgt.mobile.android.impl.AndroidPluginServiceImpl; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.AbstractMobileDeviceManagementDAOFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.util.MobileDeviceManagementUtil; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidGoogleEnterpriseService; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidService; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.AbstractMobileDeviceManagementDAOFactory; +import org.wso2.carbon.device.mgt.mobile.android.core.impl.AndroidGoogleEnterpriseServiceImpl; +import org.wso2.carbon.device.mgt.mobile.android.core.impl.AndroidServiceImpl; +import org.wso2.carbon.device.mgt.mobile.android.core.util.MobileDeviceManagementUtil; import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.registry.core.service.RegistryService; /** - * @scr.component name="org.wso2.carbon.device.mgt.mobile.android.impl.internal.AndroidPluginServiceComponent" + * @scr.component name="org.wso2.carbon.device.mgt.mobile.android.core.impl.internal.AndroidPluginServiceComponent" * immediate="true" * @scr.reference name="org.wso2.carbon.ndatasource" * interface="org.wso2.carbon.ndatasource.core.DataSourceService" @@ -58,15 +60,19 @@ public class AndroidPluginServiceComponent { try { BundleContext bundleContext = ctx.getBundleContext(); - MobileDeviceManagementUtil.initConfig(); AbstractMobileDeviceManagementDAOFactory.init("android", MobileDeviceManagementUtil .getIosDataSourceConfigurations().getIosDataSourceConfiguration()); - AndroidPluginService androidPluginService = new AndroidPluginServiceImpl(); + AndroidService androidService = new AndroidServiceImpl(); + AndroidDeviceManagementDataHolder.getInstance().setAndroidService( + androidService); + bundleContext.registerService(AndroidService.class.getName(), androidService, null); + + AndroidGoogleEnterpriseService androidPluginService = new AndroidGoogleEnterpriseServiceImpl(); AndroidDeviceManagementDataHolder.getInstance().setAndroidDeviceManagementService( androidPluginService); - bundleContext.registerService(AndroidPluginService.class.getName(), androidPluginService, null); + bundleContext.registerService(AndroidGoogleEnterpriseService.class.getName(), androidPluginService, null); if (log.isDebugEnabled()) { log.debug("Android Mobile Device Management Service Component has been successfully activated"); } 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.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidAPIUtils.java similarity index 87% rename from 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 rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidAPIUtils.java index f91e674245..5fe4f401dd 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.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidAPIUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -34,9 +34,11 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementExcept 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.service.DeviceManagementProviderService; -import org.wso2.carbon.device.mgt.mobile.android.AndroidPluginService; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidGoogleEnterpriseService; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidService; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; @@ -55,10 +57,10 @@ public class AndroidAPIUtils { throw new IllegalStateException("Utility class"); } - public static AndroidPluginService getAndroidPluginService() { + public static AndroidGoogleEnterpriseService getAndroidPluginService() { PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - AndroidPluginService androidPluginService = - (AndroidPluginService) ctx.getOSGiService(AndroidPluginService.class, null); + AndroidGoogleEnterpriseService androidPluginService = + (AndroidGoogleEnterpriseService) ctx.getOSGiService(AndroidGoogleEnterpriseService.class, null); if (androidPluginService == null) { String msg = "Android plugin service has not initialized."; log.error(msg); @@ -67,6 +69,17 @@ public class AndroidAPIUtils { return androidPluginService; } + public static AndroidService getAndroidnService() { + PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + AndroidService androidService = (AndroidService) ctx.getOSGiService(AndroidService.class, null); + if (androidService == null) { + String msg = "Android service has not initialized."; + log.error(msg); + throw new IllegalStateException(msg); + } + return androidService; + } + public static String getAuthenticatedUser() { PrivilegedCarbonContext threadLocalCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext(); String username = threadLocalCarbonContext.getUsername(); 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/AndroidDeviceUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidDeviceUtils.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidDeviceUtils.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidDeviceUtils.java index a66e3a07f9..51edcb75d9 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/AndroidDeviceUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidDeviceUtils.java @@ -33,7 +33,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.core.util; import com.google.gson.Gson; import com.google.gson.JsonArray; @@ -62,13 +62,13 @@ import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.application.mgt.common.SubAction; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; +import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.app.mgt.Application; -import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; @@ -85,17 +85,18 @@ 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.operation.mgt.ProfileOperation; import org.wso2.carbon.device.mgt.core.search.mgt.impl.Utils; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.GoogleAPIInvoker; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceState; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseConfigs; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorListItem; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseApp; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseInstallPolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; -import org.wso2.carbon.mdm.services.android.bean.DeviceState; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseConfigs; -import org.wso2.carbon.mdm.services.android.bean.ErrorListItem; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseApp; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseInstallPolicy; -import org.wso2.carbon.mdm.services.android.common.GoogleAPIInvoker; -import org.wso2.carbon.mdm.services.android.exception.BadRequestException; import org.wso2.carbon.policy.mgt.common.FeatureManagementException; import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; @@ -207,7 +208,8 @@ public class AndroidDeviceUtils { } public static void updateOperation(String deviceId, Operation operation) - throws OperationManagementException, PolicyComplianceException, ApplicationManagementException { + throws OperationManagementException, PolicyComplianceException, + org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException { DeviceIdentifier deviceIdentifier = new DeviceIdentifier(); deviceIdentifier.setId(deviceId); deviceIdentifier.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); @@ -351,35 +353,32 @@ public class AndroidDeviceUtils { * @param deviceIdentifier device to apply policy */ private static void sendPayloadToGoogle(String uuid, String payload, DeviceIdentifier deviceIdentifier) - throws org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException { + throws ApplicationManagementException { try { EnterpriseConfigs enterpriseConfigs = AndroidEnterpriseUtils.getEnterpriseConfigsFromGoogle(); - if (enterpriseConfigs != null && enterpriseConfigs.getErrorResponse() == null) { + if (enterpriseConfigs.getErrorResponse() == null) { GoogleAPIInvoker googleAPIInvoker = new GoogleAPIInvoker(enterpriseConfigs.getEsa()); AndroidEnterpriseUser userDetail = AndroidAPIUtils.getAndroidPluginService() .getEnterpriseUserByDevice(deviceIdentifier.getId()); if (userDetail != null && userDetail.getEnterpriseId() != null && !userDetail.getEnterpriseId() - .isEmpty() && userDetail.getEmmUsername() != null) { - - if (payload != null) { -// ProfileFeature feature = AndroidDeviceUtils.getEnrollmentPolicy(deviceIdentifier); - EnterpriseInstallPolicy enterpriseInstallPolicy = AndroidEnterpriseUtils - .getDeviceAppPolicy(payload, null, userDetail); - - List apps = new ArrayList<>(); - for (EnterpriseApp enterpriseApp : enterpriseInstallPolicy.getApps()) { - apps.add(enterpriseApp.getProductId()); - } - googleAPIInvoker.approveAppsForUser(enterpriseConfigs.getEnterpriseId(), userDetail - .getGoogleUserId(), apps, enterpriseInstallPolicy.getProductSetBehavior()); - googleAPIInvoker.updateAppsForUser(enterpriseConfigs.getEnterpriseId(), userDetail.getGoogleUserId(), - AndroidEnterpriseUtils.convertToDeviceInstance(enterpriseInstallPolicy)); - AndroidEnterpriseUtils.getAppSubscriptionService() - .performEntAppSubscription(uuid, - Arrays.asList(CarbonContext.getThreadLocalCarbonContext().getUsername()), - SubscriptionType.USER.toString(), SubAction.INSTALL.toString(), false); + .isEmpty() && userDetail.getEmmUsername() != null && payload != null) { + EnterpriseInstallPolicy enterpriseInstallPolicy = AndroidEnterpriseUtils + .getDeviceAppPolicy(payload, null, userDetail); + List apps = new ArrayList<>(); + for (EnterpriseApp enterpriseApp : enterpriseInstallPolicy.getApps()) { + apps.add(enterpriseApp.getProductId()); } + googleAPIInvoker + .approveAppsForUser(enterpriseConfigs.getEnterpriseId(), userDetail.getGoogleUserId(), apps, + enterpriseInstallPolicy.getProductSetBehavior()); + googleAPIInvoker + .updateAppsForUser(enterpriseConfigs.getEnterpriseId(), userDetail.getGoogleUserId(), + AndroidEnterpriseUtils.convertToDeviceInstance(enterpriseInstallPolicy)); + AndroidEnterpriseUtils.getAppSubscriptionService().performEntAppSubscription(uuid, + Arrays.asList(CarbonContext.getThreadLocalCarbonContext().getUsername()), + SubscriptionType.USER.toString(), SubAction.INSTALL.toString(), false); + } } @@ -390,7 +389,7 @@ public class AndroidDeviceUtils { } private static void updateApplicationList(Operation operation, DeviceIdentifier deviceIdentifier) - throws ApplicationManagementException { + throws org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException { // Parsing json string to get applications list. if (operation.getOperationResponse() != null) { if (operation.getOperationResponse().equals("SAME_APPLICATION_LIST")) { 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/AndroidEnterpriseUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidEnterpriseUtils.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidEnterpriseUtils.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidEnterpriseUtils.java index 6bd4e0be89..1fc9549ed4 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/AndroidEnterpriseUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidEnterpriseUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.core.util; import com.google.api.services.androidenterprise.model.AppVersion; import com.google.api.services.androidenterprise.model.AutoInstallConstraint; @@ -51,16 +51,17 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.policy.mgt.ProfileFeature; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; -import org.wso2.carbon.mdm.services.android.bean.BasicUserInfo; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseConfigs; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseApp; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseInstallPolicy; -import org.wso2.carbon.mdm.services.android.exception.NotFoundException; -import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.BasicUserInfo; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseConfigs; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseApp; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseInstallPolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.NotFoundException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; import org.wso2.carbon.user.core.service.RealmService; @@ -141,13 +142,12 @@ public class AndroidEnterpriseUtils { variableSets.add(variableSet); } - if (variableSets != null && variableSets.size() > 0) { + if (!variableSets.isEmpty()) { configurationVariables.setVariableSet(variableSets); } managedConfiguration.setConfigurationVariables(configurationVariables); productPolicy.setManagedConfiguration(managedConfiguration); } - policyList.add(productPolicy); } 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/util/MobileDeviceManagementUtil.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/MobileDeviceManagementUtil.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/MobileDeviceManagementUtil.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/MobileDeviceManagementUtil.java index 1ea1543a46..240043aadf 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/util/MobileDeviceManagementUtil.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/MobileDeviceManagementUtil.java @@ -34,7 +34,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.util; +package org.wso2.carbon.device.mgt.mobile.android.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -45,16 +45,15 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.AndroidDataSourceConfigurations; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.MobileDataSourceConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.MobileDataSourceConfigurations; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl.AndroidDeviceMgtPluginException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileDevice; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileDeviceOperationMapping; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileFeature; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileOperation; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileOperationProperty; -import org.wso2.carbon.device.mgt.mobile.android.internal.AndroidDeviceManagementDataHolder; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidPluginConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.config.datasource.AndroidDataSourceConfigurations; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.MobileDevice; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.MobileDeviceOperationMapping; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.MobileFeature; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.MobileOperation; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.MobileOperationProperty; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.android.core.internal.AndroidDeviceManagementDataHolder; import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.registry.core.Registry; 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/OAuthUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/OAuthUtils.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/OAuthUtils.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/OAuthUtils.java index 53e0832c39..d4a6064aaf 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/OAuthUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/OAuthUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -24,7 +24,8 @@ import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.mdm.services.android.bean.ApiRegistrationProfile; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApiRegistrationProfile; import org.wso2.carbon.identity.jwt.client.extension.JWTClient; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java new file mode 100644 index 0000000000..4c1e432b40 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.device.mgt.mobile.android.core; + +import org.mockito.MockitoAnnotations; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.testng.PowerMockObjectFactory; +import org.testng.Assert; +import org.testng.IObjectFactory; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.ObjectFactory; +import org.testng.annotations.Test; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.DeviceManagementProviderServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.utils.TestUtils; + +import javax.ws.rs.core.Response; + +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) +@PrepareForTest(AndroidAPIUtils.class) +public class DeviceManagementAdminServiceTests { + +// private DeviceManagementAdminServiceImpl deviceManagementAdminService; + + @ObjectFactory + public IObjectFactory getObjectFactory() { + return new PowerMockObjectFactory(); + } + +// @BeforeClass +// public void init() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// MockitoAnnotations.initMocks(this); +// deviceManagementAdminService = new DeviceManagementAdminServiceImpl(); +// } + + private void mockDeviceManagementService() + throws DeviceManagementException, OperationManagementException, InvalidDeviceException { + PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceManagementService")) + .toReturn(new DeviceManagementProviderServiceMock()); + } + +// @Test +// public void testConfigureDeviceLock() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.configureDeviceLock(TestUtils.getDeviceLockBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testConfigureDeviceUnlock() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.configureDeviceUnlock(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetDeviceLocation() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.getDeviceLocation(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testRemovePassword() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.removePassword(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testConfigureCamera() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.configureCamera(TestUtils.getCamerabeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetDeviceInformation() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.getDeviceInformation(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetDeviceLogcat() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.getDeviceLogcat(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testWipeDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.wipeDevice(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testWipeData() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.wipeData(TestUtils.getWipeDataBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetApplications() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.getApplications(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testRingDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.ringDevice(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testRebootDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.rebootDevice(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testChangeLockTask() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.changeLockTask(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testMuteDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.muteDevice(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testInstallApplication() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService +// .installApplication(TestUtils.getApplicationInstallationBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testUpdateApplication() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.updateApplication(TestUtils.getApplicationUpdateBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testUninstallApplicationPublic() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService +// .uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperPublic()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testUninstallApplicationWebApp() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService +// .uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperWebApp()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testBlacklistApplications() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService +// .blacklistApplications(TestUtils.getBlacklistApplicationsBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testUpgradeFirmware() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.upgradeFirmware(TestUtils.getUpgradeFirmwareBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testConfigureVPN() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.configureVPN(TestUtils.getVpnBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testSendNotification() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.sendNotification(TestUtils.getNotificationBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testConfigureWifi() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.configureWifi(TestUtils.getWifiBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testEncryptStorage() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.encryptStorage(TestUtils.getEncryptionBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testChangeLockCode() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.changeLockCode(TestUtils.getLockCodeBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testSetPasswordPolicy() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.setPasswordPolicy(TestUtils.getPasswordPolicyBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testSetWebClip() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.setWebClip(TestUtils.getWebClipBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } + +} + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java new file mode 100644 index 0000000000..9ce61820da --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java @@ -0,0 +1,333 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.device.mgt.mobile.android.core; + +import org.mockito.MockitoAnnotations; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.testng.PowerMockObjectFactory; +import org.testng.Assert; +import org.testng.IObjectFactory; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.ObjectFactory; +import org.testng.annotations.Test; +import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidDevice; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.ApplicationManagementProviderServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.DeviceInformationManagerServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.DeviceManagementProviderServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.NotificationManagementServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.PolicyManagerServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.utils.TestUtils; + +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.List; + +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) +@PrepareForTest(AndroidAPIUtils.class) +public class DeviceManagementServiceTests { + +// private DeviceManagementServiceImpl deviceManagementService; + +// @ObjectFactory +// public IObjectFactory getObjectFactory() { +// return new PowerMockObjectFactory(); +// } + +// @BeforeClass +// public void init() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// MockitoAnnotations.initMocks(this); +// deviceManagementService = new DeviceManagementServiceImpl(); +// } + +// private void mockDeviceManagementService() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceManagementService")) +// .toReturn(new DeviceManagementProviderServiceMock()); +// } +// +// private void mockApplicationManagerService() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getApplicationManagerService")) +// .toReturn(new ApplicationManagementProviderServiceMock()); +// } +// +// private void mockPolicyManagerService() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getPolicyManagerService")) +// .toReturn(new PolicyManagerServiceMock()); +// } +// +// private void mockDeviceInformationManagerService() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceInformationManagerService")) +// .toReturn(new DeviceInformationManagerServiceMock()); +// } +// +// private void mockNotificationManagementService() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getNotificationManagementService")) +// .toReturn(new NotificationManagementServiceMock()); +// } +// +// private void mockUser() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getAuthenticatedUser")) +// .toReturn("admin"); +// } +// +// @Test +// public void testUpdateApplicationList() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockApplicationManagerService(); +// Response response = deviceManagementService +// .updateApplicationList(TestUtils.getDeviceId(), TestUtils.getAndroidApplications()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.ACCEPTED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsForNullDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// Response response = deviceManagementService +// .getPendingOperations(true, null, null, null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsInvalidDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService +// .getPendingOperations(true, "1234", null, null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsNullResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsWithMonitorResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockPolicyManagerService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, +// TestUtils.getSuccessMonitorOperationResponse()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsWithApplicationResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockApplicationManagerService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, +// TestUtils.getSuccessApplicationOperationResponse()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsWithDeviceInfoResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockDeviceInformationManagerService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, +// TestUtils.getSuccessInfoOperationResponse()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsWithInProgressResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, +// TestUtils.getInProgressOperationResponse()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsWithErrorResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockNotificationManagementService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, +// TestUtils.getErrorOperationResponse()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testEnrollDeviceWithoutLocationSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockPolicyManagerService(); +// mockUser(); +// Response response = deviceManagementService.enrollDevice(TestUtils.getBasicAndroidDevice()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); +// } +// +// @Test +// public void testEnrollDeviceWithLocationSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockDeviceInformationManagerService(); +// mockPolicyManagerService(); +// mockUser(); +// AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); +// +// List properties = new ArrayList<>(); +// Device.Property property = new Device.Property(); +// property.setName("LATITUDE"); +// property.setValue("79.5"); +// properties.add(property); +// property = new Device.Property(); +// property.setName("LONGITUDE"); +// property.setValue("6.9"); +// properties.add(property); +// property = new Device.Property(); +// property.setName("ALTITUDE"); +// property.setValue("-59.8373726"); +// properties.add(property); +// property = new Device.Property(); +// property.setName("SPEED"); +// property.setValue("0.5123423333"); +// properties.add(property); +// property = new Device.Property(); +// property.setName("BEARING"); +// property.setValue("44.0"); +// properties.add(property); +// property = new Device.Property(); +// property.setName("DISTANCE"); +// property.setValue("44.0"); +// properties.add(property); +// androidDevice.setProperties(properties); +// +// Response response = deviceManagementService.enrollDevice(androidDevice); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); +// } +// +// @Test +// public void testEnrollDeviceUnSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockUser(); +// AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); +// androidDevice.setDeviceIdentifier("1234"); +// Response response = deviceManagementService.enrollDevice(androidDevice); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); +// } +// +// @Test +// public void testIsEnrolledExists() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService.isEnrolled(TestUtils.getDeviceId(), null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); +// } +// +// @Test +// public void testIsEnrolledNonExist() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService.isEnrolled("1234", null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); +// } +// +// @Test +// public void testIsEnrolledNull() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService.isEnrolled(null, null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); +// } +// +// @Test +// public void testModifyEnrollmentSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockUser(); +// Response response = deviceManagementService +// .modifyEnrollment(TestUtils.getDeviceId(), TestUtils.getBasicAndroidDevice()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.ACCEPTED.getStatusCode()); +// } +// +// @Test +// public void testModifyEnrollmentUnSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockUser(); +// AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); +// androidDevice.setDeviceIdentifier("1234"); +// Response response = deviceManagementService +// .modifyEnrollment(TestUtils.getDeviceId(), androidDevice); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.NOT_MODIFIED.getStatusCode()); +// } +// +// @Test +// public void testDisEnrollDeviceSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService.disEnrollDevice(TestUtils.getDeviceId()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); +// } +// +// @Test +// public void testDisenrollUnSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService.disEnrollDevice("1234"); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); +// } + +} + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/ApplicationManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/ApplicationManagementProviderServiceMock.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/ApplicationManagementProviderServiceMock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/ApplicationManagementProviderServiceMock.java index 563258b3c7..29de8de799 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/ApplicationManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/ApplicationManagementProviderServiceMock.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.mocks; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.app.mgt.Application; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceInformationManagerServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceInformationManagerServiceMock.java similarity index 93% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceInformationManagerServiceMock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceInformationManagerServiceMock.java index 2be212e523..37a5ac4257 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceInformationManagerServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceInformationManagerServiceMock.java @@ -1,6 +1,5 @@ -package org.wso2.carbon.mdm.services.android.mocks; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs; -import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceManagementProviderServiceMock.java similarity index 99% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceManagementProviderServiceMock.java index 6d5bf8937e..67dbd2b121 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceManagementProviderServiceMock.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.mocks; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; @@ -53,7 +53,7 @@ import org.wso2.carbon.device.mgt.core.geo.GeoCluster; import org.wso2.carbon.device.mgt.core.geo.geoHash.GeoCoordinate; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.EmailMetaInfo; -import org.wso2.carbon.mdm.services.android.utils.TestUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.utils.TestUtils; import java.util.Date; import java.util.HashMap; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/NotificationManagementServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/NotificationManagementServiceMock.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/NotificationManagementServiceMock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/NotificationManagementServiceMock.java index 4fd989de6d..1f9cafbd31 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/NotificationManagementServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/NotificationManagementServiceMock.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.mocks; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.PaginationRequest; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/PolicyManagerServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/PolicyManagerServiceMock.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/PolicyManagerServiceMock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/PolicyManagerServiceMock.java index a71dafebf8..36283e5d36 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/PolicyManagerServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/PolicyManagerServiceMock.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.mocks; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.Feature; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/utils/TestUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/utils/TestUtils.java similarity index 86% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/utils/TestUtils.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/utils/TestUtils.java index 994cb94239..2a0bb71ea5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/utils/TestUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/utils/TestUtils.java @@ -16,8 +16,9 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.utils; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs.utils; +import javafx.scene.Camera; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; @@ -26,40 +27,39 @@ import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationInstallation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUninstallation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUpdate; -import org.wso2.carbon.mdm.services.android.bean.BlacklistApplications; -import org.wso2.carbon.mdm.services.android.bean.Camera; -import org.wso2.carbon.mdm.services.android.bean.DeviceEncryption; -import org.wso2.carbon.mdm.services.android.bean.DeviceLock; -import org.wso2.carbon.mdm.services.android.bean.LockCode; -import org.wso2.carbon.mdm.services.android.bean.Notification; -import org.wso2.carbon.mdm.services.android.bean.PasscodePolicy; -import org.wso2.carbon.mdm.services.android.bean.UpgradeFirmware; -import org.wso2.carbon.mdm.services.android.bean.Vpn; -import org.wso2.carbon.mdm.services.android.bean.WebClip; -import org.wso2.carbon.mdm.services.android.bean.Wifi; -import org.wso2.carbon.mdm.services.android.bean.WipeData; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidApplication; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidDevice; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationInstallationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUninstallationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUpdateBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.BlacklistApplicationsBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.CameraBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.DeviceLockBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EncryptionBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.LockCodeBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.NotificationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.PasswordPolicyBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.UpgradeFirmwareBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.VpnBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WebClipBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WifiBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WipeDataBeanWrapper; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationInstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUninstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUpdate; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.BlacklistApplications; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceEncryption; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceLock; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.LockCode; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Notification; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.PasscodePolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.UpgradeFirmware; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Vpn; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WebClip; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Wifi; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WipeData; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidApplication; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidDevice; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationInstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUninstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUpdateBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.BlacklistApplicationsBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.CameraBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.DeviceLockBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EncryptionBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.LockCodeBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.NotificationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.PasswordPolicyBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.UpgradeFirmwareBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.VpnBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WebClipBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WifiBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WipeDataBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import java.util.ArrayList; import java.util.List; @@ -108,14 +108,14 @@ public class TestUtils { return deviceLockBeanWrapper; } - public static CameraBeanWrapper getCamerabeanWrapper() { - CameraBeanWrapper cameraBeanWrapper = new CameraBeanWrapper(); - cameraBeanWrapper.setDeviceIDs(getDeviceIds()); - Camera camera = new Camera(); - camera.setEnabled(false); - cameraBeanWrapper.setOperation(camera); - return cameraBeanWrapper; - } +// public static CameraBeanWrapper getCamerabeanWrapper() { +// CameraBeanWrapper cameraBeanWrapper = new CameraBeanWrapper(); +// cameraBeanWrapper.setDeviceIDs(getDeviceIds()); +// Camera camera = new Camera(); +// camera.setEnabled(false); +// cameraBeanWrapper.setOperation(camera); +// return cameraBeanWrapper; +// } public static WipeDataBeanWrapper getWipeDataBeanWrapper() { WipeDataBeanWrapper wipeDataBeanWrapper = new WipeDataBeanWrapper(); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/log4j.properties b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/resources/log4j.properties similarity index 100% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/log4j.properties rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/resources/log4j.properties diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/testng.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/resources/testng.xml similarity index 80% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/testng.xml rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/resources/testng.xml index 865a1e85b4..edecf75b93 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/testng.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/resources/testng.xml @@ -23,8 +23,8 @@ - - + + 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/config/MobileDeviceConfigurationManager.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/config/MobileDeviceConfigurationManager.java deleted file mode 100644 index ded87ad710..0000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceConfigurationManager.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * you may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.carbon.device.mgt.mobile.android.impl.config; - -import org.w3c.dom.Document; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.mobile.android.impl.util.MobileDeviceManagementUtil; -import org.wso2.carbon.utils.CarbonUtils; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import java.io.File; - -/** - * Class responsible for the mobile device manager configuration initialization. - */ -public class MobileDeviceConfigurationManager { - - private static final String MOBILE_DEVICE_CONFIG_XML_NAME = "mobile-config.xml"; - private static final String MOBILE_DEVICE_PLUGIN_DIRECTORY = "mobile"; - private static final String DEVICE_MGT_PLUGIN_CONFIGS_DIRECTORY = "device-mgt-plugin-configs"; - private MobileDeviceManagementConfig currentMobileDeviceConfig; - private static MobileDeviceConfigurationManager mobileDeviceConfigManager; - - private final String mobileDeviceMgtConfigXMLPath = - CarbonUtils.getEtcCarbonConfigDirPath() + File.separator + - DEVICE_MGT_PLUGIN_CONFIGS_DIRECTORY + - File.separator + - MOBILE_DEVICE_PLUGIN_DIRECTORY + File.separator + MOBILE_DEVICE_CONFIG_XML_NAME; - - public static MobileDeviceConfigurationManager getInstance() { - if (mobileDeviceConfigManager == null) { - synchronized (MobileDeviceConfigurationManager.class) { - if (mobileDeviceConfigManager == null) { - mobileDeviceConfigManager = new MobileDeviceConfigurationManager(); - } - } - } - return mobileDeviceConfigManager; - } - - public synchronized void initConfig() throws DeviceManagementException { - try { - File mobileDeviceMgtConfig = new File(mobileDeviceMgtConfigXMLPath); - Document doc = MobileDeviceManagementUtil.convertToDocument(mobileDeviceMgtConfig); - JAXBContext mobileDeviceMgmtContext = - JAXBContext.newInstance(MobileDeviceManagementConfig.class); - Unmarshaller unmarshaller = mobileDeviceMgmtContext.createUnmarshaller(); - this.currentMobileDeviceConfig = - (MobileDeviceManagementConfig) unmarshaller.unmarshal(doc); - } catch (Exception e) { - throw new DeviceManagementException( - "Error occurred while initializing Mobile Device Management config", e); - } - } - - public MobileDeviceManagementConfig getMobileDeviceManagementConfig() { - return currentMobileDeviceConfig; - } - - -} 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/config/MobileDeviceManagementConfig.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/config/MobileDeviceManagementConfig.java deleted file mode 100644 index 2c65375c7b..0000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceManagementConfig.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * you may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.carbon.device.mgt.mobile.android.impl.config; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -/** - * Represents Mobile Device Mgt configuration. - */ -@XmlRootElement(name = "MobileDeviceMgtConfiguration") -public final class MobileDeviceManagementConfig { - - private MobileDeviceManagementRepository mobileDeviceMgtRepository; - - @XmlElement(name = "ManagementRepository", nillable = false) - public MobileDeviceManagementRepository getMobileDeviceMgtRepository() { - return mobileDeviceMgtRepository; - } - - public void setMobileDeviceMgtRepository( - MobileDeviceManagementRepository mobileDeviceMgtRepository) { - this.mobileDeviceMgtRepository = mobileDeviceMgtRepository; - } - -} 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/config/MobileDeviceManagementRepository.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/config/MobileDeviceManagementRepository.java deleted file mode 100644 index e40202acfe..0000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceManagementRepository.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * you may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.carbon.device.mgt.mobile.android.impl.config; - -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.DataSourceConfigAdapter; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.MobileDataSourceConfig; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import java.util.List; -import java.util.Map; - -/** - * Class for holding management repository data. - */ -@XmlRootElement(name = "ManagementRepository") -public class MobileDeviceManagementRepository { - - private Map mobileDataSourceConfigMap; - private List mobileDataSourceConfigs; - - public MobileDataSourceConfig getMobileDataSourceConfig(String provider) { - return mobileDataSourceConfigMap.get(provider); - } - - @XmlElement(name = "DataSourceConfigurations") - @XmlJavaTypeAdapter(DataSourceConfigAdapter.class) - public Map getMobileDataSourceConfigMap() { - return mobileDataSourceConfigMap; - } - - public void setMobileDataSourceConfigMap(Map mobileDataSourceConfigMap) { - this.mobileDataSourceConfigMap = mobileDataSourceConfigMap; - } - - public List getMobileDataSourceConfigs() { - return (List) mobileDataSourceConfigMap.values(); - } - -} diff --git a/components/mobile-plugins/android-plugin/pom.xml b/components/mobile-plugins/android-plugin/pom.xml index abef3c20ad..96bc4786c4 100644 --- a/components/mobile-plugins/android-plugin/pom.xml +++ b/components/mobile-plugins/android-plugin/pom.xml @@ -33,7 +33,9 @@ http://wso2.org - org.wso2.carbon.device.mgt.mobile.android + org.wso2.carbon.device.mgt.mobile.android.common + org.wso2.carbon.device.mgt.mobile.android.addons + org.wso2.carbon.device.mgt.mobile.android.core org.wso2.carbon.device.mgt.mobile.android.api org.wso2.carbon.device.mgt.mobile.android.emulator org.wso2.carbon.device.mgt.mobile.android.ui diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml index 34cda052b8..22690b491a 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml @@ -39,7 +39,11 @@ org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.mobile.android + org.wso2.carbon.device.mgt.mobile.android.core + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.common com.h2database.wso2 @@ -243,7 +247,10 @@ - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.android:${carbon.devicemgt.plugins.version} + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.android.core:${carbon.devicemgt.plugins.version} + + + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.android.common:${carbon.devicemgt.plugins.version} diff --git a/pom.xml b/pom.xml index 58d141fff1..9633307cd0 100644 --- a/pom.xml +++ b/pom.xml @@ -549,7 +549,17 @@ org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.mobile.android + org.wso2.carbon.device.mgt.mobile.android.common + ${carbon.devicemgt.plugins.version} + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.addons + ${carbon.devicemgt.plugins.version} + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.core ${carbon.devicemgt.plugins.version}