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

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

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

WebClient.to介绍

[英]Moves WebClient to a new baseURI or forwards to new currentURI
[中]将WebClient移动到新的baseURI或转发到新的currentURI

代码示例

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

private void initTargetClientIfNeeded(Map<String, Object> configProps) {
  URI uri = uriBuilder.build();
  if (targetClient == null) {
    JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
    bean.setAddress(uri.toString());
    Boolean threadSafe = getBooleanValue(configProps.get(THREAD_SAFE_CLIENT_PROP));
    if (threadSafe == null) {
      threadSafe = DEFAULT_THREAD_SAFETY_CLIENT_STATUS;
    }
    bean.setThreadSafe(threadSafe);
    if (threadSafe) {
      Integer cleanupPeriod = getIntValue(configProps.get(THREAD_SAFE_CLIENT_STATE_CLEANUP_PROP));
      if (cleanupPeriod == null) {
        cleanupPeriod = THREAD_SAFE_CLIENT_STATE_CLEANUP_PERIOD;
      }
      if (cleanupPeriod != null) {
        bean.setSecondsToKeepState(cleanupPeriod);
      }
    }
    targetClient = bean.createWebClient();
    ClientImpl.this.baseClients.add(targetClient);
  } else if (!targetClient.getCurrentURI().equals(uri)) {
    targetClient.to(uri.toString(), false);
  }
}

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

private void initTargetClientIfNeeded(Map<String, Object> configProps) {
  URI uri = uriBuilder.build();
  if (targetClient == null) {
    JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
    bean.setAddress(uri.toString());
    Boolean threadSafe = getBooleanValue(configProps.get(THREAD_SAFE_CLIENT_PROP));
    if (threadSafe == null) {
      threadSafe = DEFAULT_THREAD_SAFETY_CLIENT_STATUS;
    }
    bean.setThreadSafe(threadSafe);
    if (threadSafe) {
      Integer cleanupPeriod = getIntValue(configProps.get(THREAD_SAFE_CLIENT_STATE_CLEANUP_PROP));
      if (cleanupPeriod == null) {
        cleanupPeriod = THREAD_SAFE_CLIENT_STATE_CLEANUP_PERIOD;
      }
      if (cleanupPeriod != null) {
        bean.setSecondsToKeepState(cleanupPeriod);
      }
    }
    targetClient = bean.createWebClient();
    ClientImpl.this.baseClients.add(targetClient);
  } else if (!targetClient.getCurrentURI().equals(uri)) {
    targetClient.to(uri.toString(), false);
  }
}

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

authorizeClient.to(data.getReplyTo(), false);
if (authenticityCookie != null) {
  authorizeClient.header("Cookie", (String)authenticityCookie);

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

authorizeClient.to(data.getReplyTo(), false);
if (authenticityCookie != null) {
  authorizeClient.header("Cookie", (String)authenticityCookie);

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

protected static <E extends JAXRSService, T> T getObject(
    final E service, final URI location, final Class<T> resultClass) {
  WebClient webClient = WebClient.fromClient(WebClient.client(service));
  webClient.accept(SyncopeConsoleSession.get().getMediaType()).to(location.toASCIIString(), false);
  return webClient.
      header(RESTHeaders.DOMAIN, SyncopeConsoleSession.get().getDomain()).
      header(HttpHeaders.AUTHORIZATION, "Bearer " + SyncopeConsoleSession.get().getJWT()).
      get(resultClass);
}

相关文章

WebClient类方法