mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix requested changes in the review
This commit is contained in:
parent
cc989148d6
commit
12d46550e6
@ -933,7 +933,7 @@ public interface UserManagementService {
|
|||||||
Response validateUser(Credential credential);
|
Response validateUser(Credential credential);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/activities")
|
@Path("/device/activities")
|
||||||
@ApiOperation(
|
@ApiOperation(
|
||||||
produces = MediaType.APPLICATION_JSON,
|
produces = MediaType.APPLICATION_JSON,
|
||||||
httpMethod = "GET",
|
httpMethod = "GET",
|
||||||
|
|||||||
@ -807,7 +807,7 @@ public class UserManagementServiceImpl implements UserManagementService {
|
|||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Override
|
@Override
|
||||||
@Path("/activities")
|
@Path("/device/activities")
|
||||||
public Response getActivities(
|
public Response getActivities(
|
||||||
@QueryParam("since") String since,
|
@QueryParam("since") String since,
|
||||||
@QueryParam("offset") int offset,
|
@QueryParam("offset") int offset,
|
||||||
@ -825,7 +825,7 @@ public class UserManagementServiceImpl implements UserManagementService {
|
|||||||
RequestValidationUtil.validatePaginationParameters(offset, limit);
|
RequestValidationUtil.validatePaginationParameters(offset, limit);
|
||||||
if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) {
|
if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) {
|
||||||
Date ifSinceDate;
|
Date ifSinceDate;
|
||||||
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
|
SimpleDateFormat format = new SimpleDateFormat(Constants.DEFAULT_SIMPLE_DATE_FORMAT);
|
||||||
try {
|
try {
|
||||||
ifSinceDate = format.parse(ifModifiedSince);
|
ifSinceDate = format.parse(ifModifiedSince);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
@ -837,7 +837,7 @@ public class UserManagementServiceImpl implements UserManagementService {
|
|||||||
timestamp = ifModifiedSinceTimestamp / 1000;
|
timestamp = ifModifiedSinceTimestamp / 1000;
|
||||||
} else if (since != null && !since.isEmpty()) {
|
} else if (since != null && !since.isEmpty()) {
|
||||||
Date sinceDate;
|
Date sinceDate;
|
||||||
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
|
SimpleDateFormat format = new SimpleDateFormat(Constants.DEFAULT_SIMPLE_DATE_FORMAT);
|
||||||
try {
|
try {
|
||||||
sinceDate = format.parse(since);
|
sinceDate = format.parse(since);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
|
|||||||
@ -30,6 +30,7 @@ public class Constants {
|
|||||||
public static final String DEFAULT_STREAM_VERSION = "1.0.0";
|
public static final String DEFAULT_STREAM_VERSION = "1.0.0";
|
||||||
public static final String SCOPE = "scope";
|
public static final String SCOPE = "scope";
|
||||||
public static final String JDBC_USERSTOREMANAGER = "org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager";
|
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;
|
public static final int DEFAULT_PAGE_LIMIT = 50;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,21 +1,20 @@
|
|||||||
package org.wso2.carbon.device.mgt.common;
|
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
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* 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.
|
|
||||||
*
|
*
|
||||||
|
* 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 {
|
public class UserNotFoundException extends Exception {
|
||||||
|
|||||||
@ -807,7 +807,7 @@ public interface UserManagementService {
|
|||||||
@Valid EnrollmentInvitation enrollmentInvitation);
|
@Valid EnrollmentInvitation enrollmentInvitation);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/activities")
|
@Path("/device/activities")
|
||||||
@ApiOperation(
|
@ApiOperation(
|
||||||
produces = MediaType.APPLICATION_JSON,
|
produces = MediaType.APPLICATION_JSON,
|
||||||
httpMethod = "GET",
|
httpMethod = "GET",
|
||||||
|
|||||||
@ -644,7 +644,7 @@ public class UserManagementServiceImpl implements UserManagementService {
|
|||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Override
|
@Override
|
||||||
@Path("/activities")
|
@Path("/device/activities")
|
||||||
public Response getActivities(
|
public Response getActivities(
|
||||||
@QueryParam("since") String since,
|
@QueryParam("since") String since,
|
||||||
@QueryParam("offset") int offset,
|
@QueryParam("offset") int offset,
|
||||||
@ -662,7 +662,7 @@ public class UserManagementServiceImpl implements UserManagementService {
|
|||||||
RequestValidationUtil.validatePaginationParameters(offset, limit);
|
RequestValidationUtil.validatePaginationParameters(offset, limit);
|
||||||
if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) {
|
if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) {
|
||||||
Date ifSinceDate;
|
Date ifSinceDate;
|
||||||
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
|
SimpleDateFormat format = new SimpleDateFormat(Constants.DEFAULT_SIMPLE_DATE_FORMAT);
|
||||||
try {
|
try {
|
||||||
ifSinceDate = format.parse(ifModifiedSince);
|
ifSinceDate = format.parse(ifModifiedSince);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
@ -674,7 +674,7 @@ public class UserManagementServiceImpl implements UserManagementService {
|
|||||||
timestamp = ifModifiedSinceTimestamp / 1000;
|
timestamp = ifModifiedSinceTimestamp / 1000;
|
||||||
} else if (since != null && !since.isEmpty()) {
|
} else if (since != null && !since.isEmpty()) {
|
||||||
Date sinceDate;
|
Date sinceDate;
|
||||||
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
|
SimpleDateFormat format = new SimpleDateFormat(Constants.DEFAULT_SIMPLE_DATE_FORMAT);
|
||||||
try {
|
try {
|
||||||
sinceDate = format.parse(since);
|
sinceDate = format.parse(since);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
|
|||||||
@ -30,6 +30,7 @@ public class Constants {
|
|||||||
public static final String DEFAULT_STREAM_VERSION = "1.0.0";
|
public static final String DEFAULT_STREAM_VERSION = "1.0.0";
|
||||||
public static final String SCOPE = "scope";
|
public static final String SCOPE = "scope";
|
||||||
public static final String JDBC_USERSTOREMANAGER = "org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager";
|
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;
|
public static final int DEFAULT_PAGE_LIMIT = 50;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user