當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpConfiguration.setSendDateHeader方法代碼示例

本文整理匯總了Java中org.eclipse.jetty.server.HttpConfiguration.setSendDateHeader方法的典型用法代碼示例。如果您正苦於以下問題:Java HttpConfiguration.setSendDateHeader方法的具體用法?Java HttpConfiguration.setSendDateHeader怎麽用?Java HttpConfiguration.setSendDateHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jetty.server.HttpConfiguration的用法示例。


在下文中一共展示了HttpConfiguration.setSendDateHeader方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: newHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
public HttpConfiguration newHttpConfiguration() {

        // HTTP Configuration
        
        boolean sendServerVersion = Boolean.parseBoolean(
                System.getProperty(AthenzConsts.ATHENZ_PROP_SEND_SERVER_VERSION, "false"));
        boolean sendDateHeader = Boolean.parseBoolean(
                System.getProperty(AthenzConsts.ATHENZ_PROP_SEND_DATE_HEADER, "false"));
        int outputBufferSize = Integer.parseInt(
                System.getProperty(AthenzConsts.ATHENZ_PROP_OUTPUT_BUFFER_SIZE, "32768"));
        int requestHeaderSize = Integer.parseInt(
                System.getProperty(AthenzConsts.ATHENZ_PROP_REQUEST_HEADER_SIZE, "8192"));
        int responseHeaderSize = Integer.parseInt(
                System.getProperty(AthenzConsts.ATHENZ_PROP_RESPONSE_HEADER_SIZE, "8192"));
        
        HttpConfiguration httpConfig = new HttpConfiguration();
        
        httpConfig.setOutputBufferSize(outputBufferSize);
        httpConfig.setRequestHeaderSize(requestHeaderSize);
        httpConfig.setResponseHeaderSize(responseHeaderSize);
        httpConfig.setSendServerVersion(sendServerVersion);
        httpConfig.setSendDateHeader(sendDateHeader);

        return httpConfig;
    }
 
開發者ID:yahoo,項目名稱:athenz,代碼行數:26,代碼來源:AthenzJettyContainer.java

示例2: buildHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
protected HttpConfiguration buildHttpConfiguration() {

        HttpConfiguration httpConfig = new HttpConfiguration();

        // most parameters are hardcoded for now... we should turn these
        // into properties

        httpConfig.setHeaderCacheSize(512);
        httpConfig.setOutputBufferSize(32 * 1024);
        httpConfig.setRequestHeaderSize(requestHeaderSize);
        httpConfig.setResponseHeaderSize(responseHeaderSize);
        httpConfig.setSendDateHeader(true);
        httpConfig.setSendServerVersion(true);

        httpConfig.addCustomizer(new ForwardedRequestCustomizer());

        return httpConfig;
    }
 
開發者ID:bootique,項目名稱:bootique-jetty,代碼行數:19,代碼來源:ConnectorFactory.java

示例3: generateJettyHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
private HttpConfiguration generateJettyHttpConfiguration( ConnectorConfiguration theConfiguration ) {
	HttpConfiguration httpConfiguration = new HttpConfiguration();

	if( theConfiguration.getHeaderCacheSize( ) != null ) {
		httpConfiguration.setHeaderCacheSize( theConfiguration.getHeaderCacheSize( ) );
	}
	if( theConfiguration.getRequestHeaderSize( ) != null ) {
		httpConfiguration.setRequestHeaderSize( theConfiguration.getRequestHeaderSize( ) );
	}
	if( theConfiguration.getResponseHeaderSize( ) != null ) {
		httpConfiguration.setResponseHeaderSize( theConfiguration.getResponseHeaderSize( ) );
	}
	if( theConfiguration.getOutputBufferSize( ) != null ) {
		httpConfiguration.setOutputBufferSize( theConfiguration.getOutputBufferSize( ) );
	}
	httpConfiguration.setSendDateHeader( false ); // TODO: verify if I should manually do this, and in what way this sets it (UTC, local, etc)
	httpConfiguration.setSendServerVersion( false );
	httpConfiguration.setSendXPoweredBy( false );

	return httpConfiguration;
}
 
開發者ID:Talvish,項目名稱:Tales,代碼行數:22,代碼來源:HttpInterfaceBase.java

示例4: createConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
/**
 * Creates a Jetty HTTP configuration.
 * 
 * @return A Jetty HTTP configuration.
 */
