Package javax.ws.rs.client

Examples of javax.ws.rs.client.WebTarget.queryParam()


            // Jersey does not allow entity value to be null.
            Object content = request.getContent() != null ? request.getContent() : "";
            Entity entity = Entity.entity(content, contentType);
            WebTarget webTarget = newWebTarget(request.getPath());
            for (CouchHttpQueryParam queryParam : request.getHttpQuery()) {
                webTarget = webTarget.queryParam(queryParam.getName(), queryParam.getValue());
            }

            URI uri = webTarget.getUri();
            if (log.isDebugEnabled()) {
                log.debug("Put url: " + uri.toString());
View Full Code Here


        try {
            // Jersey does not allow entity value to be null.
            Entity entity = Entity.json(request.getContent());
            WebTarget webTarget = newWebTarget(request.getPath());
            for (CouchHttpQueryParam queryParam : request.getHttpQuery()) {
                webTarget = webTarget.queryParam(queryParam.getName(), queryParam.getValue());
            }

            Response postResponse = webTarget.request(MediaType.APPLICATION_JSON_TYPE)
                .post(entity);
View Full Code Here

                throw CouchException.badRequest("Attempting to delete with empty path, which would delete the database so we will fail. If you really want to delete the database use the explicit deleteDatabase method.");
            }

            WebTarget webTarget = newWebTarget(request.getPath());
            for (CouchHttpQueryParam queryParam : request.getHttpQuery()) {
                webTarget = webTarget.queryParam(queryParam.getName(), queryParam.getValue());
            }
            Response deleteResponse = webTarget.request().delete();

            URI uri = webTarget.getUri();
            if (log.isDebugEnabled()) {
View Full Code Here

    }

    protected WebTarget newWebTarget(HttpReadRequest request) {
        WebTarget webTarget = newWebTarget(request.getPath());
        for (CouchHttpQueryParam queryParam : request.getHttpQuery()) {
            webTarget = webTarget.queryParam(queryParam.getName(), queryParam.getValue());
        }
        return webTarget;
    }

    protected String getETag(Response response) {
View Full Code Here

    private Builder getInvocationBuilder() throws Exception {
        Client client = customizeClient(ClientBuilder.newClient());
        client.register(HttpAuthenticationFeature.basic(getUserName(), getPassword()));
        WebTarget target = client.target(getUrl());
        for (Map.Entry<String, String> e : getQueryParams().entrySet()) {
            target = target.queryParam(e.getKey(), e.getValue());
        }
        return target.request(getResponseBodyMediaType()).header("X-Include-Resource-Links", "true").header("X-Requested-By", "MyClient");
    }

    protected Client customizeClient(Client client) {
View Full Code Here

  @Override
  public WebTarget getWebTarget(final ZoneListCommand command,
      final CommandMetaData commandMetaData) {
    WebTarget resolvedZoneListTarget = zoneListTarget;
    if (command.getSearchName() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget.queryParam(
          "searchName", command.getSearchName());
    }
    if (command.getSearchNameSearchType() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget.queryParam(
          "searchNameSearchType", command.getSearchNameSearchType());
View Full Code Here

    if (command.getSearchName() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget.queryParam(
          "searchName", command.getSearchName());
    }
    if (command.getSearchNameSearchType() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget.queryParam(
          "searchNameSearchType", command.getSearchNameSearchType());
    }
    if (command.getSearchNameServerInterfaceSetId() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget.queryParam(
          "searchNameServerInterfaceSetId",
View Full Code Here

    if (command.getSearchNameSearchType() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget.queryParam(
          "searchNameSearchType", command.getSearchNameSearchType());
    }
    if (command.getSearchNameServerInterfaceSetId() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget.queryParam(
          "searchNameServerInterfaceSetId",
          command.getSearchNameServerInterfaceSetId());
    }
    if (command.getSearchNameServerSetId() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget
View Full Code Here

      resolvedZoneListTarget = resolvedZoneListTarget.queryParam(
          "searchNameServerInterfaceSetId",
          command.getSearchNameServerInterfaceSetId());
    }
    if (command.getSearchNameServerSetId() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget
          .queryParam("searchNameServerSetId",
              command.getSearchNameServerSetId());
    }
    if (command.getSearchPlanId() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget
View Full Code Here

      resolvedZoneListTarget = resolvedZoneListTarget
          .queryParam("searchNameServerSetId",
              command.getSearchNameServerSetId());
    }
    if (command.getSearchPlanId() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget
          .queryParam("searchPlanId",
              command.getSearchPlanId());
    }
    if (command.getSearchGroup() != null) {
      resolvedZoneListTarget = resolvedZoneListTarget.queryParam(
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.