本文整理了Java中org.restlet.Request.<init>
方法的一些代码示例,展示了Request.<init>
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.<init>
方法的具体详情如下:
包路径:org.restlet.Request
类名称:Request
方法名:<init>
[英]Constructor.
[中]建造师。
代码示例来源:origin: uber/chaperone
public Request getTopicDeleteRequestUrl(String topic) {
String requestUrl = StringUtils.join(new String[] {
_baseUrl, "/topics/", topic
});
Request request = new Request(Method.DELETE, requestUrl);
return request;
}
代码示例来源:origin: uber/chaperone
public Request getTopicExternalViewRequestUrl(String topic) {
String requestUrl = StringUtils.join(new String[] {
_baseUrl, "/topics/", topic
});
Request request = new Request(Method.GET, requestUrl);
return request;
}
代码示例来源:origin: uber/chaperone
public Request getTopicCreationRequestUrl(String topic, int numPartitions) {
Request request = new Request(Method.POST, _baseUrl + "/topics/");
TopicPartition topicPartitionInfo = new TopicPartition(topic, numPartitions);
request.setEntity(topicPartitionInfo.toJSON().toJSONString(), MediaType.APPLICATION_JSON);
return request;
}
代码示例来源:origin: uber/chaperone
public Request getTopicExpansionRequestUrl(String topic, int numPartitions) {
Request request = new Request(Method.PUT, _baseUrl + "/topics/");
TopicPartition topicPartitionInfo = new TopicPartition(topic, numPartitions);
request.setEntity(topicPartitionInfo.toJSON().toJSONString(), MediaType.APPLICATION_JSON);
return request;
}
}
代码示例来源:origin: uber/uReplicator
public Request getTopicDeleteRequestUrl(String topic, String src, String dst) {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/topics/", topic, "?src=", src, "&dst=", dst
});
Request request = new Request(Method.DELETE, requestUrl);
return request;
}
代码示例来源:origin: uber/uReplicator
public Request getTopicExternalViewRequestUrl(String topic) {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/topics/", topic
});
Request request = new Request(Method.GET, requestUrl);
return request;
}
代码示例来源:origin: uber/uReplicator
public Request getTopicDeleteRequestUrl(String topic, String src, String dst) {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/topics/", topic, "?src=", src, "&dst=", dst
});
Request request = new Request(Method.DELETE, requestUrl);
return request;
}
代码示例来源:origin: uber/uReplicator
public Request getTopicCreationRequestUrl(String topic, String src, String dst) {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/topics/", topic, "?src=", src, "&dst=", dst
});
Request request = new Request(Method.POST, requestUrl);
return request;
}
代码示例来源:origin: uber/uReplicator
public Request postSetControllerRebalance(String srcCluster, String dstCluster, boolean enabled) {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/admin/controller_autobalance?srcCluster="+ srcCluster + "&dstCluster=" + dstCluster
+ "&enabled=" + enabled
});
Request request = new Request(Method.POST, requestUrl);
return request;
}
public Request getControllerRebalanceStatus() {
代码示例来源:origin: uber/uReplicator
public Request getHealthCheck() {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/health"
});
Request request = new Request(Method.GET, requestUrl);
return request;
}
代码示例来源:origin: uber/uReplicator
public Request getControllerRebalanceStatus() {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/admin/controller_autobalance"
});
Request request = new Request(Method.GET, requestUrl);
return request;
}
public Request postSetControllerRebalance(boolean enabled) {
代码示例来源:origin: uber/uReplicator
public Request getHealthCheck() {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/health"
});
Request request = new Request(Method.GET, requestUrl);
return request;
}
代码示例来源:origin: uber/uReplicator
public Request getTopicExternalViewRequestUrl(String topic) {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/topics/", topic
});
Request request = new Request(Method.GET, requestUrl);
return request;
}
代码示例来源:origin: uber/uReplicator
public Request getTopicExternalViewRequestUrl(String topic) {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/topics/", topic
});
Request request = new Request(Method.GET, requestUrl);
return request;
}
代码示例来源:origin: uber/uReplicator
public Request getTopicExpansionRequestUrl(String topic, String src, String dst, int numPartitions) {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/topics/", topic, "?src=", src, "&dst=", dst, "&partitions=", String.valueOf(numPartitions)
});
Request request = new Request(Method.PUT, requestUrl);
return request;
}
public Request postSetControllerRebalance(String srcCluster, String dstCluster, boolean enabled) {
代码示例来源:origin: uber/uReplicator
public Request postInstanceRebalance(Boolean status) {
String requestUrl = StringUtils.join(new String[]{
_baseUrl, "/admin?forceRebalance="+ status.toString()
});
Request request = new Request(Method.POST, requestUrl);
return request;
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.atom
/**
* Deletes a resource.
*
* @param uri
* The resource URI.
* @return The result status.
*/
public Status deleteResource(String uri) {
return getClientDispatcher().handle(new Request(Method.DELETE, uri))
.getStatus();
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.atom
/**
* Retrieves a resource representation.
*
* @param uri
* The resource URI.
* @return The resource representation.
*/
public Representation getResource(String uri) {
return getClientDispatcher().handle(new Request(Method.GET, uri))
.getEntity();
}
代码示例来源:origin: uber/uReplicator
public Request getTopicExpansionRequestUrl(String topic, int numPartitions) {
Request request = new Request(Method.PUT, _baseUrl + "/topics/");
TopicPartition topicPartitionInfo = new TopicPartition(topic, numPartitions);
request.setEntity(topicPartitionInfo.toJSON().toJSONString(), MediaType.APPLICATION_JSON);
return request;
}
}
代码示例来源:origin: uber/uReplicator
public Request getTopicCreationRequestUrl(String topic, int numPartitions) {
Request request = new Request(Method.POST, _baseUrl + "/topics/");
TopicPartition topicPartitionInfo = new TopicPartition(topic, numPartitions);
request.setEntity(topicPartitionInfo.toJSON().toJSONString(), MediaType.APPLICATION_JSON);
return request;
}
内容来源于网络,如有侵权,请联系作者删除!