private HttpConfiguration createConfiguration()
{
	final HttpConfiguration configuration = new HttpConfiguration();
	configuration.setHeaderCacheSize( getHttpHeaderCacheSize() );
	configuration.setRequestHeaderSize( getHttpRequestHeaderSize() );
	configuration.setResponseHeaderSize( getHttpResponseHeaderSize() );
	configuration.setOutputBufferSize( getHttpOutputBufferSize() );
	configuration.setDelayDispatchUntilContent( getHttpDelayDispatchUntilContent() );
	configuration.setOutputAggregationSize( getHttpOutputAggregationSize() );
	configuration.setPersistentConnectionsEnabled( getHttpPersistentConnectionsEnabled() );
	configuration.setSendDateHeader( getHttpSendDateHeader() );
	configuration.setSendServerVersion( getHttpSendVersionHeader() );
	configuration.setSendXPoweredBy( getHttpSendXPoweredBy() );
	return configuration;
}
 
開發者ID:tliron,項目名稱:restlet-jetty9,代碼行數:21,代碼來源:JettyServerHelper.java

示例5: startProxy

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
public int startProxy() throws Exception {
  seenByProxy.clear();
  InetAddress address = InetAddress.getLoopbackAddress();
  httpProxyPort = NetworkUtils.getNextAvailablePort(address);

  // Setup Threadpool
  QueuedThreadPool threadPool = new QueuedThreadPool();
  threadPool.setMaxThreads(500);

  server = new Server(threadPool);

  // HTTP Configuration
  HttpConfiguration httpConfig = new HttpConfiguration();
  httpConfig.setSecureScheme("https");
  httpConfig.setSendServerVersion(true);
  httpConfig.setSendDateHeader(false);

  // Handler Structure
  HandlerCollection handlers = new HandlerCollection();
  handlers.setHandlers(new Handler[] {proxyHandler(), new DefaultHandler()});
  server.setHandler(handlers);

  ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(httpConfig));
  http.setPort(httpProxyPort);
  server.addConnector(http);
  server.start();

  return httpProxyPort;
}
 
開發者ID:SonarSource,項目名稱:sonar-scanner-maven,代碼行數:30,代碼來源:Proxy.java

示例6: newHttpConnectionFactory

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
private HttpConnectionFactory newHttpConnectionFactory() {
    HttpConfiguration httpConfig = new HttpConfiguration();
    httpConfig.setSendDateHeader(true);
    httpConfig.setSendServerVersion(false);
    httpConfig.setSendXPoweredBy(false);
    httpConfig.setHeaderCacheSize(connectorConfig.headerCacheSize());
    httpConfig.setOutputBufferSize(connectorConfig.outputBufferSize());
    httpConfig.setRequestHeaderSize(connectorConfig.requestHeaderSize());
    httpConfig.setResponseHeaderSize(connectorConfig.responseHeaderSize());
    if (connectorConfig.ssl().enabled()) {
        httpConfig.addCustomizer(new SecureRequestCustomizer());
    }
    return new HttpConnectionFactory(httpConfig);
}
 
開發者ID:vespa-engine,項目名稱:vespa,代碼行數:15,代碼來源:ConnectorFactory.java

示例7: configureHttp

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
static void configureHttp( HttpConfiguration httpConfig, JettyConfiguration config )
{
    // Date header
    Boolean sendDateHeader = config.sendDateHeader().get();
    if( sendDateHeader != null )
    {
        httpConfig.setSendDateHeader( sendDateHeader );
    }

    // Server version
    Boolean sendServerVersion = config.sendServerVersion().get();
    if( sendServerVersion != null )
    {
        httpConfig.setSendServerVersion( sendServerVersion );
    }

    // Header sizes
    Integer requestHeaderSize = config.requestHeaderSize().get();
    if( requestHeaderSize != null )
    {
        httpConfig.setRequestHeaderSize( requestHeaderSize );
    }
    Integer responseHeaderSize = config.responseHeaderSize().get();
    if( responseHeaderSize != null )
    {
        httpConfig.setResponseHeaderSize( responseHeaderSize );
    }

    // Buffer sizes
    Integer responseBufferSize = config.responseBufferSize().get();
    if( responseBufferSize != null )
    {
        httpConfig.setOutputBufferSize( responseBufferSize );
    }

}
 
開發者ID:apache,項目名稱:polygene-java,代碼行數:37,代碼來源:JettyConfigurationHelper.java

