本文整理了Java中org.apache.cxf.jaxrs.client.WebClient.reset()
方法的一些代码示例,展示了WebClient.reset()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.reset()
方法的具体详情如下:
包路径:org.apache.cxf.jaxrs.client.WebClient
类名称:WebClient
方法名:reset
[英]Resets the current query
[中]重置当前查询
代码示例来源:origin: com.tomitribe.tribestream/tribestream-container
@CacheResult
public String findCountry(final String ip) {
Objects.requireNonNull(ip, "FreeGeoIp service can't resolve a country for a null IP.");
for (int i = 0; i < 2; i++) {
try {
final Response response = webClient.reset()
.path(ip)
.query("access_key", "d01f0ef8992202ca4f8ccb468e2126a2")
.accept(MediaType.APPLICATION_JSON_TYPE)
.get(Response.class);
if (response == null) { // not 100% sure it can happen but it does, that's why we have a small retry mechanism
try {
sleep(100);
} catch (final InterruptedException e) {
Thread.interrupted();
return null;
}
continue;
}
return response.getCountry_name();
} catch (final UncheckedException | WebApplicationException | ClientWebApplicationException/*no net*/ e) {
return null;
}
}
return null;
}
代码示例来源:origin: org.talend.esb.auxiliary.storage/auxiliary-storage-client-rest
|| e instanceof ProcessingException)) {
if (null != client) {
client.reset();
} finally {
if (null != client) {
client.reset();
代码示例来源:origin: Talend/tesb-rt-se
|| e instanceof ProcessingException)) {
if (null != client) {
client.reset();
} finally {
if (null != client) {
client.reset();
代码示例来源:origin: org.talend.esb.auxiliary.storage/auxiliary-storage-client-rest
|| e instanceof ProcessingException)) {
if (null != client) {
client.reset();
} finally {
if (null != client) {
client.reset();
代码示例来源:origin: Talend/tesb-rt-se
|| e instanceof ProcessingException)) {
if (null != client) {
client.reset();
} finally {
if (null != client) {
client.reset();
代码示例来源:origin: Talend/tesb-rt-se
p.setName("Bob");
p.setAge(p.getAge() == 40 ? 30 : 40);
resp = wc.reset().type("application/xml").path("1").put(p);
p = getMember(1);
newMember.setName("Harry");
newMember.setAge(30);
resp = wc.reset().type("application/xml").post(newMember);
wc.reset();
getAllMembers(wc);
代码示例来源:origin: org.talend.esb.auxiliary.storage/auxiliary-storage-client-rest
client.reset();
|| e instanceof ProcessingException)) {
if (null != client) {
client.reset();
} finally {
if (null != client) {
client.reset();
代码示例来源:origin: Talend/tesb-rt-se
client.reset();
|| e instanceof ProcessingException)) {
if (null != client) {
client.reset();
} finally {
if (null != client) {
client.reset();
代码示例来源:origin: Talend/tesb-rt-se
authorizeClient.reset();
authorizeClient.to(data.getReplyTo(), false);
if (authenticityCookie != null) {
代码示例来源:origin: Talend/tesb-rt-se
authorizeClient.reset();
authorizeClient.to(data.getReplyTo(), false);
if (authenticityCookie != null) {
代码示例来源:origin: Talend/tesb-rt-se
wc.reset().accept(MediaType.APPLICATION_JSON);
for (Person person : persons) {
wc.reset().accept(MediaType.APPLICATION_XML);
wc.path("4");
getPerson(wc);
wc.reset().accept(MediaType.APPLICATION_XML);
wc.path("4");
wc.reset().accept(MediaType.APPLICATION_XML).type(MediaType.APPLICATION_XML);
Response response = wc.path("4").path("children").post(child);
wc.reset().path("find").accept(MediaType.APPLICATION_XML);
WebClient.getConfig(wc).getRequestContext().put("use.async.http.conduit",
true);
String patch = wc.reset().invoke("PATCH", null, String.class);
System.out.println("Patch: " + patch);
代码示例来源:origin: Talend/tesb-rt-se
wc.reset().accept(MediaType.APPLICATION_XML);
wc.path("personinfo");
代码示例来源:origin: apache/cxf
@org.junit.Test
public void testRegisterClientInitialAccessTokenCodeGrant() throws Exception {
URL busFile = OIDCDynamicRegistrationTest.class.getResource("client.xml");
String address = "https://localhost:" + PORT + "/services/dynamicWithAt/register";
WebClient wc = WebClient.create(address, Collections.singletonList(new JsonMapObjectProvider()),
busFile.toString());
wc.accept("application/json").type("application/json");
ClientRegistration reg = newClientRegistrationCodeGrant();
ClientRegistrationResponse resp = null;
assertEquals(401, wc.post(reg).getStatus());
wc.authorization(new ClientAccessToken("Bearer", "123456789"));
resp = wc.post(reg, ClientRegistrationResponse.class);
assertNotNull(resp.getClientId());
assertNotNull(resp.getClientSecret());
assertEquals(address + "/" + resp.getClientId(),
resp.getRegistrationClientUri());
String regAccessToken = resp.getRegistrationAccessToken();
assertNotNull(regAccessToken);
wc.reset();
wc.path(resp.getClientId());
assertEquals(401, wc.get().getStatus());
wc.authorization(new ClientAccessToken("Bearer", regAccessToken));
ClientRegistration clientRegResp = wc.get(ClientRegistration.class);
testCommonRegCodeGrantProperties(clientRegResp);
assertNull(clientRegResp.getTokenEndpointAuthMethod());
assertEquals(200, wc.delete().getStatus());
}
代码示例来源:origin: apache/cxf
assertNotNull(regAccessToken);
wc.reset();
wc.path(resp.getClientId());
assertEquals(401, wc.get().getStatus());
代码示例来源:origin: apache/cxf
assertNotNull(regAccessToken);
wc.reset();
wc.path(resp.getClientId());
代码示例来源:origin: apache/cxf
assertNotNull(regAccessToken);
wc.reset();
wc.path(resp.getClientId());
内容来源于网络,如有侵权,请联系作者删除!