Top Description Fields Constructors Methods
io.undertow.servlet.api

public Class DeploymentInfo

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
java.io.File, java.nio.file.Path, .Paths, java.util.ArrayList, .Arrays, .Collection, .HashMap, .HashSet, .List, .Locale, .Map, .Set, java.util.concurrent.ConcurrentMap, .Executor, jakarta.servlet.DispatcherType, .MultipartConfigElement, .ServletContextListener, jakarta.servlet.descriptor.JspConfigDescriptor, io.undertow.security.api.AuthenticationMechanism, .AuthenticationMechanismFactory, .AuthenticationMode, .NotificationReceiver, .SecurityContextFactory, io.undertow.security.idm.IdentityManager, io.undertow.server.HandlerWrapper, io.undertow.server.handlers.resource.ResourceManager, io.undertow.server.session.SecureRandomSessionIdGenerator, .SessionIdGenerator, .SessionListener, io.undertow.servlet.ServletExtension, .UndertowServletMessages, io.undertow.servlet.core.DefaultAuthorizationManager, .InMemorySessionManagerFactory, io.undertow.servlet.util.DefaultClassIntrospector, io.undertow.util.ImmediateAuthenticationMechanismFactory

Represents a servlet deployment.
Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private Executor
private final Map<String, AuthenticationMechanismFactory>
private AuthenticationMode
private AuthorizationManager
private boolean
private boolean
private ClassIntrospecter
private ClassLoader
private ConfidentialPortManager
private int
private int
private int
contentTypeCacheSize

Cache of common content types, to prevent allocations when parsing the charset

private String
private CrawlerSessionManagerConfig
private static final int
private int
private String
private MultipartConfigElement
defaultMultipartConfig

Multipart config that will be applied to all servlets that do not have an explicit config

private String
private String
private DefaultServletConfig
defaultServletConfig

References Deprecated DefaultServletConfig is deprecated or references (maybe indirectly) at least one deprecated element.
private int
private boolean
private final List<ServletContextListener>
private String
private boolean
private String
private boolean
private final List<ErrorPage>
private boolean
private ExceptionHandler
private Executor
private final Map<String, FilterInfo>
private final List<FilterMappingInfo>
private final List<FilterMappingInfo>
private String
private IdentityManager
private boolean
private final List<HandlerWrapper>
initialHandlerChainWrappers

Wrappers that are applied before the servlet initial handler, and before any servlet related object have been created.

private HandlerWrapper
initialSecurityWrapper

A handler chain wrapper to wrap the initial stages of the security handlers, if this is set it is assumed it is taking over the responsibility of setting the io.undertow.security.api.SecurityContext that can handle authentication and the remaining Undertow handlers specific to authentication will be skipped.

private final Map<String, String>
private final List<HandlerWrapper>
innerHandlerChainWrappers

Handler chain wrappers that are applied just before the servlet request is dispatched.

private boolean
private AuthenticationMechanism
private JspConfigDescriptor
private final List<LifecycleInterceptor>
private final List<ListenerInfo>
private final Map<String, String>
private LoginConfig
private int
private MetricsCollector
private final List<MimeMapping>
private int
private final List<NotificationReceiver>
private final List<HandlerWrapper>
outerHandlerChainWrappers

Handler chain wrappers that are applied outside all other handlers, including security but after the initial servlet handler.

private final Map<String, String>
preCompressedResources

A map of content encoding to file extension for pre compressed resource (e.g. gzip -> .gz)

private boolean
private final Map<String, Set<String>>
principalVersusRolesMap

map of additional roles that should be applied to the given principal.

private ResourceManager
private final List<SecurityConstraint>
private SecurityContextFactory
securityContextFactory

References Deprecated SecurityContextFactory is deprecated or references (maybe indirectly) at least one deprecated element.
private boolean
private final Set<String>
private final List<HandlerWrapper>
securityWrappers

Handler chain wrappers that are applied just before the authentication mechanism is called.

private boolean
private String
private final List<ServletContainerInitializerInfo>
private ConcurrentMap<String, Object>
private final Map<String, Object>
private final List<ServletExtension>
servletExtensions

additional servlet extensions

private final Map<String, ServletInfo>
private ServletSessionConfig
private ServletStackTraces
private SessionConfigWrapper
private SessionIdGenerator
private final List<SessionListener>
private SessionManagerFactory
private SessionPersistenceManager
private Path
private final List<ThreadSetupHandler>
private String
private boolean
private final List<String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public DeploymentInfo
addAuthenticationMechanism(final String
The name
name
,
final AuthenticationMechanismFactory
The factory
factory
)