示例8: startServer

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
private void startServer(ApiConfiguration apiConfiguration) throws Exception {
    // Creation of the Jetty server
    // === jetty.xml ===
    // Setup Threadpool
    QueuedThreadPool threadPool = new QueuedThreadPool(10);

    servers = new ArrayList<>(apiConfiguration.workers());
    for(int i = 0 ; i < apiConfiguration.workers() ; i++) {
        // Server
        Server server = new Server(threadPool);

        // HTTP Configuration
        HttpConfiguration http_config = new HttpConfiguration();
        http_config.setOutputBufferSize(32768);
        http_config.setRequestHeaderSize(8192);
        http_config.setResponseHeaderSize(8192);
        http_config.setSendServerVersion(true);
        http_config.setSendDateHeader(false);

        // === jetty-http.xml ===
        ServerConnector http = new ServerConnector(server,
                new HttpConnectionFactory(http_config));
        http.setPort(SocketUtils.generateFreePort());
        http.setIdleTimeout(30000);
        server.addConnector(http);

        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
        context.setContextPath(apiConfiguration.contextPath());
        ServletHolder servletHolder = new ServletHolder(apiConfiguration.servlet());
        servletHolder.setInitParameter("worker", "worker#" + i);

        context.addServlet(servletHolder, "/*");

        server.setHandler(context);
        server.start();
    }
}
 
開發者ID:gravitee-io,項目名稱:gravitee-gateway,代碼行數:38,代碼來源:ApiPublisherStatement.java

示例9: buildHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
private HttpConfiguration buildHttpConfiguration(int port) {
    // HTTP Configuration
    HttpConfiguration httpConfig = new HttpConfiguration();
    httpConfig.setSecureScheme("https");
    httpConfig.setSecurePort(port);
    httpConfig.setOutputBufferSize(32768);
    httpConfig.setRequestHeaderSize(8192);
    httpConfig.setResponseHeaderSize(8192);
    httpConfig.setSendServerVersion(true);
    httpConfig.setSendDateHeader(false);
    httpConfig.setBlockingTimeout(30000); // Config
    // httpConfig.addCustomizer(new ForwardedRequestCustomizer());
    return httpConfig;
}
 
開發者ID:jivesoftware,項目名稱:routing-bird,代碼行數:15,代碼來源:RestfulServer.java

