Search in sources :

Example 1 with DevJerseyClientConfig

use of org.orcid.util.DevJerseyClientConfig in project ORCID-Source by ORCID.

the class OrcidJerseyClientHandler method create.

public static Client create(boolean isDevelopmentMode, Map<String, Object> properties) {
    ClientConfig config = null;
    if (isDevelopmentMode) {
        // DANGER!!! Trust all certs
        LOGGER.info("TRUSTING ALL SSL CERTS IN DEV MODE!!!");
        config = new DevJerseyClientConfig();
    } else {
        config = new DefaultClientConfig();
    }
    Set<String> keyset = properties.keySet();
    for (String key : keyset) {
        config.getProperties().put(key, properties.get(key));
    }
    config.getClasses().add(JacksonJaxbJsonProvider.class);
    return Client.create(config);
}
Also used : DefaultClientConfig(com.sun.jersey.api.client.config.DefaultClientConfig) DevJerseyClientConfig(org.orcid.util.DevJerseyClientConfig) DevJerseyClientConfig(org.orcid.util.DevJerseyClientConfig) DefaultClientConfig(com.sun.jersey.api.client.config.DefaultClientConfig) ClientConfig(com.sun.jersey.api.client.config.ClientConfig)

Aggregations

ClientConfig (com.sun.jersey.api.client.config.ClientConfig)1 DefaultClientConfig (com.sun.jersey.api.client.config.DefaultClientConfig)1 DevJerseyClientConfig (org.orcid.util.DevJerseyClientConfig)1