Adds an authentication mechanism.

public DeploymentInfo
addDeploymentCompleteListener(ServletContextListener servletContextListener)

Add's a listener that is only invoked once all other deployment steps have been completed The listeners contextDestroyed method will be called after all undeployment steps are undertaken

public DeploymentInfo
addErrorPage(final ErrorPage errorPage)

public DeploymentInfo
addErrorPages(final ErrorPage... errorPages)

public DeploymentInfo
addErrorPages(final Collection<ErrorPage> errorPages)

public DeploymentInfo
addFilter(final FilterInfo filter)

public DeploymentInfo
addFilters(final FilterInfo... filters)

public DeploymentInfo
public DeploymentInfo
addFilterServletNameMapping(final String filterName, final String mapping, DispatcherType dispatcher)

public DeploymentInfo
addFilterUrlMapping(final String filterName, final String mapping, DispatcherType dispatcher)

public DeploymentInfo

Returns:

this deployment info
addFirstAuthenticationMechanism
(final String
The authentication mechanism name
name
,
final AuthenticationMechanism
The mechanism
mechanism
)

Adds an authentication mechanism directly to the deployment.

public DeploymentInfo
public DeploymentInfo
addInitParameter(final String name, final String value)

public DeploymentInfo
addInnerHandlerChainWrapper(final HandlerWrapper
The wrapper
wrapper
)

Adds an inner handler chain wrapper.

public DeploymentInfo
addLastAuthenticationMechanism(final String
The authentication mechanism name
name
,
final AuthenticationMechanism
The mechanism
mechanism
)

Adds an authentication mechanism directly to the deployment.

public DeploymentInfo
public DeploymentInfo
addListener(final ListenerInfo listener)

public DeploymentInfo
addListeners(final ListenerInfo... listeners)

public DeploymentInfo
public DeploymentInfo
addLocaleCharsetMapping(final String locale, final String charset)

public DeploymentInfo
addMimeMapping(final MimeMapping mimeMappings)

public DeploymentInfo
addMimeMappings(final MimeMapping... mimeMappings)

public DeploymentInfo
addMimeMappings(final Collection<MimeMapping> mimeMappings)

public DeploymentInfo
addNotificactionReceivers(final NotificationReceiver... notificationReceivers)

public DeploymentInfo
addNotificationReceiver(final NotificationReceiver notificationReceiver)

public DeploymentInfo
public DeploymentInfo
addOuterHandlerChainWrapper(final HandlerWrapper
The wrapper
wrapper
)

Adds an outer handler wrapper.

public DeploymentInfo

Returns:

this builder
addPreCompressedResourceEncoding
(String
The content encoding
encoding
,
String
The file extension
extension
)

Adds a pre compressed resource encoding and maps it to a file extension

public DeploymentInfo
addPrincipalVsRoleMapping(final String principal, final String mapping)

public DeploymentInfo
addPrincipalVsRoleMappings(final String principal, final String... mappings)

public DeploymentInfo
addPrincipalVsRoleMappings(final String principal, final Collection<String> mappings)

public DeploymentInfo
addSecurityConstraint(final SecurityConstraint securityConstraint)

public DeploymentInfo
addSecurityConstraints(final SecurityConstraint... securityConstraints)

public DeploymentInfo
public DeploymentInfo
addSecurityRole(final String role)

public DeploymentInfo
addSecurityRoles(final String... roles)

public DeploymentInfo
public DeploymentInfo
addSecurityWrapper(final HandlerWrapper wrapper)

Adds a security handler.

public DeploymentInfo
addServlet(final ServletInfo servlet)

public DeploymentInfo
addServletContainerInitalizer(final ServletContainerInitializerInfo servletContainerInitializer)
Deprecated

public DeploymentInfo
addServletContainerInitalizers(final ServletContainerInitializerInfo... servletContainerInitializer)
Deprecated

public DeploymentInfo
addServletContainerInitalizers(final List<ServletContainerInitializerInfo> servletContainerInitializers)
Deprecated

public DeploymentInfo
public DeploymentInfo
public DeploymentInfo
public DeploymentInfo
addServletContextAttribute(final String name, final Object value)

public DeploymentInfo

Returns:

this
addServletExtension
(final ServletExtension
The servlet extension
servletExtension
)

Adds an additional servlet extension to the deployment.

public DeploymentInfo
addServlets(final ServletInfo... servlets)

