org.apache.cxf.jaxrs.client.WebClient.back()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.apache.cxf.jaxrs.client.WebClient.back()方法的一些代码示例,展示了WebClient.back()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.back()方法的具体详情如下:
包路径:org.apache.cxf.jaxrs.client.WebClient
类名称:WebClient
方法名:back

WebClient.back介绍

[英]Goes back
[中]追溯到

代码示例

代码示例来源:origin: apache/cxf

/**
 * Replaces the current path with the new value.
 * @param path new path value. If it starts from "/" then all the current
 * path starting from the base URI will be replaced, otherwise only the
 * last path segment will be replaced. Providing a null value is equivalent
 * to calling back(true)
 * @return updated WebClient
 */
public WebClient replacePath(String path) {
  if (path == null) {
    return back(true);
  }
  back(path.startsWith("/") ? true : false);
  return path(path);
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

/**
 * Replaces the current path with the new value.
 * @param path new path value. If it starts from "/" then all the current
 * path starting from the base URI will be replaced, otherwise only the 
 * last path segment will be replaced. Providing a null value is equivalent
 * to calling back(true)  
 * @return updated WebClient
 */
public WebClient replacePath(String path) {
  if (path == null) {
    return back(true);
  }
  back(path.startsWith("/") ? true : false);
  return path(path);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-client

/**
 * Replaces the current path with the new value.
 * @param path new path value. If it starts from "/" then all the current
 * path starting from the base URI will be replaced, otherwise only the
 * last path segment will be replaced. Providing a null value is equivalent
 * to calling back(true)
 * @return updated WebClient
 */
public WebClient replacePath(String path) {
  if (path == null) {
    return back(true);
  }
  back(path.startsWith("/") ? true : false);
  return path(path);
}

代码示例来源:origin: Talend/tesb-rt-se

public void runCodeWebClient() throws Exception {
  System.out.println("*** Running WebClient initialized from the code ***");
  JAXRSClientFactoryBean factoryBean = prepareFactoryBean();
  WebClient wc = factoryBean.createWebClient();
  wc.accept("application/xml"); 

  String orderId = "1";
  for (int i = 1; i <= 3; i++) {
    wc.path("orderservice").path(orderId); 
    Order ord = wc.get(Order.class);
    describeOrder(i, ord);
wc.back(true);
  Thread.sleep(2000);
  } 
}

代码示例来源:origin: Talend/tesb-rt-se

wc.back(false);
wc.back(false).path("father");
getPerson(wc);
wc.back(false).path("partner");
getPerson(wc);
wc.back(false).path("descendants");
getPersons(wc);
wc.back(false).path("children");
getPersons(wc);
wc.back(false);
wc.back(false);

代码示例来源:origin: apache/cxf

private void invoke(int ind) throws Exception {
  client.type("text/plain").accept("text/plain");
  String actualHeaderName = bookHeader + ind;
  String actualBookName = bookName + ind;
  MultivaluedMap<String, String> map = client.getHeaders();
  map.putSingle("CustomHeader", actualHeaderName);
  client.headers(map).path("booksecho");
  doInvoke(actualBookName, actualHeaderName);
  // reset current path
  client.back(true);
}

代码示例来源:origin: apache/cxf

@Test
public void testGetBook123WebClientToProxy() throws Exception {
  WebClient wc = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE1);
  wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
  Book b = wc.get(Book.class);
  assertEquals(123, b.getId());
  wc.back(true);
  BookStore bs = JAXRSClientFactory.fromClient(wc, BookStore.class);
  Book b2 = bs.getSecureBook("123");
  assertEquals(b2.getId(), 123);
}

相关文章

WebClient类方法