Examples of PlexusUserListResourceResponse


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

    }
    finally {
      RequestFacade.releaseResponse(response);
    }

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

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

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

    }
    finally {
      RequestFacade.releaseResponse(response);
    }

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

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

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

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

    // TODO: this logic should be removed from the this resource
    String source = getUserSource(request);
    Set<User> users = null;
    if ("all".equalsIgnoreCase(source)) {
      users = this.getSecuritySystem().listUsers();
    }
    else {
      users = this.getSecuritySystem().searchUsers(new UserSearchCriteria(null, null, source));
    }

    result.setData(this.securityToRestModel(users));

    return result;
  }
View Full Code Here

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

    return source;
  }

  protected PlexusUserListResourceResponse search(UserSearchCriteria criteria) {
    PlexusUserListResourceResponse result = new PlexusUserListResourceResponse();

    Set<User> users = this.getSecuritySystem().searchUsers(criteria);
    result.setData(this.securityToRestModel(users));

    return result;
  }
View Full Code Here

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

          Method.PUT,
          new XStreamRepresentation(xstream, xstream.toXML(resourceRequest), MediaType.APPLICATION_XML));

      assertThat(response.getStatus().getCode(), is(200));

      final PlexusUserListResourceResponse userList = this.getFromResponse(
          PlexusUserListResourceResponse.class, xstream, response
      );

      assertThat(userList, is(notNullValue()));
      assertThat(userList.getData(), is(notNullValue()));

      return userList.getData();
    }
    finally {
      RequestFacade.releaseResponse(response);
    }
  }
View Full Code Here

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

  }

  @Test
  public void testPlexusUserListResourceResponse() {
    PlexusUserListResourceResponse resourceResponse = new PlexusUserListResourceResponse();
    PlexusUserResource resource1 = new PlexusUserResource();
    resourceResponse.addData(resource1);

    resource1.setUserId("userId");
    resource1.setSource("source");
    resource1.setEmail("email");
    PlexusRoleResource role1 = new PlexusRoleResource();
    role1.setName("role1");
    role1.setSource("source1");
    role1.setRoleId("roleId1");
    resource1.addRole(role1);

    PlexusRoleResource role2 = new PlexusRoleResource();
    role1.setName("role2");
    role1.setSource("source2");
    role1.setRoleId("roleId2");
    resource1.addRole(role2);

    PlexusUserResource resource2 = new PlexusUserResource();
    resourceResponse.addData(resource2);

    resource2.setUserId("userId");
    resource2.setSource("source");
    resource2.setEmail("email");
    PlexusRoleResource role3 = 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.