public DeploymentInfo
public DeploymentInfo
public DeploymentInfo
addThreadSetupAction(final ThreadSetupAction action)
Deprecated

public DeploymentInfo
public DeploymentInfo
addWelcomePage(final String welcomePage)

public DeploymentInfo
addWelcomePages(final String... welcomePages)

public DeploymentInfo
addWelcomePages(final Collection<String> welcomePages)

public DeploymentInfo

Returns:

this deployment info
clearLoginMethods
()

Removes all configured authentication mechanisms from the deployment.

public DeploymentInfo
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public Executor
public Map<String, AuthenticationMechanismFactory>
public AuthenticationMode
public AuthorizationManager
public ClassIntrospecter
public ClassLoader
public ConfidentialPortManager
public int
public int
public int
public String
public CrawlerSessionManagerConfig
public int
public String
public MultipartConfigElement
public String
public String
public DefaultServletConfig
getDefaultServletConfig()
References Deprecated DefaultServletConfig is deprecated or references (maybe indirectly) at least one deprecated element.

public int
public List<ServletContextListener>
public String
public String
public List<ErrorPage>
public ExceptionHandler
getExceptionHandler()

Returns the exception handler that is used by this deployment.

public Executor
public List<FilterMappingInfo>
public Map<String, FilterInfo>
public String

Returns:

the host name
getHostName
()

public IdentityManager
public List<HandlerWrapper>
public HandlerWrapper
public Map<String, String>
public List<HandlerWrapper>
public AuthenticationMechanism
public JspConfigDescriptor
public List<LifecycleInterceptor>
public List<ListenerInfo>
public Map<String, String>
public LoginConfig
public int
public MetricsCollector
public List<MimeMapping>
public int
public List<NotificationReceiver>
public List<HandlerWrapper>
public Map<String, String>
public Map<String, Set<String>>
public ResourceManager
public List<SecurityConstraint>
public SecurityContextFactory
getSecurityContextFactory()
References Deprecated SecurityContextFactory is deprecated or references (maybe indirectly) at least one deprecated element.

public Set<String>
public List<HandlerWrapper>
public String
public List<ServletContainerInitializerInfo>
public ConcurrentMap<String, Object>
public Map<String, Object>
public List<ServletExtension>
public Map<String, ServletInfo>
public ServletSessionConfig
public ServletStackTraces
public SessionConfigWrapper
public SessionIdGenerator
public List<SessionListener>
public SessionManagerFactory
public SessionPersistenceManager
public File
public Path
public List<ThreadSetupHandler>
public String
public List<String>
public DeploymentInfo
insertFilterServletNameMapping(final int pos, final String filterName, final String mapping, DispatcherType dispatcher)

public DeploymentInfo
insertFilterUrlMapping(final int pos, final String filterName, final String mapping, DispatcherType dispatcher)

public boolean
public boolean

Returns:

true if the mechanism is enabled
isAuthenticationMechanismPresent
(final String
The mechanism name
mechanismName
)

Returns true if the specified mechanism is present in the login config

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public Path

Returns:

Returns the temp directory path if it's not null, else returns the system level temporary directory path pointed to by the Java system property java.io.tmpdir
requireTempPath
()

public DeploymentInfo
setAllowNonStandardWrappers(final boolean allowNonStandardWrappers)

public DeploymentInfo
setAsyncExecutor(final Executor
The executor
asyncExecutor
)

Sets the executor that is used to run async tasks.

public DeploymentInfo
setAuthenticationMode(AuthenticationMode
The authentication mode to use
authenticationMode
)

Sets if this deployment should use pro-active authentication and always authenticate if the credentials are present or constraint driven auth which will only call the authentication mechanisms for protected resources.

public DeploymentInfo
public DeploymentInfo
setChangeSessionIdOnLogin(boolean changeSessionIdOnLogin)

public DeploymentInfo
setCheckOtherSessionManagers(boolean checkOtherSessionManagers)

If this is true then when an existing invalid session id is found all other deployments in the container will have their session managers checked to see if it represents a valid session.

public DeploymentInfo
setClassIntrospecter(final ClassIntrospecter classIntrospecter)

public DeploymentInfo
setClassLoader(final ClassLoader classLoader)

public DeploymentInfo
public DeploymentInfo
setContainerMajorVersion(int containerMajorVersion)

public DeploymentInfo
setContainerMinorVersion(int containerMinorVersion)

public DeploymentInfo
setContentTypeCacheSize(int contentTypeCacheSize)

public DeploymentInfo
setContextPath(final String contextPath)

