@Override
@GET
public PlexusUserResourceResponse get(Context context, Request request, Response response, Variant variant)
throws ResourceException
{
PlexusUserResourceResponse result = new PlexusUserResourceResponse();
User user;
try {
// TODO: remove the "all" we either need to move it down into the SecuritySystem, or remove it, i vote
// remove it.
String source = getUserSource(request);
if ("all".equalsIgnoreCase(source)) {
user = this.getSecuritySystem().getUser(getUserId(request));
}
else {
user = this.getSecuritySystem().getUser(getUserId(request), source);
}
}
catch (UserNotFoundException e) {
throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND);
}
catch (NoSuchUserManagerException e) {
this.getLogger().warn(e.getMessage(), e);
throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND);
}
if (user == null) {
}
PlexusUserResource resource = securityToRestModel(user);
result.setData(resource);
return result;
}