Examples of XStreamRepresentation


Examples of org.geowebcache.rest.XstreamRepresentation

        Collections.sort(layerNames);

        Representation representation;
        if (extension.equalsIgnoreCase("xml")) {

            representation = new XstreamRepresentation(layerNames);
            representation.setCharacterSet(CharacterSet.UTF_8);

            final XStream xStream = ((XstreamRepresentation) representation).getXStream();
            xStream.alias("layers", List.class);
View Full Code Here

Examples of org.sonatype.plexus.rest.representation.XStreamRepresentation

    String responeText = response.getEntity().getText();
    Assert.assertTrue(
        "Expected sucess: Status was: " + response.getStatus() + "\nResponse:\n" + responeText,
        response.getStatus().isSuccess());

    XStreamRepresentation representation = new XStreamRepresentation(this.xstream, responeText, this.mediaType);
    ContentListResourceResponse listRepsonse = (ContentListResourceResponse) representation
        .getPayload(new ContentListResourceResponse());

    return listRepsonse.getData();

  }
View Full Code Here

Examples of org.sonatype.plexus.rest.representation.XStreamRepresentation

  }

  public RepositoryGroupResource createGroup(final RepositoryGroupResource group)
      throws IOException
  {
    XStreamRepresentation representation = request(group);

    String payload = nexusRestClient.doPostForText(SERVICE_PART, representation, isSuccessful());

    return response(payload);
  }
View Full Code Here

Examples of org.sonatype.plexus.rest.representation.XStreamRepresentation

  }

  public RepositoryGroupResource updateGroup(final RepositoryGroupResource group)
      throws IOException
  {
    XStreamRepresentation representation = request(group);

    String payload = nexusRestClient.doPutForText(SERVICE_PART + "/" + group.getId(), representation,
        isSuccessful());

    return response(payload);
View Full Code Here

Examples of org.sonatype.plexus.rest.representation.XStreamRepresentation

    return response(payload);
  }

  private RepositoryGroupResource response(final String payload) {
    XStreamRepresentation representation = representation();

    representation.setText(payload);

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

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

Examples of org.sonatype.plexus.rest.representation.XStreamRepresentation

    return resourceResponse.getData();
  }

  private XStreamRepresentation request(final RepositoryGroupResource group) {
    XStreamRepresentation representation = representation();

    RepositoryGroupResourceResponse request = new RepositoryGroupResourceResponse();
    request.setData(group);
    representation.setPayload(request);
    return representation;
  }
View Full Code Here

Examples of org.sonatype.plexus.rest.representation.XStreamRepresentation

    representation.setPayload(request);
    return representation;
  }

  private XStreamRepresentation representation() {
    return new XStreamRepresentation(xstream, "", mediaType);
  }
View Full Code Here

Examples of org.sonatype.plexus.rest.representation.XStreamRepresentation

  {
    String responseText = nexusRestClient.doGetForText(SERVICE_PART + "/" + groupId);
    LOG.debug("responseText: \n" + responseText);

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

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

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

Examples of org.sonatype.plexus.rest.representation.XStreamRepresentation

   * IMPORTANT: Make sure to release the Response in a finally block when you are done with it.
   */
  public Response sendMessage(Method method, RepositoryGroupResource resource, String id)
      throws IOException
  {
    XStreamRepresentation representation = new XStreamRepresentation(xstream, "", mediaType);

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

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

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

    LOG.debug("sendMessage: " + representation.getText());

    return nexusRestClient.sendMessage(serviceURI, method, representation);
  }
View Full Code Here

Examples of org.sonatype.plexus.rest.representation.XStreamRepresentation

      throws IOException
  {
    String responseText = nexusRestClient.doGetForText(SERVICE_PART);
    LOG.debug("responseText: \n" + responseText);

    XStreamRepresentation representation =
        new XStreamRepresentation(XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML);

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

    return resourceResponse.getData();

  }
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.