Search in sources :

Example 1 with LinkedInOAuthRequestFilter

use of org.apache.camel.component.linkedin.api.LinkedInOAuthRequestFilter in project camel by apache.

the class LinkedInComponent method createRequestFilter.

private LinkedInOAuthRequestFilter createRequestFilter(LinkedInConfiguration configuration) {
    // validate configuration
    configuration.validate();
    final String[] enabledProtocols;
    try {
        // use default SSP to create supported non-SSL protocols list
        final SSLContext sslContext = new SSLContextParameters().createSSLContext(getCamelContext());
        enabledProtocols = sslContext.createSSLEngine().getEnabledProtocols();
    } catch (GeneralSecurityException e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    } catch (IOException e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }
    return new LinkedInOAuthRequestFilter(getOAuthParams(configuration), configuration.getHttpParams(), configuration.isLazyAuth(), enabledProtocols);
}
Also used : GeneralSecurityException(java.security.GeneralSecurityException) LinkedInOAuthRequestFilter(org.apache.camel.component.linkedin.api.LinkedInOAuthRequestFilter) SSLContext(javax.net.ssl.SSLContext) IOException(java.io.IOException) SSLContextParameters(org.apache.camel.util.jsse.SSLContextParameters)

Aggregations

IOException (java.io.IOException)1 GeneralSecurityException (java.security.GeneralSecurityException)1 SSLContext (javax.net.ssl.SSLContext)1 LinkedInOAuthRequestFilter (org.apache.camel.component.linkedin.api.LinkedInOAuthRequestFilter)1 SSLContextParameters (org.apache.camel.util.jsse.SSLContextParameters)1