/** * Get a new & initialized SSL configurator instance. * * The instance {@link #retrieve(java.util.Properties) retrieves} the initial configuration from * {@link System#getProperties() system properties}. * * @return new & initialized SSL configurator instance. */ public static SslConfigurator newInstance() { return new SslConfigurator(false); }
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * The default SSL configuration is initialized from system properties. This method is a shortcut * for {@link #getDefaultContext(boolean) getDefaultContext(true)}. * * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext() { return getDefaultContext(true); }
@Override public SSLContext get() { return sslConfiguratorCopy.createSSLContext(); } }),
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * If {@code readSystemProperties} parameter is set to {@code true}, the default SSL configuration * is initialized from system properties. * * @param readSystemProperties if {@code true}, the default SSL context will be initialized using * system properties. * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext(boolean readSystemProperties) { if (readSystemProperties) { return new SslConfigurator(true).createSSLContext(); } else { return DEFAULT_CONFIG_NO_PROPS.createSSLContext(); } }
@Override public boolean isRegistered(final Object component) { return commonConfig.getConfiguration().isRegistered(component); }
@Override public Map<String, Object> getProperties() { return commonConfig.getConfiguration().getProperties(); }
/** * Feature used to register Kryo providers. * * @author Libor Kramolis (libor.kramolis at oracle.com) */ @Beta public class KryoFeature implements Feature { @Override public boolean configure(final FeatureContext context) { final Configuration config = context.getConfiguration(); if (!config.isRegistered(KryoMessageBodyProvider.class)) { context.register(KryoMessageBodyProvider.class); } return true; } }
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * If {@code readSystemProperties} parameter is set to {@code true}, the default SSL configuration * is initialized from system properties. * * @param readSystemProperties if {@code true}, the default SSL context will be initialized using * system properties. * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext(boolean readSystemProperties) { if (readSystemProperties) { return new SslConfigurator(true).createSSLContext(); } else { return DEFAULT_CONFIG_NO_PROPS.createSSLContext(); } }
@Override public SSLContext get() { return sslConfiguratorCopy.createSSLContext(); } }),
@Override public SSLContext getDefaultSslContext() { return SslConfigurator.getDefaultContext(); } };
@Override public boolean isRegistered(final Object component) { return commonConfig.getConfiguration().isRegistered(component); }
/** * Create a copy of the current SSL configurator instance. * * @return copy of the current SSL configurator instance */ public SslConfigurator copy() { return new SslConfigurator(this); }
@Override public SSLContext get() { return sslConfiguratorCopy.createSSLContext(); } }),
@Override public SSLContext getDefaultSslContext() { return SslConfigurator.getDefaultContext(); } };
/** * Get a new SSL configurator instance. * * @param readSystemProperties if {@code true}, {@link #retrieve(java.util.Properties) Retrieves} * the initial configuration from {@link System#getProperties()}, * otherwise the instantiated configurator will be empty. * @return new SSL configurator instance. */ public static SslConfigurator newInstance(boolean readSystemProperties) { return new SslConfigurator(readSystemProperties); }
/** * Get a new instance of a {@link SSLContext} configured using default configuration settings. * * The default SSL configuration is initialized from system properties. This method is a shortcut * for {@link #getDefaultContext(boolean) getDefaultContext(true)}. * * @return new instance of a default SSL context initialized from system properties. */ public static SSLContext getDefaultContext() { return getDefaultContext(true); }
/** * Get a new SSL configurator instance. * * @param readSystemProperties if {@code true}, {@link #retrieve(java.util.Properties) Retrieves} * the initial configuration from {@link System#getProperties()}, * otherwise the instantiated configurator will be empty. * @return new SSL configurator instance. */ public static SslConfigurator newInstance(boolean readSystemProperties) { return new SslConfigurator(readSystemProperties); }
@Override public SSLContext getDefaultSslContext() { return SslConfigurator.getDefaultContext(); } };
/** * Create a copy of the current SSL configurator instance. * * @return copy of the current SSL configurator instance */ public SslConfigurator copy() { return new SslConfigurator(this); }
/** * Get a new & initialized SSL configurator instance. * * The instance {@link #retrieve(java.util.Properties) retrieves} the initial configuration from * {@link System#getProperties() system properties}. * * @return new & initialized SSL configurator instance. */ public static SslConfigurator newInstance() { return new SslConfigurator(false); }