001/*
002 * Copyright 2012-2018 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.embedded.undertow;
018
019import java.io.File;
020
021import io.undertow.Undertow.Builder;
022import io.undertow.servlet.api.DeploymentInfo;
023
024import org.springframework.boot.web.server.ConfigurableWebServerFactory;
025
026/**
027 * {@link ConfigurableWebServerFactory} for Undertow-specific features.
028 *
029 * @author Brian Clozel
030 * @since 2.0.0
031 * @see UndertowServletWebServerFactory
032 * @see UndertowReactiveWebServerFactory
033 */
034public interface ConfigurableUndertowWebServerFactory
035                extends ConfigurableWebServerFactory {
036
037        /**
038         * Add {@link UndertowBuilderCustomizer}s that should be used to customize the
039         * Undertow {@link Builder}.
040         * @param customizers the customizers to add
041         */
042        void addBuilderCustomizers(UndertowBuilderCustomizer... customizers);
043
044        /**
045         * Add {@link UndertowDeploymentInfoCustomizer}s that should be used to customize the
046         * Undertow {@link DeploymentInfo}.
047         * @param customizers the customizers to add
048         */
049        void addDeploymentInfoCustomizers(UndertowDeploymentInfoCustomizer... customizers);
050
051        /**
052         * Set the buffer size.
053         * @param bufferSize buffer size
054         */
055        void setBufferSize(Integer bufferSize);
056
057        /**
058         * Set the number of IO Threads.
059         * @param ioThreads number of IO Threads
060         */
061        void setIoThreads(Integer ioThreads);
062
063        /**
064         * Set the number of Worker Threads.
065         * @param workerThreads number of Worker Threads
066         */
067        void setWorkerThreads(Integer workerThreads);
068
069        /**
070         * Set whether direct buffers should be used.
071         * @param useForwardHeaders whether direct buffers should be used
072         */
073        void setUseDirectBuffers(Boolean useForwardHeaders);
074
075        /**
076         * Set the access log directory.
077         * @param accessLogDirectory access log directory
078         */
079        void setAccessLogDirectory(File accessLogDirectory);
080
081        /**
082         * Set the access log pattern.
083         * @param accessLogPattern access log pattern
084         */
085        void setAccessLogPattern(String accessLogPattern);
086
087        /**
088         * Set the access log prefix.
089         * @param accessLogPrefix log prefix
090         */
091        void setAccessLogPrefix(String accessLogPrefix);
092
093        /**
094         * Set the access log suffix.
095         * @param accessLogSuffix access log suffix
096         */
097        void setAccessLogSuffix(String accessLogSuffix);
098
099        /**
100         * Set whether access logs are enabled.
101         * @param accessLogEnabled whether access logs are enabled
102         */
103        void setAccessLogEnabled(boolean accessLogEnabled);
104
105        /**
106         * Set whether access logs rotation is enabled.
107         * @param accessLogRotate whether access logs rotation is enabled
108         */
109        void setAccessLogRotate(boolean accessLogRotate);
110
111        /**
112         * Set if x-forward-* headers should be processed.
113         * @param useForwardHeaders if x-forward headers should be used
114         */
115        void setUseForwardHeaders(boolean useForwardHeaders);
116
117}