From eb12e5b9f13c8b5c36bec3e100e59665692fc2a0 Mon Sep 17 00:00:00 2001 From: lakshani Date: Mon, 6 Feb 2017 22:33:50 +0530 Subject: [PATCH] Adding commit 'added java doc comments' --- .../service/impl/DeviceManagementServiceImpl.java | 8 ++++++++ .../service/DeviceManagementProviderService.java | 9 +++++++++ .../service/DeviceManagementProviderServiceImpl.java | 12 +++++++++--- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index 8371c7f242..9b56130540 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -539,6 +539,14 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { } } + /** + * Change device status. + * + * @param type Device type + * @param id Device id + * @param newsStatus Device new status + * @return {@link Response} object + */ @PUT @Path("/{type}/{id}/changestatus") public Response changeDeviceStatus(@PathParam("type") @Size(max = 45) String type, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java index fd070a03e3..c973cd0afc 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java @@ -310,6 +310,15 @@ public interface DeviceManagementProviderService { List getDeviceEnrolledTenants() throws DeviceManagementException; + + /** + * Change device status. + * + * @param deviceIdentifier {@link DeviceIdentifier} object + * @param newStatus New status of the device + * @return Whether status is changed or not + * @throws DeviceManagementException on errors while trying to change device status + */ boolean changeDeviceStatus(DeviceIdentifier deviceIdentifier, EnrolmentInfo.Status newStatus) throws DeviceManagementException; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 70ec598a59..89846e27e5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -84,8 +84,6 @@ import java.util.Map; import java.util.Properties; import java.util.Set; -import static org.wso2.carbon.device.mgt.common.EnrolmentInfo.Status.ACTIVE; - public class DeviceManagementProviderServiceImpl implements DeviceManagementProviderService, PluginInitializationListener { @@ -170,7 +168,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv if (deviceManager.isClaimable(deviceIdentifier)) { device.getEnrolmentInfo().setStatus(EnrolmentInfo.Status.INACTIVE); } else { - device.getEnrolmentInfo().setStatus(ACTIVE); + device.getEnrolmentInfo().setStatus(EnrolmentInfo.Status.ACTIVE); } int tenantId = this.getTenantId(); @@ -1983,6 +1981,14 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv return false; } + /** + * Change device status. + * + * @param deviceIdentifier {@link DeviceIdentifier} object + * @param newStatus New status of the device + * @return Whether status is changed or not + * @throws DeviceManagementException on errors while trying to change device status + */ @Override public boolean changeDeviceStatus(DeviceIdentifier deviceIdentifier, EnrolmentInfo.Status newStatus) throws DeviceManagementException {