Refine search
protected URI getURI(String headerValue) { if (headerValue == null) return null; URI toReturn = URI.create(headerValue); if (!"127.0.0.1".equals(toReturn.getHost())) return toReturn; return uriBuilder(toReturn).host(hostToReplace).build(); }
protected URI getURI(String headerValue) { if (headerValue == null) return null; URI toReturn = URI.create(headerValue); if (!"127.0.0.1".equals(toReturn.getHost())) return toReturn; return uriBuilder(toReturn).host(hostToReplace).build(); }
@Override public URI apply(String path) throws HttpException { String requestedResource = new StringBuilder().append("/rest/namespace/").append(path).toString(); String expires = timeStampProvider.get().toString(); String signature = signString(createStringToSign(requestedResource, expires)); return uriBuilder(provider.get()) .replaceQuery(ImmutableMap.of("uid", creds.get().identity, "expires", expires, "signature", signature)) .appendPath(requestedResource).build(); }
/** * @see HttpRequest#getEndpoint() */ public T replacePath(String path) { checkNotNull(endpoint, "endpoint"); checkNotNull(path, "path"); endpoint = uriBuilder(endpoint).path(path).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T replacePath(String path) { checkNotNull(endpoint, "endpoint"); checkNotNull(path, "path"); endpoint = uriBuilder(endpoint).path(path).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T replacePath(String path) { checkNotNull(endpoint, "endpoint"); checkNotNull(path, "path"); endpoint = uriBuilder(endpoint).path(path).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T replacePath(String path) { checkNotNull(endpoint, "endpoint"); checkNotNull(path, "path"); endpoint = uriBuilder(endpoint).path(path).build(); return self(); }
@SuppressWarnings("unchecked") @Override public <R extends HttpRequest> R bindToRequest(R request, Object arg) { CreateRecord<?> in = CreateRecord.class.cast(checkNotNull(arg, "record to create")); URI path = uriBuilder(request.getEndpoint()) .build(ImmutableMap.<String, Object> builder() .put("type", in.getType()) .put("fqdn", in.getFQDN()).build()); return (R) request.toBuilder() .endpoint(path) .payload(json.toJson(ImmutableMap.of("rdata", in.getRData(), "ttl", in.getTTL()))).build(); } }
/** * @see HttpRequest#getEndpoint() */ public T addQueryParam(String name, Iterable<String> values) { endpoint = uriBuilder(endpoint).addQuery(name, values).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T addQueryParam(String name, String... values) { endpoint = uriBuilder(endpoint).addQuery(name, values).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T replaceQueryParam(String name, Iterable<String> values) { endpoint = uriBuilder(endpoint).replaceQuery(name, values).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T replaceQueryParams(Multimap<String, String> parameters) { endpoint = uriBuilder(endpoint).replaceQuery(parameters).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T addQueryParam(String name, String... values) { endpoint = uriBuilder(endpoint).addQuery(name, values).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T addQueryParams(Multimap<String, String> parameters) { endpoint = uriBuilder(endpoint).addQuery(parameters).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T replaceQueryParams(Multimap<String, String> parameters) { endpoint = uriBuilder(endpoint).replaceQuery(parameters).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T addQueryParam(String name, Iterable<String> values) { endpoint = uriBuilder(endpoint).addQuery(name, values).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T addQueryParams(Multimap<String, String> parameters) { endpoint = uriBuilder(endpoint).addQuery(parameters).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T replaceQueryParam(String name, String... values) { endpoint = uriBuilder(endpoint).replaceQuery(name, values).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T replaceQueryParam(String name, String... values) { endpoint = uriBuilder(endpoint).replaceQuery(name, values).build(); return self(); }
/** * @see HttpRequest#getEndpoint() */ public T replaceQueryParams(Multimap<String, String> parameters) { endpoint = uriBuilder(endpoint).replaceQuery(parameters).build(); return self(); }