From f5915cbf5db87957fbc08408188452d2bffa6189 Mon Sep 17 00:00:00 2001 From: Madhawa Date: Thu, 12 May 2016 10:32:49 +0530 Subject: [PATCH] created interfaces for the api classes in order add swagger definitions --- .../org.wso2.carbon.device.mgt.api/pom.xml | 14 ++--- .../jaxrs/api/impl/AuthenticationImpl.java | 2 +- .../mgt/jaxrs/api/impl/ConfigurationImpl.java | 2 +- .../device/mgt/jaxrs/api/impl/DeviceImpl.java | 16 +++--- .../api/impl/DeviceNotificationImpl.java | 2 +- .../mgt/jaxrs/api/impl/FeatureImpl.java | 4 +- .../device/mgt/jaxrs/api/impl/GroupImpl.java | 4 +- .../mgt/jaxrs/api/impl/LicenseImpl.java | 10 ++-- .../mgt/jaxrs/api/impl/OperationImpl.java | 8 +-- .../device/mgt/jaxrs/api/impl/PolicyImpl.java | 34 ++++++------ .../mgt/jaxrs/api/impl/ProfileImpl.java | 10 ++-- .../device/mgt/jaxrs/api/impl/RoleImpl.java | 10 ++-- .../device/mgt/jaxrs/api/impl/UserImpl.java | 54 +++++++++---------- .../CredentialManagementResponseBuilder.java | 4 +- .../api/util/MDMAndroidOperationUtil.java | 4 +- .../jaxrs/api/util/MDMIOSOperationUtil.java | 2 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 14 ++--- .../src/main/webapp/WEB-INF/web.xml | 14 ++--- 18 files changed, 104 insertions(+), 104 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index 139385635d..07ef52fde5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -2,19 +2,19 @@ 0) { responseMsg.setStatusCode(HttpStatus.SC_CREATED); - responseMsg.setMessageFromServer("OperationImpl has added successfully."); + responseMsg.setMessageFromServer("Operation has added successfully."); } return Response.status(Response.Status.CREATED).entity(responseMsg).build(); } catch (OperationManagementException e) { @@ -184,7 +184,7 @@ public class OperationImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Opera appManagerConnector.installApplicationForDevices(operation, applicationWrapper.getDeviceIdentifiers()); } responseMsg.setStatusCode(HttpStatus.SC_CREATED); - responseMsg.setMessageFromServer("AuthenticationImpl installation request has been sent to the device."); + responseMsg.setMessageFromServer("Authentication installation request has been sent to the device."); return Response.status(Response.Status.CREATED).entity(responseMsg).build(); } catch (ApplicationManagementException | MDMAPIException e) { String msg = "Error occurred while saving the operation"; @@ -216,7 +216,7 @@ public class OperationImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Opera appManagerConnector.installApplicationForDevices(operation, applicationWrapper.getDeviceIdentifiers()); } responseMsg.setStatusCode(HttpStatus.SC_CREATED); - responseMsg.setMessageFromServer("AuthenticationImpl removal request has been sent to the device."); + responseMsg.setMessageFromServer("Authentication removal request has been sent to the device."); return Response.status(Response.Status.CREATED).entity(responseMsg).build(); } catch (ApplicationManagementException | MDMAPIException e) { String msg = "Error occurred while saving the operation"; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/PolicyImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/PolicyImpl.java index 2a3049a6b8..a1c84a0d05 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/PolicyImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/PolicyImpl.java @@ -101,10 +101,10 @@ public class PolicyImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Policy { PolicyAdministratorPoint pap = policyManagementService.getPAP(); pap.addPolicy(policy); responseMsg.setStatusCode(HttpStatus.SC_CREATED); - responseMsg.setMessageFromServer("PolicyImpl has been added successfully."); + responseMsg.setMessageFromServer("Policy has been added successfully."); return Response.status(Response.Status.CREATED).entity(responseMsg).build(); } catch (PolicyManagementException e) { - String msg = "PolicyImpl Management related exception"; + String msg = "Policy Management related exception"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } @@ -120,7 +120,7 @@ public class PolicyImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Policy { PolicyAdministratorPoint policyAdministratorPoint = policyManagementService.getPAP(); policies = policyAdministratorPoint.getPolicies(); } catch (PolicyManagementException e) { - String msg = "PolicyImpl Management related exception"; + String msg = "Policy Management related exception"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } @@ -142,14 +142,14 @@ public class PolicyImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Policy { PolicyAdministratorPoint policyAdministratorPoint = policyManagementService.getPAP(); policy = policyAdministratorPoint.getPolicy(policyId); } catch (PolicyManagementException e) { - String msg = "PolicyImpl Management related exception"; + String msg = "Policy Management related exception"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } if (policy == null){ ResponsePayload responsePayload = new ResponsePayload(); responsePayload.setStatusCode(HttpStatus.SC_NOT_FOUND); - responsePayload.setMessageFromServer("PolicyImpl for ID " + policyId + " not found."); + responsePayload.setMessageFromServer("Policy for ID " + policyId + " not found."); return Response.status(Response.Status.NOT_FOUND).entity(responsePayload).build(); } ResponsePayload responsePayload = new ResponsePayload(); @@ -169,7 +169,7 @@ public class PolicyImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Policy { Integer count = policyAdministratorPoint.getPolicyCount(); return Response.status(Response.Status.OK).entity(count).build(); } catch (PolicyManagementException e) { - String msg = "PolicyImpl Management related exception"; + String msg = "Policy Management related exception"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } @@ -198,10 +198,10 @@ public class PolicyImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Policy { PolicyAdministratorPoint pap = policyManagementService.getPAP(); pap.updatePolicy(policy); responseMsg.setStatusCode(HttpStatus.SC_CREATED); - responseMsg.setMessageFromServer("PolicyImpl has been updated successfully."); + responseMsg.setMessageFromServer("Policy has been updated successfully."); return Response.status(Response.Status.CREATED).entity(responseMsg).build(); } catch (PolicyManagementException e) { - String msg = "PolicyImpl Management related exception in policy update."; + String msg = "Policy Management related exception in policy update."; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } @@ -235,11 +235,11 @@ public class PolicyImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Policy { ResponsePayload responsePayload = new ResponsePayload(); if (policiesUpdated) { responsePayload.setStatusCode(HttpStatus.SC_OK); - responsePayload.setMessageFromServer("PolicyImpl Priorities successfully updated."); + responsePayload.setMessageFromServer("Policy Priorities successfully updated."); return Response.status(Response.Status.OK).entity(responsePayload).build(); } else { responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); - responsePayload.setMessageFromServer("PolicyImpl priorities did not update. Bad Request."); + responsePayload.setMessageFromServer("Policy priorities did not update. Bad Request."); return Response.status(Response.Status.BAD_REQUEST).entity(responsePayload).build(); } } @@ -272,7 +272,7 @@ public class PolicyImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Policy { return Response.status(Response.Status.OK).entity(responsePayload).build(); } else { responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); - responsePayload.setMessageFromServer("PolicyImpl does not exist."); + responsePayload.setMessageFromServer("Policy does not exist."); return Response.status(Response.Status.BAD_REQUEST).entity(responsePayload).build(); } } @@ -358,13 +358,13 @@ public class PolicyImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Policy { } catch (PolicyMonitoringTaskException e) { - String msg = "PolicyImpl Management related exception."; + String msg = "Policy Management related exception."; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } ResponsePayload responsePayload = new ResponsePayload(); responsePayload.setStatusCode(HttpStatus.SC_OK); - responsePayload.setMessageFromServer("PolicyImpl monitoring service started successfully."); + responsePayload.setMessageFromServer("Policy monitoring service started successfully."); return Response.status(Response.Status.OK).entity(responsePayload).build(); } @@ -379,13 +379,13 @@ public class PolicyImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Policy { taskScheduleService.updateTask(monitoringFrequency); } catch (PolicyMonitoringTaskException e) { - String msg = "PolicyImpl Management related exception."; + String msg = "Policy Management related exception."; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } ResponsePayload responsePayload = new ResponsePayload(); responsePayload.setStatusCode(HttpStatus.SC_OK); - responsePayload.setMessageFromServer("PolicyImpl monitoring service updated successfully."); + responsePayload.setMessageFromServer("Policy monitoring service updated successfully."); return Response.status(Response.Status.OK).entity(responsePayload).build(); } @@ -400,13 +400,13 @@ public class PolicyImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Policy { taskScheduleService.stopTask(); } catch (PolicyMonitoringTaskException e) { - String msg = "PolicyImpl Management related exception."; + String msg = "Policy Management related exception."; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } ResponsePayload responsePayload = new ResponsePayload(); responsePayload.setStatusCode(HttpStatus.SC_OK); - responsePayload.setMessageFromServer("PolicyImpl monitoring service stopped successfully."); + responsePayload.setMessageFromServer("Policy monitoring service stopped successfully."); return Response.status(Response.Status.OK).entity(responsePayload).build(); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/ProfileImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/ProfileImpl.java index dff753e7d6..80fa8c1349 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/ProfileImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/ProfileImpl.java @@ -45,7 +45,7 @@ public class ProfileImpl implements Profile{ profile = pap.addProfile(profile); return Response.status(Response.Status.OK).entity(profile).build(); } catch (PolicyManagementException e) { - String msg = "PolicyImpl Management related exception"; + String msg = "Policy Management related exception"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } @@ -59,10 +59,10 @@ public class ProfileImpl implements Profile{ try { PolicyAdministratorPoint pap = policyManagementService.getPAP(); pap.updateProfile(profile); - responseMsg.setMessageFromServer("ProfileImpl has been updated successfully."); + responseMsg.setMessageFromServer("Profile has been updated successfully."); return Response.status(Response.Status.OK).entity(responseMsg).build(); } catch (PolicyManagementException e) { - String msg = "PolicyImpl Management related exception"; + String msg = "Policy Management related exception"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } @@ -76,10 +76,10 @@ public class ProfileImpl implements Profile{ PolicyAdministratorPoint pap = policyManagementService.getPAP(); org.wso2.carbon.policy.mgt.common.Profile profile = pap.getProfile(profileId); pap.deleteProfile(profile); - responseMsg.setMessageFromServer("ProfileImpl has been deleted successfully."); + responseMsg.setMessageFromServer("Profile has been deleted successfully."); return Response.status(Response.Status.OK).entity(responseMsg).build(); } catch (PolicyManagementException e) { - String msg = "PolicyImpl Management related exception"; + String msg = "Policy Management related exception"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/RoleImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/RoleImpl.java index 0a187945fd..739f5f5678 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/RoleImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/RoleImpl.java @@ -107,7 +107,7 @@ public class RoleImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Role { // removing all internal roles and roles created for Service-providers List filteredRoles = new ArrayList<>(); for (String role : roles) { - if (!(role.startsWith("Internal/") || role.startsWith("AuthenticationImpl/"))) { + if (!(role.startsWith("Internal/") || role.startsWith("Authentication/"))) { filteredRoles.add(role); } } @@ -145,7 +145,7 @@ public class RoleImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Role { // removing all internal roles and roles created for Service-providers List filteredRoles = new ArrayList<>(); for (String role : roles) { - if (!(role.startsWith("Internal/") || role.startsWith("AuthenticationImpl/"))) { + if (!(role.startsWith("Internal/") || role.startsWith("Authentication/"))) { filteredRoles.add(role); } } @@ -255,7 +255,7 @@ public class RoleImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Role { } /** - * API is used to persist a new RoleImpl + * API is used to persist a new Role * * @param roleWrapper for role * @return response @@ -288,7 +288,7 @@ public class RoleImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Role { } /** - * API is used to update a role RoleImpl + * API is used to update a role Role * * @param roleWrapper for role * @return response @@ -441,7 +441,7 @@ public class RoleImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Role { // removing all internal roles and roles created for Service-providers List filteredRoles = new ArrayList<>(); for (String role : roles) { - if (!(role.startsWith("Internal/") || role.startsWith("AuthenticationImpl/"))) { + if (!(role.startsWith("Internal/") || role.startsWith("Authentication/"))) { filteredRoles.add(role); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/UserImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/UserImpl.java index 136eebc7c0..2b136e6131 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/UserImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/UserImpl.java @@ -63,7 +63,7 @@ import java.util.Random; import java.util.TreeSet; /** - * This class represents the JAX-RS services of UserImpl related functionality. + * This class represents the JAX-RS services of User related functionality. */ @SuppressWarnings("NonJaxWsWebServices") public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { @@ -88,13 +88,13 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { if (userStoreManager.isExistingUser(userWrapper.getUsername())) { // if user already exists if (log.isDebugEnabled()) { - log.debug("UserImpl by username: " + userWrapper.getUsername() + + log.debug("User by username: " + userWrapper.getUsername() + " already exists. Therefore, request made to add user was refused."); } // returning response with bad request state responsePayload.setStatusCode(HttpStatus.SC_CONFLICT); responsePayload. - setMessageFromServer("UserImpl by username: " + userWrapper.getUsername() + + setMessageFromServer("User by username: " + userWrapper.getUsername() + " already exists. Therefore, request made to add user was refused."); return Response.status(Response.Status.CONFLICT).entity(responsePayload).build(); } else { @@ -109,11 +109,11 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { inviteNewlyAddedUserToEnrollDevice(userWrapper.getUsername(), initialUserPassword); // Outputting debug message upon successful addition of user if (log.isDebugEnabled()) { - log.debug("UserImpl by username: " + userWrapper.getUsername() + " was successfully added."); + log.debug("User by username: " + userWrapper.getUsername() + " was successfully added."); } // returning response with success state responsePayload.setStatusCode(HttpStatus.SC_CREATED); - responsePayload.setMessageFromServer("UserImpl by username: " + userWrapper.getUsername() + + responsePayload.setMessageFromServer("User by username: " + userWrapper.getUsername() + " was successfully added."); return Response.status(Response.Status.CREATED).entity(responsePayload).build(); } @@ -127,7 +127,7 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { /** * Method to get user information from emm-user-store. * - * @param username UserImpl-name of the user + * @param username User-name of the user * @return {Response} Status of the request wrapped inside Response object. */ @Override @@ -146,21 +146,21 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { user.setLastname(getClaimValue(username, Constants.USER_CLAIM_LAST_NAME)); // Outputting debug message upon successful retrieval of user if (log.isDebugEnabled()) { - log.debug("UserImpl by username: " + username + " was found."); + log.debug("User by username: " + username + " was found."); } responsePayload.setStatusCode(HttpStatus.SC_OK); - responsePayload.setMessageFromServer("UserImpl information was retrieved successfully."); + responsePayload.setMessageFromServer("User information was retrieved successfully."); responsePayload.setResponseContent(user); return Response.status(Response.Status.OK).entity(responsePayload).build(); } else { // Outputting debug message upon trying to remove non-existing user if (log.isDebugEnabled()) { - log.debug("UserImpl by username: " + username + " does not exist."); + log.debug("User by username: " + username + " does not exist."); } // returning response with bad request state responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); responsePayload.setMessageFromServer( - "UserImpl by username: " + username + " does not exist."); + "User by username: " + username + " does not exist."); return Response.status(Response.Status.BAD_REQUEST).entity(responsePayload).build(); } } catch (UserStoreException | MDMAPIException e) { @@ -193,7 +193,7 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { byte[] decodedBytes = Base64.decodeBase64(userWrapper.getPassword()); userStoreManager.updateCredentialByAdmin(userWrapper.getUsername(), new String(decodedBytes, "UTF-8")); - log.debug("UserImpl credential of username: " + userWrapper.getUsername() + " has been changed"); + log.debug("User credential of username: " + userWrapper.getUsername() + " has been changed"); } List listofFilteredRoles = getFilteredRoles(userStoreManager, userWrapper.getUsername()); final String[] existingRoles = listofFilteredRoles.toArray(new String[listofFilteredRoles.size()]); @@ -223,22 +223,22 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { userStoreManager.setUserClaimValues(userWrapper.getUsername(), defaultUserClaims, null); // Outputting debug message upon successful addition of user if (log.isDebugEnabled()) { - log.debug("UserImpl by username: " + userWrapper.getUsername() + " was successfully updated."); + log.debug("User by username: " + userWrapper.getUsername() + " was successfully updated."); } // returning response with success state responsePayload.setStatusCode(HttpStatus.SC_CREATED); - responsePayload.setMessageFromServer("UserImpl by username: " + userWrapper.getUsername() + + responsePayload.setMessageFromServer("User by username: " + userWrapper.getUsername() + " was successfully updated."); return Response.status(Response.Status.CREATED).entity(responsePayload).build(); } else { if (log.isDebugEnabled()) { - log.debug("UserImpl by username: " + userWrapper.getUsername() + + log.debug("User by username: " + userWrapper.getUsername() + " doesn't exists. Therefore, request made to update user was refused."); } // returning response with bad request state responsePayload.setStatusCode(HttpStatus.SC_CONFLICT); responsePayload. - setMessageFromServer("UserImpl by username: " + userWrapper.getUsername() + + setMessageFromServer("User by username: " + userWrapper.getUsername() + " doesn't exists. Therefore, request made to update user was refused."); return Response.status(Response.Status.CONFLICT).entity(responsePayload).build(); } @@ -254,7 +254,7 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { * generate an initial user password for a user. * This will be the password used by a user for his initial login to the system. * - * @return {string} Initial UserImpl Password + * @return {string} Initial User Password */ private String generateInitialUserPassword() { int passwordLength = 6; @@ -313,22 +313,22 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { userStoreManager.deleteUser(username); // Outputting debug message upon successful removal of user if (log.isDebugEnabled()) { - log.debug("UserImpl by username: " + username + " was successfully removed."); + log.debug("User by username: " + username + " was successfully removed."); } // returning response with success state responsePayload.setStatusCode(HttpStatus.SC_OK); responsePayload.setMessageFromServer( - "UserImpl by username: " + username + " was successfully removed."); + "User by username: " + username + " was successfully removed."); return Response.status(Response.Status.OK).entity(responsePayload).build(); } else { // Outputting debug message upon trying to remove non-existing user if (log.isDebugEnabled()) { - log.debug("UserImpl by username: " + username + " does not exist for removal."); + log.debug("User by username: " + username + " does not exist for removal."); } // returning response with bad request state responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); responsePayload.setMessageFromServer( - "UserImpl by username: " + username + " does not exist for removal."); + "User by username: " + username + " does not exist for removal."); return Response.status(Response.Status.BAD_REQUEST).entity(responsePayload).build(); } } catch (UserStoreException | MDMAPIException e) { @@ -341,7 +341,7 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { /** * get all the roles except for the internal/xxx and application/xxx * - * @param userStoreManager UserImpl Store Manager associated with the currently logged in user + * @param userStoreManager User Store Manager associated with the currently logged in user * @param username Username of the currently logged in user * @return the list of filtered roles */ @@ -354,7 +354,7 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { } List filteredRoles = new ArrayList<>(); for (String role : roleListOfUser) { - if (!(role.startsWith("Internal/") || role.startsWith("AuthenticationImpl/"))) { + if (!(role.startsWith("Internal/") || role.startsWith("Authentication/"))) { filteredRoles.add(role); } } @@ -379,22 +379,22 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { responsePayload.setResponseContent(Collections.singletonList(getFilteredRoles(userStoreManager, username))); // Outputting debug message upon successful removal of user if (log.isDebugEnabled()) { - log.debug("UserImpl by username: " + username + " was successfully removed."); + log.debug("User by username: " + username + " was successfully removed."); } // returning response with success state responsePayload.setStatusCode(HttpStatus.SC_OK); responsePayload.setMessageFromServer( - "UserImpl roles obtained for user " + username); + "User roles obtained for user " + username); return Response.status(Response.Status.OK).entity(responsePayload).build(); } else { // Outputting debug message upon trying to remove non-existing user if (log.isDebugEnabled()) { - log.debug("UserImpl by username: " + username + " does not exist for role retrieval."); + log.debug("User by username: " + username + " does not exist for role retrieval."); } // returning response with bad request state responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); responsePayload.setMessageFromServer( - "UserImpl by username: " + username + " does not exist for role retrieval."); + "User by username: " + username + " does not exist for role retrieval."); return Response.status(Response.Status.BAD_REQUEST).entity(responsePayload).build(); } } catch (UserStoreException | MDMAPIException e) { @@ -673,7 +673,7 @@ public class UserImpl implements org.wso2.carbon.device.mgt.jaxrs.api.User { } return Response.status(Response.Status.OK).entity(dmService.getDevicesOfUser(username)).build(); } catch (DeviceManagementException e) { - String msg = "DeviceImpl management error"; + String msg = "Device management error"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/CredentialManagementResponseBuilder.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/CredentialManagementResponseBuilder.java index 41b755e6b0..16d0dc7823 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/CredentialManagementResponseBuilder.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/CredentialManagementResponseBuilder.java @@ -39,7 +39,7 @@ public class CredentialManagementResponseBuilder { /** * Builds the response to change the password of a user - * @param credentials - UserImpl credentials + * @param credentials - User credentials * @return Response Object */ public static Response buildChangePasswordResponse(UserCredentialWrapper credentials) { @@ -73,7 +73,7 @@ public class CredentialManagementResponseBuilder { /** * Builds the response to reset the password of a user - * @param credentials - UserImpl credentials + * @param credentials - User credentials * @return Response Object */ public static Response buildResetPasswordResponse(UserCredentialWrapper credentials) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/MDMAndroidOperationUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/MDMAndroidOperationUtil.java index 9f159aef94..643cf3a9bf 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/MDMAndroidOperationUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/MDMAndroidOperationUtil.java @@ -33,7 +33,7 @@ import org.wso2.carbon.device.mgt.jaxrs.beans.android.WebApplication; public class MDMAndroidOperationUtil { /** - * This method is used to create Install AuthenticationImpl operation. + * This method is used to create Install Authentication operation. * * @param application MobileApp application * @return operation @@ -76,7 +76,7 @@ public class MDMAndroidOperationUtil { } /** - * This method is used to create Uninstall AuthenticationImpl operation. + * This method is used to create Uninstall Authentication operation. * @param application MobileApp application * @return operation * @throws MDMAPIException diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/MDMIOSOperationUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/MDMIOSOperationUtil.java index af30ef8be1..0d9f031162 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/MDMIOSOperationUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/util/MDMIOSOperationUtil.java @@ -35,7 +35,7 @@ import java.util.Properties; public class MDMIOSOperationUtil { /** - * This method is used to create Install AuthenticationImpl operation. + * This method is used to create Install Authentication operation. * * @param application MobileApp application * @return operation diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 56a63ef35d..3f2159018c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -2,19 +2,19 @@ Admin-Webapp