Fix requested changes in the review

4.x.x
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,21 +1,20 @@
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,
* 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
* 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.
* 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.
*/
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