当前位置: 首页>>代码示例>>Java>>正文


Java JerseyClient.target方法代码示例

本文整理汇总了Java中org.glassfish.jersey.client.JerseyClient.target方法的典型用法代码示例。如果您正苦于以下问题:Java JerseyClient.target方法的具体用法?Java JerseyClient.target怎么用?Java JerseyClient.target使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.glassfish.jersey.client.JerseyClient的用法示例。


在下文中一共展示了JerseyClient.target方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import org.glassfish.jersey.client.JerseyClient; //导入方法依赖的package包/类
public <RootResponse> Response<RootResponse> create(@NonNull String url, @NonNull Class<RootResponse> clazz,
		ClientConfiguration clientConfigurationOrNull) {
	Optional<ClientConfiguration> clientConfiguration = Optional.ofNullable(clientConfigurationOrNull);
	JerseyClient newClient = jerseyClientBuilder.register(SseFeature.class).withConfig(clientConfig).build();
	newClient.register(LastEventIdHeaderFilter.class);

	if (clientConfigurationOrNull != null && !Strings.isNullOrEmpty(clientConfigurationOrNull.getAuthorization())) {
		newClient.register(new AuthHeaderFilter(clientConfigurationOrNull.getAuthorization()));
	}

	MediaType mediaType = clientConfiguration.map(c -> c.getMediaType()).orElse(MediaType.APPLICATION_JSON_TYPE);

	ResponseBuilder responseBuilder = new ResponseBuilder(newClient, objectMapper, mediaType);
	JerseyWebTarget webTarget = newClient.target(url);
	Builder requestBuilder = webTarget.request(mediaType);
	String readEntity = requestBuilder.get().readEntity(String.class);
	return responseBuilder.buildResponse(readEntity, clazz, URI.create(url)).get();
}
 
开发者ID:Mercateo,项目名称:rest-hateoas-client,代码行数:19,代码来源:ClientStarter.java

示例2: setUp

import org.glassfish.jersey.client.JerseyClient; //导入方法依赖的package包/类
@Before
public void setUp() {
    baseUrl = format("http://localhost:%d", port);
    final JerseyClient client = JerseyClientBuilder.createClient();
    client.property(ClientProperties.FOLLOW_REDIRECTS, false);
    target = client.target(baseUrl + "/stormpath");
}
 
开发者ID:shiver-me-timbers,项目名称:smt-spring-security-parent,代码行数:8,代码来源:ITSpringSecurityStormpathApplicationHref.java

示例3: setUp

import org.glassfish.jersey.client.JerseyClient; //导入方法依赖的package包/类
@Before
public void setUp() {
    baseUrl = format("http://localhost:%d", port);
    final JerseyClient client = JerseyClientBuilder.createClient();
    client.property(ClientProperties.FOLLOW_REDIRECTS, false);
    target = client.target(baseUrl + "/all");
}
 
开发者ID:shiver-me-timbers,项目名称:smt-spring-security-parent,代码行数:8,代码来源:AbstractSpringSecurityAll.java

示例4: setUp

import org.glassfish.jersey.client.JerseyClient; //导入方法依赖的package包/类
@Before
public void setUp() {
    final JerseyClient client = JerseyClientBuilder.createClient();
    client.property(ClientProperties.FOLLOW_REDIRECTS, false);
    annotationTarget = client.target(format("http://localhost:%d/jwt", port));
    normalTarget = client.target(format("http://localhost:%d/normal", port));
}
 
开发者ID:shiver-me-timbers,项目名称:smt-spring-security-parent,代码行数:8,代码来源:AbstractSpringSecurityJwtAnnotation.java

示例5: setUp

import org.glassfish.jersey.client.JerseyClient; //导入方法依赖的package包/类
@Before
public void setUp() {
    final JerseyClient client = JerseyClientBuilder.createClient();
    client.property(ClientProperties.FOLLOW_REDIRECTS, false);
    annotationTarget = client.target(format("http://localhost:%d/custom", port));
}
 
开发者ID:shiver-me-timbers,项目名称:smt-spring-security-parent,代码行数:7,代码来源:AbstractJwtCustomPrinciple.java


注:本文中的org.glassfish.jersey.client.JerseyClient.target方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。