Examples of PlexusUserResourceResponse


Examples of org.sonatype.security.rest.model.PlexusUserResourceResponse

    }
    finally {
      RequestFacade.releaseResponse(response);
    }

    PlexusUserResourceResponse result =
        (PlexusUserResourceResponse) this.parseResponseText(entityText, new PlexusUserResourceResponse());

    return result.getData();
  }
View Full Code Here

Examples of org.sonatype.security.rest.model.PlexusUserResourceResponse

  @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;
  }
View Full Code Here

Examples of org.sonatype.security.rest.model.PlexusUserResourceResponse

  @Override
  @GET
  public PlexusUserResourceResponse get(Context context, Request request, Response response, Variant variant)
      throws ResourceException
  {
    PlexusUserResourceResponse result = new PlexusUserResourceResponse();

    User user;
    try {
      user = this.getSecuritySystem().getUser(getUserId(request));
    }
    catch (UserNotFoundException e) {
      throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND);
    }

    PlexusUserResource resource = securityToRestModel(user);

    result.setData(resource);

    return result;
  }
View Full Code Here

Examples of org.sonatype.security.rest.model.PlexusUserResourceResponse

  }

  @Test
  public void testPlexusUserResourceResponse() {
    PlexusUserResourceResponse resourceResponse = new PlexusUserResourceResponse();
    PlexusUserResource resource = new PlexusUserResource();
    resourceResponse.setData(resource);

    resource.setUserId("userId");
    resource.setSource("source");
    resource.setEmail("email");
    PlexusRoleResource role1 = new PlexusRoleResource();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.