本文整理汇总了Java中org.springframework.social.support.ClientHttpRequestFactorySelector类的典型用法代码示例。如果您正苦于以下问题:Java ClientHttpRequestFactorySelector类的具体用法?Java ClientHttpRequestFactorySelector怎么用?Java ClientHttpRequestFactorySelector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientHttpRequestFactorySelector类属于org.springframework.social.support包,在下文中一共展示了ClientHttpRequestFactorySelector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setRequestFactory
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
@Override
public void setRequestFactory(ClientHttpRequestFactory requestFactory)
{
// Wrap the request factory with a BufferingClientHttpRequestFactory so
// that the error handler can do repeat reads on the response.getBody()
super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(requestFactory));
}
示例2: initialize
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
private void initialize()
{
// Wrap the request factory with a BufferingClientHttpRequestFactory so
// that the error handler can do repeat reads on the response.getBody()
super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(getRestTemplate().getRequestFactory()));
initSubApis();
}
示例3: initialize
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
private void initialize(String clientId, String accessToken, String guid) {
// Wrap the request factory with a BufferingClientHttpRequestFactory so
// that the error handler can do repeat reads on the response.getBody()
super.setRequestFactory(ClientHttpRequestFactorySelector
.bufferRequests(getRestTemplate().getRequestFactory()));
initSubApis(clientId, accessToken, guid);
}
示例4: initialize
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
private void initialize(String apiBaseUrl, String accessToken) {
// Wrap the request factory with a BufferingClientHttpRequestFactory so
// that the error handler can do repeat reads on the response.getBody()
super.setRequestFactory(ClientHttpRequestFactorySelector
.bufferRequests(getRestTemplate().getRequestFactory()));
initSubApis(apiBaseUrl, accessToken);
}
示例5: NaverOAuth2ApiBinding
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
public NaverOAuth2ApiBinding(final String accessToken) {
super(accessToken);
super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(getRestTemplate().getRequestFactory()));
// set interceptors
getRestTemplate().setInterceptors(Arrays.asList(new ClientHttpRequestInterceptor[]{new AdminKeyHeaderOAuth2RequestInterceptor(accessToken)}));
// set xml->class http message converters
getRestTemplate().setMessageConverters(Arrays.asList(new HttpMessageConverter<?>[]{new Jaxb2RootElementHttpMessageConverter()}));
// init api operations
userOperation = new UserOperationImpl(getRestTemplate(), isAuthorized());
}
示例6: initialize
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
private void initialize()
{
getRestTemplate().setErrorHandler(new FlickrErrorHandler());
// Wrap the request factory with a BufferingClientHttpRequestFactory so
// that the error handler can do repeat reads on the response.getBody()
super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(getRestTemplate().getRequestFactory()));
initSubApis();
}
示例7: createRestTemplate
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
@Override
protected RestTemplate createRestTemplate() {
ClientHttpRequestFactory requestFactory = ClientHttpRequestFactorySelector.getRequestFactory();
RestTemplate restTemplate = new RestTemplate(requestFactory);
List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>(2);
StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
stringHttpMessageConverter.setSupportedMediaTypes(Arrays.asList(MediaType.APPLICATION_FORM_URLENCODED));
converters.add(stringHttpMessageConverter);
restTemplate.setMessageConverters(converters);
return restTemplate;
}
示例8: createRestTemplateWithCulledMessageConverters
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
protected RestTemplate createRestTemplateWithCulledMessageConverters() {
// need to buffer the response in order to check the response was error or not.
// if slideshare returns error, http status is 200 and contents is error xml.
ClientHttpRequestFactory requestFactory = ClientHttpRequestFactorySelector.getRequestFactory();
ClientHttpRequestFactory bufferedRequestFactory = ClientHttpRequestFactorySelector.bufferRequests(requestFactory);
List<HttpMessageConverter<?>> messageConverters = getMessageConverters();
RestTemplate client = new RestTemplate(messageConverters);
client.setRequestFactory(bufferedRequestFactory);
return client;
}
示例9: PlusImpl
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
public PlusImpl(String accessToken, GooglePlusConfiguration config, OAuth2RefreshCallback refreshCallback) {
super(accessToken);
// (doing work in constructor because the superclass does it that forces us to do it)
configure(config);
// Wrap the request factory with a BufferingClientHttpRequestFactory so
// that the error handler can do repeat reads on the response.getBody()
ClientHttpRequestFactory requestFactory = ClientHttpRequestFactorySelector
.bufferRequests(getRestTemplate().getRequestFactory());
requestFactory = new TokenRefreshingClientHttpRequestFactory(requestFactory, refreshCallback, getRestTemplate().getInterceptors());
getRestTemplate().setRequestFactory(requestFactory);
}
示例10: DirectLineTemplate
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
public DirectLineTemplate(String accessToken) {
super(accessToken);
super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(getRestTemplate().getRequestFactory()));
this.tokenOperations = new TokenTemplate(getRestTemplate());
this.conversationOperations = new ConversationTemplate(getRestTemplate());
}
示例11: initialize
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
private void initialize() {
super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(getRestTemplate().getRequestFactory()));
initSubApis();
}
示例12: setRequestFactory
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
@Override
public void setRequestFactory(final ClientHttpRequestFactory requestFactory) {
super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(requestFactory));
}
示例13: setRequestFactory
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
@Override
public void setRequestFactory(ClientHttpRequestFactory requestFactory) {
// Wrap the request factory with a BufferingClientHttpRequestFactory so that the error handler can do repeat reads on the response.getBody()
super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(requestFactory));
}
示例14: initialize
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
private void initialize() {
// Wrap the request factory with a BufferingClientHttpRequestFactory so that the error handler can do repeat reads on the response.getBody()
super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(getRestTemplate().getRequestFactory()));
initSubApis();
}
示例15: initialize
import org.springframework.social.support.ClientHttpRequestFactorySelector; //导入依赖的package包/类
/**
* private helpers.
*/
private void initialize() {
super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(getRestTemplate().getRequestFactory()));
initSubApis();
}