Fix requested changes in the review

revert-70aa11f8
lasanthaDLPDS 6 years ago
parent cc989148d6
commit 12d46550e6

@ -933,7 +933,7 @@ public interface UserManagementService {
Response validateUser(Credential credential);
@GET
@Path("/activities")
@Path("/device/activities")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
httpMethod = "GET",

@ -807,7 +807,7 @@ public class UserManagementServiceImpl implements UserManagementService {
@GET
@Override
@Path("/activities")
@Path("/device/activities")
public Response getActivities(
@QueryParam("since") String since,
@QueryParam("offset") int offset,
@ -825,7 +825,7 @@ public class UserManagementServiceImpl implements UserManagementService {
RequestValidationUtil.validatePaginationParameters(offset, limit);
if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) {
Date ifSinceDate;
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
SimpleDateFormat format = new SimpleDateFormat(Constants.DEFAULT_SIMPLE_DATE_FORMAT);
try {
ifSinceDate = format.parse(ifModifiedSince);
} catch (ParseException e) {
@ -837,7 +837,7 @@ public class UserManagementServiceImpl implements UserManagementService {
timestamp = ifModifiedSinceTimestamp / 1000;
} else if (since != null && !since.isEmpty()) {
Date sinceDate;
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
SimpleDateFormat format = new SimpleDateFormat(Constants.DEFAULT_SIMPLE_DATE_FORMAT);
try {
sinceDate = format.parse(since);
} catch (ParseException e) {

@ -30,6 +30,7 @@ public class Constants {
public static final String DEFAULT_STREAM_VERSION = "1.0.0";
public static final String SCOPE = "scope";
public static final String JDBC_USERSTOREMANAGER = "org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager";
public static final String DEFAULT_SIMPLE_DATE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z";
public static final int DEFAULT_PAGE_LIMIT = 50;

@ -1,8 +1,8 @@
package org.wso2.carbon.device.mgt.common;
/*
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* 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
@ -15,7 +15,6 @@ package org.wso2.carbon.device.mgt.common;
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
public class UserNotFoundException extends Exception {

@ -807,7 +807,7 @@ public interface UserManagementService {
@Valid EnrollmentInvitation enrollmentInvitation);
@GET
@Path("/activities")
@Path("/device/activities")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
httpMethod = "GET",

@ -644,7 +644,7 @@ public class UserManagementServiceImpl implements UserManagementService {
@GET
@Override
@Path("/activities")
@Path("/device/activities")
public Response getActivities(
@QueryParam("since") String since,
@QueryParam("offset") int offset,
@ -662,7 +662,7 @@ public class UserManagementServiceImpl implements UserManagementService {
RequestValidationUtil.validatePaginationParameters(offset, limit);
if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) {
Date ifSinceDate;
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
SimpleDateFormat format = new SimpleDateFormat(Constants.DEFAULT_SIMPLE_DATE_FORMAT);
try {
ifSinceDate = format.parse(ifModifiedSince);
} catch (ParseException e) {
@ -674,7 +674,7 @@ public class UserManagementServiceImpl implements UserManagementService {
timestamp = ifModifiedSinceTimestamp / 1000;
} else if (since != null && !since.isEmpty()) {
Date sinceDate;
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
SimpleDateFormat format = new SimpleDateFormat(Constants.DEFAULT_SIMPLE_DATE_FORMAT);
try {
sinceDate = format.parse(since);
} catch (ParseException e) {

@ -30,6 +30,7 @@ public class Constants {
public static final String DEFAULT_STREAM_VERSION = "1.0.0";
public static final String SCOPE = "scope";
public static final String JDBC_USERSTOREMANAGER = "org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager";
public static final String DEFAULT_SIMPLE_DATE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z";
public static final int DEFAULT_PAGE_LIMIT = 50;

Loading…
Cancel
Save