flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestServerEndpointConfiguration.java
/**
	 * Creates and returns a new {@link RestServerEndpointConfiguration} from the given {@link Configuration}.
	 *
	 * @param config configuration from which the REST server endpoint configuration should be created from
	 * @return REST server endpoint configuration
	 * @throws ConfigurationException if SSL was configured incorrectly
	 */
Creates and returns a new  RestServerEndpointConfiguration from the given  Configuration.
@param config configuration from which the REST server endpoint configuration should be created from
@return REST server endpoint configuration
@throws ConfigurationException if SSL was configured incorrectly
Creates and returns a new RestServerEndpointConfiguration from the given Configuration . @param config configuration from which the REST server endpoint configuration should be created from @return REST server endpoint configuration @throws ConfigurationException if SSL was configured incorrectly
public static RestServerEndpointConfiguration fromConfiguration(Configuration config) throws ConfigurationException {
		Preconditions.checkNotNull(config);
		String address = config.getString(RestOptions.REST_ADDRESS);
		int port = config.getInteger(RestOptions.REST_PORT);
		SSLEngine sslEngine = null;
		boolean enableSSL = config.getBoolean(SecurityOptions.SSL_ENABLED);
		if (enableSSL) {
			try {
				SSLContext sslContext = SSLUtils.createSSLServerContext(config);
				if (sslContext != null) {
					sslEngine = sslContext.createSSLEngine();
					SSLUtils.setSSLVerAndCipherSuites(sslEngine, config);
					sslEngine.setUseClientMode(false);
				}
			} catch (Exception e) {
				throw new ConfigurationException("Failed to initialize SSLContext for REST server endpoint.", e);
			}
		}
		return new RestServerEndpointConfiguration(address, port, sslEngine);
	}
public static RestServerEndpointConfiguration fromConfiguration ( Configuration config ) throws ConfigurationException { Preconditions . checkNotNull ( config ) ; String address = config . getString ( RestOptions . REST_ADDRESS ) ; int port = config . getInteger ( RestOptions . REST_PORT ) ; SSLEngine sslEngine = null ; boolean enableSSL = config . getBoolean ( SecurityOptions . SSL_ENABLED ) ; if ( enableSSL ) { try { SSLContext sslContext = SSLUtils . createSSLServerContext ( config ) ; if ( sslContext != null ) { sslEngine = sslContext . createSSLEngine ( ) ; SSLUtils . setSSLVerAndCipherSuites ( sslEngine , config ) ; sslEngine . setUseClientMode ( false ) ; } } catch ( Exception e ) { throw new ConfigurationException ( "Failed to initialize SSLContext for REST server endpoint." , e ) ; } } return new RestServerEndpointConfiguration ( address , port , sslEngine ) ; }
Creates and returns a new {@link RestServerEndpointConfiguration} from the given {@link Configuration}.
Creates and returns a new { @link RestServerEndpointConfiguration } from the given { @link Configuration } .