示例10: defaultConfig

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
private HttpConfiguration defaultConfig(int requestHeaderSize) {
  HttpConfiguration config = new HttpConfiguration();
  config.setRequestHeaderSize(requestHeaderSize);
  config.setSendServerVersion(false);
  config.setSendDateHeader(true);
  return config;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:8,代碼來源:JettyServer.java

示例11: createHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
/**
 * 創建HttpConfiguration
 * 
 * @return HttpConfiguration
 */
public static HttpConfiguration createHttpConfiguration() {
	HttpConfiguration httpConfig = new HttpConfiguration();

	httpConfig.setSecurePort(setting.getInt("secure-port", "http", 8443));
	httpConfig.setOutputBufferSize(setting.getInt("output-buffersize", "http", 32768));
	httpConfig.setRequestHeaderSize(setting.getInt("request-headersize", "http", 8192));
	httpConfig.setResponseHeaderSize(setting.getInt("response-headersize", "http", 8192));
	httpConfig.setSendServerVersion(true);
	httpConfig.setSendDateHeader(false);

	return httpConfig;
}
 
開發者ID:looly,項目名稱:hulu,代碼行數:18,代碼來源:JettySetting.java

示例12: createHttpConfigurationForHTTP

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
private HttpConfiguration createHttpConfigurationForHTTP() {
		final HttpConfiguration http_config = new HttpConfiguration();
//		http_config.setSecureScheme("https");
//		http_config.setSecurePort(getSecurePort());
		http_config.setOutputBufferSize(32768);
		http_config.setRequestHeaderSize(8192);
		http_config.setResponseHeaderSize(8192);
		http_config.setSendServerVersion(true);
		http_config.setSendDateHeader(false);
		return http_config;
	}
 
開發者ID:cloudstore,項目名稱:cloudstore,代碼行數:12,代碼來源:LocalServer.java

示例13: createHttpConfigurationForHTTP

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
private HttpConfiguration createHttpConfigurationForHTTP() {
	final HttpConfiguration http_config = new HttpConfiguration();
	http_config.setSecureScheme("https");
	http_config.setSecurePort(getSecurePort());
	http_config.setOutputBufferSize(32768);
	http_config.setRequestHeaderSize(8192);
	http_config.setResponseHeaderSize(8192);
	http_config.setSendServerVersion(true);
	http_config.setSendDateHeader(false);
	return http_config;
}
 
開發者ID:cloudstore,項目名稱:cloudstore,代碼行數:12,代碼來源:CloudStoreServer.java

示例14: prepare

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
/**
 * A fully configured Jetty Server instance
 */
public void prepare() throws Exception {

    // === jetty.xml ===
    // Setup Threadpool
    QueuedThreadPool threadPool = new QueuedThreadPool();
    threadPool.setMinThreads(MIN_THREADS);
    threadPool.setMaxThreads(MAX_THREADS);

    // Server
    server = new Server(threadPool);

    // Scheduler
    server.addBean(new ScheduledExecutorScheduler());

    // HTTP Configuration
    HttpConfiguration httpConfig = new HttpConfiguration();
    httpConfig.setSecureScheme(HttpScheme.HTTPS.asString());
    httpConfig.setSecurePort(CONFIG.getJetty().getHttpsPort());
    httpConfig.setOutputBufferSize(32768);
    httpConfig.setRequestHeaderSize(8192);
    httpConfig.setResponseHeaderSize(8192);
    httpConfig.setSendServerVersion(false);
    httpConfig.setSendDateHeader(false);
    httpConfig.setSendXPoweredBy(false);

    // Extra options
    server.setDumpAfterStart(false);
    server.setDumpBeforeStop(false);
    server.setStopAtShutdown(true);
    server.setStopTimeout(STOP_TIMEOUT);

    if (CONFIG.getJetty().isHttpEnabled()) {
        server.addConnector(httpConnector(httpConfig));
    }

    if (CONFIG.getJetty().isHttpsEnabled()) {
        server.addConnector(httpsConnector(httpConfig));
    }

    SteveAppContext steveAppContext = new SteveAppContext();
    server.setHandler(steveAppContext.getHandlers());
}
 
開發者ID:RWTH-i5-IDSG,項目名稱:steve-plugsurfing,代碼行數:46,代碼來源:JettyServer.java

示例15: getConnector

import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
protected Connector getConnector(int port) throws IOException {
    org.apache.commons.configuration.Configuration config = getConfiguration();

    SslContextFactory sslContextFactory = new SslContextFactory();
    sslContextFactory.setKeyStorePath(config.getString(KEYSTORE_FILE_KEY,
            System.getProperty(KEYSTORE_FILE_KEY, DEFAULT_KEYSTORE_FILE_LOCATION)));
    sslContextFactory.setKeyStorePassword(getPassword(config, KEYSTORE_PASSWORD_KEY));
    sslContextFactory.setKeyManagerPassword(getPassword(config, SERVER_CERT_PASSWORD_KEY));
    sslContextFactory.setTrustStorePath(config.getString(TRUSTSTORE_FILE_KEY,
            System.getProperty(TRUSTSTORE_FILE_KEY, DEFATULT_TRUSTORE_FILE_LOCATION)));
    sslContextFactory.setTrustStorePassword(getPassword(config, TRUSTSTORE_PASSWORD_KEY));
    sslContextFactory.setWantClientAuth(config.getBoolean(CLIENT_AUTH_KEY, Boolean.getBoolean(CLIENT_AUTH_KEY)));

    List<Object> cipherList = config.getList(ATLAS_SSL_EXCLUDE_CIPHER_SUITES, DEFAULT_CIPHER_SUITES);
    sslContextFactory.setExcludeCipherSuites(cipherList.toArray(new String[cipherList.size()]));
    sslContextFactory.setRenegotiationAllowed(false);

    String[] excludedProtocols = config.containsKey(ATLAS_SSL_EXCLUDE_PROTOCOLS) ?
            config.getStringArray(ATLAS_SSL_EXCLUDE_PROTOCOLS) : DEFAULT_EXCLUDE_PROTOCOLS;
    if (excludedProtocols != null && excludedProtocols.length > 0) {
        sslContextFactory.addExcludeProtocols(excludedProtocols);
    }

    // SSL HTTP Configuration
    // HTTP Configuration
    HttpConfiguration http_config = new HttpConfiguration();
    http_config.setSecureScheme("https");
    final int bufferSize = AtlasConfiguration.WEBSERVER_REQUEST_BUFFER_SIZE.getInt();
    http_config.setSecurePort(port);
    http_config.setRequestHeaderSize(bufferSize);
    http_config.setResponseHeaderSize(bufferSize);
    http_config.setSendServerVersion(true);
    http_config.setSendDateHeader(false);

    HttpConfiguration https_config = new HttpConfiguration(http_config);
    https_config.addCustomizer(new SecureRequestCustomizer());

    // SSL Connector
    ServerConnector sslConnector = new ServerConnector(server,
        new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()),
        new HttpConnectionFactory(https_config));
    sslConnector.setPort(port);
    server.addConnector(sslConnector);

    return sslConnector;
}
 
開發者ID:apache,項目名稱:incubator-atlas,代碼行數:47,代碼來源:SecureEmbeddedServer.java


注:本文中的org.eclipse.jetty.server.HttpConfiguration.setSendDateHeader方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。