本文整理了Java中org.jclouds.http.HttpRequest.getEndpoint()
方法的一些代码示例,展示了HttpRequest.getEndpoint()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpRequest.getEndpoint()
方法的具体详情如下:
包路径:org.jclouds.http.HttpRequest
类名称:HttpRequest
方法名:getEndpoint
暂无
代码示例来源:origin: org.jclouds.common/openstack-common
@Override
public ParseAuthenticationResponseFromHeaders setContext(HttpRequest request) {
String host = request.getEndpoint().getHost();
return setHostToReplace(host);
}
代码示例来源:origin: io.cloudsoft.jclouds.api/rackspace-cloudloadbalancers
@Override
public ToPagedIterable setContext(HttpRequest request) {
String path = request.getEndpoint().getPath();
int lastSlash = path.lastIndexOf('/');
int secondLastSlash = path.lastIndexOf('/', lastSlash - 1);
lbId = Integer.valueOf(path.substring(secondLastSlash + 1, lastSlash));
return super.setContext(request);
}
代码示例来源:origin: Nextdoor/bender
@Override
public ParseObjectFromResponse setContext(HttpRequest request) {
this.uri = request.getEndpoint().toString();
this.name = GeneratedHttpRequest.class.cast(request).getInvocation().getArgs().get(0).toString();
return this;
}
}
代码示例来源:origin: jclouds/legacy-jclouds
public ParseSystemAndUserMetadataFromHeaders setContext(HttpRequest request) {
this.endpoint = request.getEndpoint();
checkArgument(request instanceof GeneratedHttpRequest, "note this handler requires a GeneratedHttpRequest");
return setName(getNameFor(GeneratedHttpRequest.class.cast(request)));
}
代码示例来源:origin: org.apache.jclouds.api/atmos
@Override
public ParseObjectFromHeadersAndHttpContent setContext(HttpRequest request) {
this.uri = request.getEndpoint();
return setPath(GeneratedHttpRequest.class.cast(request).getInvocation().getArgs().get(0).toString());
}
代码示例来源:origin: com.amysta.jclouds.api/atmos
@Override
public ParseObjectFromHeadersAndHttpContent setContext(HttpRequest request) {
this.uri = request.getEndpoint();
return setPath(GeneratedHttpRequest.class.cast(request).getInvocation().getArgs().get(0).toString());
}
代码示例来源:origin: Nextdoor/bender
@Override
public ParseObjectFromHeadersAndHttpContent setContext(HttpRequest request) {
this.uri = request.getEndpoint();
return setPath(GeneratedHttpRequest.class.cast(request).getInvocation().getArgs().get(0).toString());
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public ParseObjectFromHeadersAndHttpContent setContext(HttpRequest request) {
this.uri = request.getEndpoint();
return setPath(GeneratedHttpRequest.class.cast(request).getInvocation().getArgs().get(0).toString());
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
@SuppressWarnings("unchecked")
public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
checkNotNull(payload, "hostprefix");
checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
InternetDomainName name = from(request.getEndpoint().getHost()).child(payload.toString());
return (R) request.toBuilder().endpoint(uriBuilder(request.getEndpoint()).host(name.name()).build()).build();
}
}
代码示例来源:origin: org.jclouds/jclouds-core
@Override
@SuppressWarnings("unchecked")
public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
checkNotNull(payload, "hostprefix");
checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
InternetDomainName name = from(request.getEndpoint().getHost()).child(payload.toString());
return (R) request.toBuilder().endpoint(uriBuilder(request.getEndpoint()).host(name.name()).build()).build();
}
}
代码示例来源:origin: jclouds/legacy-jclouds
@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();
}
}
代码示例来源:origin: org.apache.jclouds/jclouds-compute
/**
* build a shell script that invokes the contents of the http request in bash.
*
* @return a shell script that will invoke the http request
*/
public static Statement execHttpResponse(HttpRequest request) {
return pipeHttpResponseToBash(request.getMethod(), request.getEndpoint(), request.getHeaders());
}
代码示例来源:origin: jclouds/legacy-jclouds
/**
* build a shell script that invokes the contents of the http request in bash.
*
* @return a shell script that will invoke the http request
*/
public static Statement extractTargzIntoDirectory(HttpRequest targz, String directory) {
return Statements
.extractTargzIntoDirectory(targz.getMethod(), targz.getEndpoint(), targz.getHeaders(), directory);
}
代码示例来源:origin: jclouds/legacy-jclouds
/**
* build a shell script that invokes the contents of the http request in bash.
*
* @return a shell script that will invoke the http request
*/
public static Statement execHttpResponse(HttpRequest request) {
return pipeHttpResponseToBash(request.getMethod(), request.getEndpoint(), request.getHeaders());
}
代码示例来源:origin: jclouds/legacy-jclouds
public HttpRequest filter(HttpRequest request) throws HttpException {
checkNotNull(request, "request must be present");
Multimap<String, String> decodedParams = queryParser().apply(request.getEndpoint().getRawQuery());
addSigningParams(decodedParams);
String stringToSign = createStringToSign(request, decodedParams);
String signature = sign(stringToSign);
addSignature(decodedParams, signature);
request = request.toBuilder().endpoint(uriBuilder(request.getEndpoint()).query(decodedParams).build()).build();
utils.logRequest(signatureLog, request, "<<");
return request;
}
代码示例来源:origin: jclouds/legacy-jclouds
private void assertConfigMakesPayload(Map<String, Object> config, String expectedPayload) {
BindNodeConfigurationToXmlPayload binder = injector.getInstance(BindNodeConfigurationToXmlPayload.class);
HttpRequest request = createMock(HttpRequest.class);
expect(request.getEndpoint()).andReturn(URI.create("http://localhost/key")).anyTimes();
request.setPayload(expectedPayload);
replay(request);
binder.bindToRequest(request, config);
verify(request);
}
代码示例来源:origin: apache/attic-whirr
@Override
public void save(Cluster cluster) throws IOException {
BlobStore store = context.getBlobStore();
Blob blob = store.blobBuilder(blobName).payload(serialize(cluster)).build();
store.putBlob(container, blob);
LOG.info("Saved cluster state to '{}' ", context.getSigner()
.signGetBlob(container, blobName).getEndpoint().toString());
}
代码示例来源:origin: com.amysta.jclouds/jclouds-blobstore
public static <T> HttpRequest cleanRequest(HttpRequest returnVal) {
checkNotNull(returnVal, "http request");
for (HttpRequestFilter filter : returnVal.getFilters())
returnVal = filter.filter(returnVal);
return HttpRequest.builder().method(returnVal.getMethod()).endpoint(returnVal.getEndpoint())
.headers(returnVal.getHeaders()).payload(returnVal.getPayload()).build();
}
代码示例来源:origin: io.cloudsoft.jclouds/jclouds-core
public T fromHttpRequest(HttpRequest in) {
return super.fromHttpMessage(in)
.method(in.getMethod())
.endpoint(in.getEndpoint())
.filters(in.getFilters());
}
}
代码示例来源:origin: Nextdoor/bender
public T fromHttpRequest(HttpRequest in) {
return super.fromHttpMessage(in)
.method(in.getMethod())
.endpoint(in.getEndpoint())
.filters(in.getFilters());
}
}
内容来源于网络,如有侵权,请联系作者删除!