Examples of RepositoryResourceResponse


Examples of org.sonatype.nexus.rest.model.RepositoryResourceResponse

    // this should use call to: getResourceFromResponse
    XStreamRepresentation representation =
        new XStreamRepresentation(XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML);

    RepositoryResourceResponse resourceResponse =
        (RepositoryResourceResponse) representation.getPayload(new RepositoryResourceResponse());

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

Examples of org.sonatype.nexus.rest.model.RepositoryResourceResponse

    String idPart = (method == Method.POST) ? "" : "/" + id;

    String serviceURI = SERVICE_PART + idPart;

    RepositoryResourceResponse repoResponseRequest = new RepositoryResourceResponse();
    repoResponseRequest.setData(resource);

    // now set the payload
    representation.setPayload(repoResponseRequest);

    LOG.debug("sendMessage: " + representation.getText());
View Full Code Here

Examples of org.sonatype.nexus.rest.model.RepositoryResourceResponse

  {
    String responseString = response.getEntity().getText();
    LOG.debug(" getRepositoryBaseResourceFromResponse: " + responseString);

    XStreamRepresentation representation = new XStreamRepresentation(xstream, responseString, mediaType);
    RepositoryResourceResponse resourceResponse =
        (RepositoryResourceResponse) representation.getPayload(new RepositoryResourceResponse());

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

Examples of org.sonatype.nexus.rest.model.RepositoryResourceResponse

    assertThat(repository.isExposed(), is(false));
    assertThat(repository.isAutoBlocking(), is(true));
  }

  private void doCreateNxcm5131Repo(final String id) {
    final RepositoryResourceResponse request = new RepositoryResourceResponse();
    final RepositoryProxyResource repo = new RepositoryProxyResource();
    repo.setId(id);
    repo.setFormat("nxcm5131");
    repo.setRepoType("proxy");
    repo.setRepoPolicy("MIXED");
    repo.setChecksumPolicy("IGNORE");
    repo.setProvider("nxcm5131");
    repo.setProviderRole("org.sonatype.nexus.proxy.repository.Repository");
    final RepositoryResourceRemoteStorage remoteStorage = new RepositoryResourceRemoteStorage();
    remoteStorage.setRemoteStorageUrl("http://obvious.fake/url");
    repo.setRemoteStorage(remoteStorage);
    request.setData(repo);

    doCreateRepo(request);
  }
View Full Code Here

Examples of org.sonatype.nexus.rest.model.RepositoryResourceResponse

    doCreateRepo(request);
  }

  private void doCreateMaven2Repo(final String id) {
    final RepositoryResourceResponse request = new RepositoryResourceResponse();
    final RepositoryProxyResource repo = new RepositoryProxyResource();
    repo.setId(id);
    repo.setFormat("maven2");
    repo.setRepoType("proxy");
    repo.setRepoPolicy("RELEASE");
    repo.setChecksumPolicy("IGNORE");
    repo.setProvider("maven2");
    repo.setProviderRole("org.sonatype.nexus.proxy.repository.Repository");
    final RepositoryResourceRemoteStorage remoteStorage = new RepositoryResourceRemoteStorage();
    remoteStorage.setRemoteStorageUrl("http://obvious.fake/url");
    repo.setRemoteStorage(remoteStorage);
    request.setData(repo);

    doCreateRepo(request);
  }
View Full Code Here

Examples of org.sonatype.nexus.rest.model.RepositoryResourceResponse

  }

  public void marshal(Object value, HierarchicalStreamWriter writer, MarshallingContext context) {

    // removes the class="class.name" attribute
    RepositoryResourceResponse top = (RepositoryResourceResponse) value;
    if (top.getData() != null) {
      // make sure the data's repoType field is valid, or we wont be able to deserialize it on the other side
      if (StringUtils.isEmpty(top.getData().getRepoType())) {
        throw new ConversionException("Missing value for field: RepositoryResourceResponse.data.repoType.");
      }

      writer.startNode("data");
      context.convertAnother(top.getData());
      writer.endNode();
    }

  }
View Full Code Here

Examples of org.sonatype.nexus.rest.model.RepositoryResourceResponse

    remoteStorage.setConnectionSettings(connection);

    repo.setRemoteStorage(remoteStorage);

    RepositoryResourceResponse resourceResponse = new RepositoryResourceResponse();
    resourceResponse.setData(repo);

    this.marshalUnmarchalThenCompare(resourceResponse);
    // this.marshalUnmarchalThenCompare( resourceResponse, xstreamJSON );
    this.validateXmlHasNoPackageNames(resourceResponse);
  }
View Full Code Here

Examples of org.sonatype.nexus.rest.model.RepositoryResourceResponse

    repo.setContentResourceURI("contentResourceURI");
    repo.setExposed(true);
    repo.setProvider("provider");
    repo.setProviderRole("providerrole");

    RepositoryResourceResponse resourceResponse = new RepositoryResourceResponse();
    resourceResponse.setData(repo);

    this.marshalUnmarchalThenCompare(resourceResponse);
    this.validateXmlHasNoPackageNames(resourceResponse);
  }
View Full Code Here

Examples of org.sonatype.nexus.rest.model.RepositoryResourceResponse

    remoteStorage.setConnectionSettings(connection);

    repo.setRemoteStorage(remoteStorage);

    RepositoryResourceResponse resourceResponse = new RepositoryResourceResponse();
    resourceResponse.setData(repo);

    this.marshalUnmarchalThenCompare(resourceResponse);
    this.validateXmlHasNoPackageNames(resourceResponse);
  }
View Full Code Here

Examples of org.sonatype.nexus.rest.model.RepositoryResourceResponse

  public static final String RESOURCE_URI = "/templates/repositories/{" + REPOSITORY_ID_KEY + "}";

  @Override
  public Object getPayloadInstance() {
    return new RepositoryResourceResponse();
  }
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.