Fixing getDevice method to support status, ownership, etc as query param filters

revert-70aa11f8
prabathabey 9 years ago
parent 12a22d86ef
commit 61beca5048

@ -77,14 +77,18 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
PaginationResult result;
if (type != null) {
request.setDeviceType(type);
result = dms.getDevicesByType(request);
} else if (user != null) {
request.setOwner(user);
result = dms.getDevicesOfUser(request);
} else if (ownership != null) {
RequestValidationUtil.validateOwnershipType(ownership);
request.setOwnership(ownership);
result = dms.getDevicesByOwnership(request);
} else if (status != null) {
RequestValidationUtil.validateStatus(status);
request.setStatus(status);
result = dms.getDevicesByStatus(request);
} else {
result = dms.getAllDevices(request);

@ -79,7 +79,7 @@ public class UserManagementServiceImpl implements UserManagementService {
this.inviteNewlyAddedUserToEnrollDevice(userWrapper.getUsername(), initialUserPassword);
// Outputting debug message upon successful addition of user
if (log.isDebugEnabled()) {
log.debug("User by username: " + userWrapper.getUsername() + " was successfully added.");
log.debug("User '" + userWrapper.getUsername() + "' has successfully been added.");
}
// returning response with success state
return Response.status(Response.Status.OK).entity("User by username: " + userWrapper.getUsername() +

Loading…
Cancel
Save