From a4538a6d6c7d51f7794c99c4b1ee85f9791f4667 Mon Sep 17 00:00:00 2001 From: harshanl Date: Mon, 3 Oct 2016 18:27:20 +0530 Subject: [PATCH] Removed unnecessary params from paginated queries --- .../device/mgt/jaxrs/beans/ActivityList.java | 2 -- .../mgt/jaxrs/beans/BasePaginatedResult.java | 32 +------------------ .../device/mgt/jaxrs/beans/BasicUserInfo.java | 2 +- .../mgt/jaxrs/beans/BasicUserInfoList.java | 2 -- .../device/mgt/jaxrs/beans/DeviceList.java | 2 -- .../mgt/jaxrs/beans/DeviceTypeList.java | 2 -- .../mgt/jaxrs/beans/NotificationList.java | 2 -- .../device/mgt/jaxrs/beans/OperationList.java | 2 -- .../device/mgt/jaxrs/beans/PolicyList.java | 2 -- .../device/mgt/jaxrs/beans/RoleList.java | 2 -- .../device/mgt/jaxrs/beans/UserInfoList.java | 2 -- .../service/api/UserManagementService.java | 2 +- 12 files changed, 3 insertions(+), 51 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ActivityList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ActivityList.java index 16e9f772a6..deb4f513ad 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ActivityList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ActivityList.java @@ -48,8 +48,6 @@ public class ActivityList extends BasePaginatedResult { sb.append("{\n"); sb.append(" count: ").append(getCount()).append(",\n"); - sb.append(" next: ").append(getNext()).append(",\n"); - sb.append(" previous: ").append(getPrevious()).append(",\n"); sb.append(" devices: [").append(activities).append("\n"); sb.append("]}\n"); return sb.toString(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasePaginatedResult.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasePaginatedResult.java index e423f56708..b3a60032e1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasePaginatedResult.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasePaginatedResult.java @@ -39,34 +39,4 @@ public class BasePaginatedResult { public void setCount(int count) { this.count = count; } - - - /** - * Link to the next subset of resources qualified. \nEmpty if no more resources are to be returned. - */ - @ApiModelProperty(value = "Link to the next subset of resources qualified. \n " + - "Empty if no more resources are to be returned.") - @JsonProperty("next") - public String getNext() { - return next; - } - - public void setNext(String next) { - this.next = next; - } - - /** - * Link to the previous subset of resources qualified. \nEmpty if current subset is the first subset returned. - */ - @ApiModelProperty(value = "Link to the previous subset of resources qualified. \n" + - "Empty if current subset is the first subset returned.") - @JsonProperty("previous") - public String getPrevious() { - return previous; - } - - public void setPrevious(String previous) { - this.previous = previous; - } - -} +} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasicUserInfo.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasicUserInfo.java index 467fd8afb5..d7c82a9edc 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasicUserInfo.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasicUserInfo.java @@ -24,8 +24,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(value = "BasicUserInfo", description = "Basic user information and the roles of the user.") public class BasicUserInfo { + @ApiModelProperty(name = "username", value = "The login name of the user.", required = true ) private String username; - @ApiModelProperty(name = "firstname", value = "The first name of the user.", required = true ) private String firstname; @ApiModelProperty(name = "lastname", value = "The last name of the user.", required = true ) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasicUserInfoList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasicUserInfoList.java index c8e58383c0..3cf94cbb97 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasicUserInfoList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasicUserInfoList.java @@ -47,8 +47,6 @@ public class BasicUserInfoList extends BasePaginatedResult { sb.append("{\n"); sb.append(" count: ").append(getCount()).append(",\n"); - sb.append(" next: ").append(getNext()).append(",\n"); - sb.append(" previous: ").append(getPrevious()).append(",\n"); sb.append(" users: [").append(users).append("\n"); sb.append("]}\n"); return sb.toString(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceList.java index 11e7505efc..5adb83af03 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceList.java @@ -45,8 +45,6 @@ public class DeviceList extends BasePaginatedResult { sb.append("{\n"); sb.append(" count: ").append(getCount()).append(",\n"); - sb.append(" next: ").append(getNext()).append(",\n"); - sb.append(" previous: ").append(getPrevious()).append(",\n"); sb.append(" devices: [").append(devices).append("\n"); sb.append("]}\n"); return sb.toString(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeList.java index 0398b6c7cf..c33150631e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeList.java @@ -90,8 +90,6 @@ public class DeviceTypeList { sb.append("{\n"); sb.append(" count: ").append(getCount()).append(",\n"); - sb.append(" next: ").append(getNext()).append(",\n"); - sb.append(" previous: ").append(getPrevious()).append(",\n"); sb.append(" deviceTypes: [").append(deviceTypes).append("\n"); sb.append("]}\n"); return sb.toString(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/NotificationList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/NotificationList.java index ad2297af85..7a7b013b0e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/NotificationList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/NotificationList.java @@ -46,8 +46,6 @@ public class NotificationList extends BasePaginatedResult { sb.append("{"); sb.append(" count: ").append(getCount()).append(","); - sb.append(" next: ").append(getNext()).append(","); - sb.append(" previous: ").append(getPrevious()).append(","); sb.append(" notifications: [").append(notifications).append(""); sb.append("]}"); return sb.toString(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/OperationList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/OperationList.java index 0080c8db8c..855f682f1b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/OperationList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/OperationList.java @@ -42,8 +42,6 @@ public class OperationList extends BasePaginatedResult { StringBuilder sb = new StringBuilder(); sb.append("{\n"); sb.append(" count: ").append(getCount()).append(",\n"); - sb.append(" next: ").append(getNext()).append(",\n"); - sb.append(" previous: ").append(getPrevious()).append(",\n"); sb.append(" operations: [").append(operations).append("\n"); sb.append("]}\n"); return sb.toString(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PolicyList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PolicyList.java index b7f4436283..8710f2bb74 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PolicyList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PolicyList.java @@ -45,8 +45,6 @@ public class PolicyList extends BasePaginatedResult { StringBuilder sb = new StringBuilder(); sb.append("{\n"); sb.append(" count: ").append(getCount()).append(",\n"); - sb.append(" next: ").append(getNext()).append(",\n"); - sb.append(" previous: ").append(getPrevious()).append(",\n"); sb.append(" policies: [").append(policies).append("\n"); sb.append("]}\n"); return sb.toString(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/RoleList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/RoleList.java index 11cfaa3ddc..311c4e0634 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/RoleList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/RoleList.java @@ -44,8 +44,6 @@ public class RoleList extends BasePaginatedResult { StringBuilder sb = new StringBuilder(); sb.append("{\n"); sb.append(" count: ").append(getCount()).append(",\n"); - sb.append(" next: ").append(getNext()).append(",\n"); - sb.append(" previous: ").append(getPrevious()).append(",\n"); sb.append(" roles: [").append(roles).append("\n"); sb.append("]}\n"); return sb.toString(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/UserInfoList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/UserInfoList.java index 6598ca83fb..fc3f575f75 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/UserInfoList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/UserInfoList.java @@ -46,8 +46,6 @@ public class UserInfoList extends BasePaginatedResult { StringBuilder sb = new StringBuilder(); sb.append("{\n"); sb.append(" count: ").append(getCount()).append(",\n"); - sb.append(" next: ").append(getNext()).append(",\n"); - sb.append(" previous: ").append(getPrevious()).append(",\n"); sb.append(" users: [").append(users).append("\n"); sb.append("]}\n"); return sb.toString(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index 9be8afd4eb..7ea6d8d5c5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -440,7 +440,7 @@ public interface UserManagementService { @QueryParam("limit") int limit); @PUT - @Path("/{username}/credentials") + @Path("/credentials") @ApiOperation( consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,