public DeploymentInfo
public DeploymentInfo
setDefaultCookieVersion(int defaultCookieVersion)

public DeploymentInfo
setDefaultEncoding(String
The default encoding
defaultEncoding
)

Sets the default encoding that will be used for servlet responses

public DeploymentInfo
public DeploymentInfo
setDefaultRequestEncoding(String defaultRequestEncoding)

public DeploymentInfo
setDefaultResponseEncoding(String defaultResponseEncoding)

public DeploymentInfo
setDefaultServletConfig(final DefaultServletConfig defaultServletConfig)
References Deprecated DefaultServletConfig is deprecated or references (maybe indirectly) at least one deprecated element.

public DeploymentInfo
setDefaultSessionTimeout(final int
The default session timeout, in seconds
defaultSessionTimeout
)

public DeploymentInfo
setDenyUncoveredHttpMethods(final boolean denyUncoveredHttpMethods)

public DeploymentInfo
setDeploymentName(final String deploymentName)

public DeploymentInfo
setDisableCachingForSecuredPages(boolean disableCachingForSecuredPages)

public DeploymentInfo
setDisplayName(final String displayName)

public DeploymentInfo
setEagerFilterInit(boolean eagerFilterInit)

public DeploymentInfo
setEscapeErrorMessage(boolean
If the error message should be escaped
escapeErrorMessage
)

Set if if the message passed to jakarta.servlet.http.HttpServletResponse#sendError(int, String) should be escaped.

public DeploymentInfo
setExceptionHandler(ExceptionHandler
The exception handler
exceptionHandler
)

Sets the default exception handler for this deployment

public DeploymentInfo
setExecutor(final Executor
The executor
executor
)

Sets the executor that will be used to run servlet invocations.

public DeploymentInfo
setHostName(final String hostName)

public DeploymentInfo
public DeploymentInfo
setIgnoreFlush(boolean ignoreFlush)

public DeploymentInfo

Returns:

this to allow chaining.
setInitialSecurityWrapper
(final HandlerWrapper
the HandlerWrapper to handle the initial security context installation.
wrapper
)

Sets the initial handler wrapper that will take over responsibility for establishing a security context that will handle authentication for the request.

public DeploymentInfo
setInvalidateSessionOnLogout(boolean invalidateSessionOnLogout)

public DeploymentInfo
public DeploymentInfo
public DeploymentInfo
public DeploymentInfo
setMajorVersion(final int majorVersion)

public DeploymentInfo
public DeploymentInfo
setMinorVersion(final int minorVersion)

public void
setOrphanSessionAllowed(boolean allowOrphanSession)

public void
setPreservePathOnForward(boolean preservePathOnForward)

public DeploymentInfo
setResourceManager(final ResourceManager resourceManager)

public DeploymentInfo
setSecurityContextFactory(final SecurityContextFactory securityContextFactory)
References Deprecated SecurityContextFactory is deprecated or references (maybe indirectly) at least one deprecated element.

public DeploymentInfo
setSecurityDisabled(boolean securityDisabled)

public DeploymentInfo

Returns:

this
setSendCustomReasonPhraseOnError
(boolean
If the parameter to sendError should be used as a HTTP reason phrase
sendCustomReasonPhraseOnError
)

If this is true then the message parameter of jakarta.servlet.http.HttpServletResponse#sendError(int, String) and jakarta.servlet.http.HttpServletResponse#setStatus(int, String) will be used as the HTTP reason phrase in the response.

public DeploymentInfo
setServerName(String serverName)

public DeploymentInfo
setServletContextAttributeBackingMap(final ConcurrentMap<String, Object>
The backing map
servletContextAttributeBackingMap
)

Sets the map that will be used by the ServletContext implementation to store attributes.

public DeploymentInfo
setServletSessionConfig(final ServletSessionConfig servletSessionConfig)

public DeploymentInfo
public DeploymentInfo
public DeploymentInfo
public DeploymentInfo
setSessionManagerFactory(final SessionManagerFactory sessionManagerFactory)

public DeploymentInfo
public DeploymentInfo
setTempDir(final File tempDir)

public DeploymentInfo
setTempDir(final Path tempDir)

public DeploymentInfo
setUrlEncoding(String
The encoding to use
urlEncoding
)

Sets the URL encoding.

public DeploymentInfo

Returns:

this
setUseCachedAuthenticationMechanism
(boolean
If Undertow should use its internal authentication cache mechanism
useCachedAuthenticationMechanism
)

If this is set to false the the cached authenticated session mechanism won't be installed.

public void
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait