001/*
002 * Copyright 2012-2017 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.boot.web.server;
018
019import java.net.InetAddress;
020import java.util.Set;
021
022/**
023 * A configurable {@link WebServerFactory}.
024 *
025 * @author Phillip Webb
026 * @author Brian Clozel
027 * @since 2.0.0
028 * @see ErrorPageRegistry
029 */
030public interface ConfigurableWebServerFactory
031                extends WebServerFactory, ErrorPageRegistry {
032
033        /**
034         * Sets the port that the web server should listen on. If not specified port '8080'
035         * will be used. Use port -1 to disable auto-start (i.e start the web application
036         * context but not have it listen to any port).
037         * @param port the port to set
038         */
039        void setPort(int port);
040
041        /**
042         * Sets the specific network address that the server should bind to.
043         * @param address the address to set (defaults to {@code null})
044         */
045        void setAddress(InetAddress address);
046
047        /**
048         * Sets the error pages that will be used when handling exceptions.
049         * @param errorPages the error pages
050         */
051        void setErrorPages(Set<? extends ErrorPage> errorPages);
052
053        /**
054         * Sets the SSL configuration that will be applied to the server's default connector.
055         * @param ssl the SSL configuration
056         */
057        void setSsl(Ssl ssl);
058
059        /**
060         * Sets a provider that will be used to obtain SSL stores.
061         * @param sslStoreProvider the SSL store provider
062         */
063        void setSslStoreProvider(SslStoreProvider sslStoreProvider);
064
065        /**
066         * Sets the HTTP/2 configuration that will be applied to the server.
067         * @param http2 the HTTP/2 configuration
068         */
069        void setHttp2(Http2 http2);
070
071        /**
072         * Sets the compression configuration that will be applied to the server's default
073         * connector.
074         * @param compression the compression configuration
075         */
076        void setCompression(Compression compression);
077
078        /**
079         * Sets the server header value.
080         * @param serverHeader the server header value
081         */
082        void setServerHeader(String serverHeader);
083
084}