Examples of LdapServerListResponse


Examples of com.sonatype.security.ldap.api.dto.LdapServerListResponse

  @GET
  public LdapServerListResponse get(Context context, Request request, Response response, Variant variant)
      throws ResourceException
  {

    LdapServerListResponse listResponse = new LdapServerListResponse();
    List<LdapServerListEntryDTO> entries = new ArrayList<LdapServerListEntryDTO>();
    for (CLdapServerConfiguration ldapServer : this.ldapConfigurationManager.listLdapServerConfigurations()) {
      entries.add(this.toListEntry(request, ldapServer));
    }

    listResponse.setData(entries);
    return listResponse;
  }
View Full Code Here

Examples of com.sonatype.security.ldap.api.dto.LdapServerListResponse

    postResult = (LdapServerRequest) pr.post(null, request, null, ldapServerRequest);
    Assert.assertNotNull(postResult.getData().getId());
    expectedIds.add(postResult.getData().getId());

    // now test get
    LdapServerListResponse listResponse = (LdapServerListResponse) pr.get(null, request, null, null);
    List<LdapServerListEntryDTO> results = listResponse.getData();

    //these should be in order as they where created
    Assert.assertEquals(expectedIds.get(0), results.get(0).getId());
    Assert.assertEquals("testGet-1", results.get(0).getName());
    Assert.assertEquals("ldap://testGet1:386/ou=searchbase", results.get(0).getLdapUrl());
View Full Code Here

Examples of com.sonatype.security.ldap.api.dto.LdapServerListResponse

      throws Exception
  {
    Response response = null;
    try {
      response = RequestFacade.doGetRequest(RequestFacade.SERVICE_LOCAL + "ldap/servers");
      LdapServerListResponse listResponse = this.getFromResponse(
          LdapServerListResponse.class,
          this.getXMLXStream(),
          response);

      return listResponse.getData();

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

Examples of com.sonatype.security.ldap.api.dto.LdapServerListResponse

    // call post to create data
    LdapServerRequest ldapResponse = this.createServer();
    Response response = null;
    try {
      response = RequestFacade.doGetRequest(RequestFacade.SERVICE_LOCAL + "ldap/servers");
      LdapServerListResponse listResponse = this.getFromResponse(
          LdapServerListResponse.class,
          this.getXMLXStream(),
          response);

      boolean found = false;
      for (LdapServerListEntryDTO entry : listResponse.getData()) {
        if (entry.getId().equals(ldapResponse.getData().getId())) {
          found = true;
          break;
        }
      }
View Full Code Here

Examples of com.sonatype.security.ldap.api.dto.LdapServerListResponse

    Response response = null;
    try {
      // get all server entries, as we don't know the ID of them, since it was OSS config upgraded on the fly
      response = RequestFacade.sendMessage(RequestFacade.SERVICE_LOCAL + "ldap/servers", Method.GET);
      Assert.assertEquals("Expected status 200, got: " + response.getStatus(), 200, response.getStatus().getCode());
      LdapServerListResponse ldapServers = getFromResponse(LdapServerListResponse.class, xstream, response);
      Assert.assertNotNull(ldapServers);

      // delete each entry we find
      for (LdapServerListEntryDTO serverEntry : ldapServers.getData()) {
        response = RequestFacade.sendMessage(RequestFacade.SERVICE_LOCAL + "ldap/servers/" + serverEntry.getId(),
            Method.DELETE);
        Assert.assertEquals("Expected status 204, got: " + response.getStatus(), 204, response.getStatus().getCode());
      }
    }
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.