Search in sources :

Example 1 with DateParamConverterProvider

use of org.apache.syncope.common.rest.api.DateParamConverterProvider in project syncope by apache.

the class SyncopeClientFactoryBean method defaultRestClientFactoryBean.

protected JAXRSClientFactoryBean defaultRestClientFactoryBean() {
    JAXRSClientFactoryBean defaultRestClientFactoryBean = new JAXRSClientFactoryBean();
    defaultRestClientFactoryBean.setHeaders(new HashMap<>());
    if (StringUtils.isBlank(address)) {
        throw new IllegalArgumentException("Property 'address' is missing");
    }
    defaultRestClientFactoryBean.setAddress(address);
    if (StringUtils.isNotBlank(domain)) {
        defaultRestClientFactoryBean.getHeaders().put(RESTHeaders.DOMAIN, Collections.singletonList(domain));
    }
    defaultRestClientFactoryBean.setThreadSafe(true);
    defaultRestClientFactoryBean.setInheritHeaders(true);
    List<Feature> features = new ArrayList<>();
    features.add(new LoggingFeature());
    defaultRestClientFactoryBean.setFeatures(features);
    List<Object> providers = new ArrayList<>(4);
    providers.add(new DateParamConverterProvider());
    providers.add(getJaxbProvider());
    providers.add(getJsonProvider());
    providers.add(getExceptionMapper());
    defaultRestClientFactoryBean.setProviders(providers);
    return defaultRestClientFactoryBean;
}
Also used : DateParamConverterProvider(org.apache.syncope.common.rest.api.DateParamConverterProvider) JAXRSClientFactoryBean(org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean) LoggingFeature(org.apache.cxf.ext.logging.LoggingFeature) ArrayList(java.util.ArrayList) Feature(org.apache.cxf.feature.Feature) LoggingFeature(org.apache.cxf.ext.logging.LoggingFeature)

Aggregations

ArrayList (java.util.ArrayList)1 LoggingFeature (org.apache.cxf.ext.logging.LoggingFeature)1 Feature (org.apache.cxf.feature.Feature)1 JAXRSClientFactoryBean (org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean)1 DateParamConverterProvider (org.apache.syncope.common.rest.api.DateParamConverterProvider)1