Package io.undertow.servlet.api
Class DeploymentInfo
- java.lang.Object
-
- io.undertow.servlet.api.DeploymentInfo
-
- All Implemented Interfaces:
java.lang.Cloneable
public class DeploymentInfo extends java.lang.Object implements java.lang.Cloneable
Represents a servlet deployment.- Author:
- Stuart Douglas
-
-
Constructor Summary
Constructors Constructor Description DeploymentInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DeploymentInfo
addAuthenticationMechanism(java.lang.String name, io.undertow.security.api.AuthenticationMechanismFactory factory)
Adds an authentication mechanism.DeploymentInfo
addDeploymentCompleteListener(jakarta.servlet.ServletContextListener servletContextListener)
Add's a listener that is only invoked once all other deployment steps have been completed The listenerscontextDestroyed
method will be called after all undeployment steps are undertakenDeploymentInfo
addErrorPage(ErrorPage errorPage)
DeploymentInfo
addErrorPages(ErrorPage... errorPages)
DeploymentInfo
addErrorPages(java.util.Collection<ErrorPage> errorPages)
DeploymentInfo
addFilter(FilterInfo filter)
DeploymentInfo
addFilters(FilterInfo... filters)
DeploymentInfo
addFilters(java.util.Collection<FilterInfo> filters)
DeploymentInfo
addFilterServletNameMapping(java.lang.String filterName, java.lang.String mapping, jakarta.servlet.DispatcherType dispatcher)
DeploymentInfo
addFilterUrlMapping(java.lang.String filterName, java.lang.String mapping, jakarta.servlet.DispatcherType dispatcher)
DeploymentInfo
addFirstAuthenticationMechanism(java.lang.String name, io.undertow.security.api.AuthenticationMechanism mechanism)
Adds an authentication mechanism directly to the deployment.DeploymentInfo
addInitialHandlerChainWrapper(io.undertow.server.HandlerWrapper wrapper)
DeploymentInfo
addInitParameter(java.lang.String name, java.lang.String value)
DeploymentInfo
addInnerHandlerChainWrapper(io.undertow.server.HandlerWrapper wrapper)
Adds an inner handler chain wrapper.DeploymentInfo
addLastAuthenticationMechanism(java.lang.String name, io.undertow.security.api.AuthenticationMechanism mechanism)
Adds an authentication mechanism directly to the deployment.DeploymentInfo
addLifecycleInterceptor(LifecycleInterceptor interceptor)
DeploymentInfo
addListener(ListenerInfo listener)
DeploymentInfo
addListeners(ListenerInfo... listeners)
DeploymentInfo
addListeners(java.util.Collection<ListenerInfo> listeners)
DeploymentInfo
addLocaleCharsetMapping(java.lang.String locale, java.lang.String charset)
DeploymentInfo
addMimeMapping(MimeMapping mimeMappings)
DeploymentInfo
addMimeMappings(MimeMapping... mimeMappings)
DeploymentInfo
addMimeMappings(java.util.Collection<MimeMapping> mimeMappings)
DeploymentInfo
addNotificactionReceivers(io.undertow.security.api.NotificationReceiver... notificationReceivers)
DeploymentInfo
addNotificationReceiver(io.undertow.security.api.NotificationReceiver notificationReceiver)
DeploymentInfo
addNotificationReceivers(java.util.Collection<io.undertow.security.api.NotificationReceiver> notificationReceivers)
DeploymentInfo
addOuterHandlerChainWrapper(io.undertow.server.HandlerWrapper wrapper)
Adds an outer handler wrapper.DeploymentInfo
addPreCompressedResourceEncoding(java.lang.String encoding, java.lang.String extension)
Adds a pre compressed resource encoding and maps it to a file extensionDeploymentInfo
addPrincipalVsRoleMapping(java.lang.String principal, java.lang.String mapping)
DeploymentInfo
addPrincipalVsRoleMappings(java.lang.String principal, java.lang.String... mappings)
DeploymentInfo
addPrincipalVsRoleMappings(java.lang.String principal, java.util.Collection<java.lang.String> mappings)
DeploymentInfo
addSecurityConstraint(SecurityConstraint securityConstraint)
DeploymentInfo
addSecurityConstraints(SecurityConstraint... securityConstraints)
DeploymentInfo
addSecurityConstraints(java.util.Collection<SecurityConstraint> securityConstraints)
DeploymentInfo
addSecurityRole(java.lang.String role)
DeploymentInfo
addSecurityRoles(java.lang.String... roles)
DeploymentInfo
addSecurityRoles(java.util.Collection<java.lang.String> roles)
DeploymentInfo
addSecurityWrapper(io.undertow.server.HandlerWrapper wrapper)
Adds a security handler.DeploymentInfo
addServlet(ServletInfo servlet)
DeploymentInfo
addServletContainerInitalizer(ServletContainerInitializerInfo servletContainerInitializer)
Deprecated.DeploymentInfo
addServletContainerInitalizers(ServletContainerInitializerInfo... servletContainerInitializer)
Deprecated.DeploymentInfo
addServletContainerInitalizers(java.util.List<ServletContainerInitializerInfo> servletContainerInitializers)
Deprecated.DeploymentInfo
addServletContainerInitializer(ServletContainerInitializerInfo servletContainerInitializer)
DeploymentInfo
addServletContainerInitializers(ServletContainerInitializerInfo... servletContainerInitializer)
DeploymentInfo
addServletContainerInitializers(java.util.List<ServletContainerInitializerInfo> servletContainerInitializer)
DeploymentInfo
addServletContextAttribute(java.lang.String name, java.lang.Object value)
DeploymentInfo
addServletExtension(ServletExtension servletExtension)
Adds an additional servlet extension to the deployment.DeploymentInfo
addServlets(ServletInfo... servlets)
DeploymentInfo
addServlets(java.util.Collection<ServletInfo> servlets)
DeploymentInfo
addSessionListener(io.undertow.server.session.SessionListener sessionListener)
DeploymentInfo
addThreadSetupAction(ThreadSetupAction action)
Deprecated.DeploymentInfo
addThreadSetupAction(ThreadSetupHandler action)
DeploymentInfo
addWelcomePage(java.lang.String welcomePage)
DeploymentInfo
addWelcomePages(java.lang.String... welcomePages)
DeploymentInfo
addWelcomePages(java.util.Collection<java.lang.String> welcomePages)
DeploymentInfo
clearLoginMethods()
Removes all configured authentication mechanisms from the deployment.DeploymentInfo
clone()
java.util.concurrent.Executor
getAsyncExecutor()
java.util.Map<java.lang.String,io.undertow.security.api.AuthenticationMechanismFactory>
getAuthenticationMechanisms()
io.undertow.security.api.AuthenticationMode
getAuthenticationMode()
AuthorizationManager
getAuthorizationManager()
ClassIntrospecter
getClassIntrospecter()
java.lang.ClassLoader
getClassLoader()
ConfidentialPortManager
getConfidentialPortManager()
int
getContainerMajorVersion()
int
getContainerMinorVersion()
int
getContentTypeCacheSize()
java.lang.String
getContextPath()
CrawlerSessionManagerConfig
getCrawlerSessionManagerConfig()
int
getDefaultCookieVersion()
java.lang.String
getDefaultEncoding()
jakarta.servlet.MultipartConfigElement
getDefaultMultipartConfig()
java.lang.String
getDefaultRequestEncoding()
java.lang.String
getDefaultResponseEncoding()
DefaultServletConfig
getDefaultServletConfig()
int
getDefaultSessionTimeout()
java.util.List<jakarta.servlet.ServletContextListener>
getDeploymentCompleteListeners()
java.lang.String
getDeploymentName()
java.lang.String
getDisplayName()
java.util.List<ErrorPage>
getErrorPages()
ExceptionHandler
getExceptionHandler()
Returns the exception handler that is used by this deployment.java.util.concurrent.Executor
getExecutor()
java.util.List<FilterMappingInfo>
getFilterMappings()
java.util.Map<java.lang.String,FilterInfo>
getFilters()
java.lang.String
getHostName()
io.undertow.security.idm.IdentityManager
getIdentityManager()
java.util.List<io.undertow.server.HandlerWrapper>
getInitialHandlerChainWrappers()
io.undertow.server.HandlerWrapper
getInitialSecurityWrapper()
java.util.Map<java.lang.String,java.lang.String>
getInitParameters()
java.util.List<io.undertow.server.HandlerWrapper>
getInnerHandlerChainWrappers()
io.undertow.security.api.AuthenticationMechanism
getJaspiAuthenticationMechanism()
jakarta.servlet.descriptor.JspConfigDescriptor
getJspConfigDescriptor()
java.util.List<LifecycleInterceptor>
getLifecycleInterceptors()
java.util.List<ListenerInfo>
getListeners()
java.util.Map<java.lang.String,java.lang.String>
getLocaleCharsetMapping()
LoginConfig
getLoginConfig()
int
getMajorVersion()
MetricsCollector
getMetricsCollector()
java.util.List<MimeMapping>
getMimeMappings()
int
getMinorVersion()
java.util.List<io.undertow.security.api.NotificationReceiver>
getNotificationReceivers()
java.util.List<io.undertow.server.HandlerWrapper>
getOuterHandlerChainWrappers()
java.util.Map<java.lang.String,java.lang.String>
getPreCompressedResources()
java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
getPrincipalVersusRolesMap()
io.undertow.server.handlers.resource.ResourceManager
getResourceManager()
java.util.List<SecurityConstraint>
getSecurityConstraints()
io.undertow.security.api.SecurityContextFactory
getSecurityContextFactory()
java.util.Set<java.lang.String>
getSecurityRoles()
java.util.List<io.undertow.server.HandlerWrapper>
getSecurityWrappers()
java.lang.String
getServerName()
java.util.List<ServletContainerInitializerInfo>
getServletContainerInitializers()
java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object>
getServletContextAttributeBackingMap()
java.util.Map<java.lang.String,java.lang.Object>
getServletContextAttributes()
java.util.List<ServletExtension>
getServletExtensions()
java.util.Map<java.lang.String,ServletInfo>
getServlets()
ServletSessionConfig
getServletSessionConfig()
ServletStackTraces
getServletStackTraces()
SessionConfigWrapper
getSessionConfigWrapper()
io.undertow.server.session.SessionIdGenerator
getSessionIdGenerator()
java.util.List<io.undertow.server.session.SessionListener>
getSessionListeners()
SessionManagerFactory
getSessionManagerFactory()
SessionPersistenceManager
getSessionPersistenceManager()
java.io.File
getTempDir()
java.nio.file.Path
getTempPath()
java.util.List<ThreadSetupHandler>
getThreadSetupActions()
java.lang.String
getUrlEncoding()
java.util.List<java.lang.String>
getWelcomePages()
DeploymentInfo
insertFilterServletNameMapping(int pos, java.lang.String filterName, java.lang.String mapping, jakarta.servlet.DispatcherType dispatcher)
DeploymentInfo
insertFilterUrlMapping(int pos, java.lang.String filterName, java.lang.String mapping, jakarta.servlet.DispatcherType dispatcher)
boolean
isAllowNonStandardWrappers()
boolean
isAuthenticationMechanismPresent(java.lang.String mechanismName)
Returns true if the specified mechanism is present in the login configboolean
isChangeSessionIdOnLogin()
boolean
isCheckOtherSessionManagers()
boolean
isDenyUncoveredHttpMethods()
boolean
isDisableCachingForSecuredPages()
boolean
isEagerFilterInit()
boolean
isEscapeErrorMessage()
boolean
isIgnoreFlush()
boolean
isInvalidateSessionOnLogout()
boolean
isOrphanSessionAllowed()
boolean
isPreservePathOnForward()
boolean
isSecurityDisabled()
boolean
isSendCustomReasonPhraseOnError()
boolean
isUseCachedAuthenticationMechanism()
java.nio.file.Path
requireTempPath()
DeploymentInfo
setAllowNonStandardWrappers(boolean allowNonStandardWrappers)
DeploymentInfo
setAsyncExecutor(java.util.concurrent.Executor asyncExecutor)
Sets the executor that is used to run async tasks.DeploymentInfo
setAuthenticationMode(io.undertow.security.api.AuthenticationMode 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.DeploymentInfo
setAuthorizationManager(AuthorizationManager authorizationManager)
DeploymentInfo
setChangeSessionIdOnLogin(boolean changeSessionIdOnLogin)
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.DeploymentInfo
setClassIntrospecter(ClassIntrospecter classIntrospecter)
DeploymentInfo
setClassLoader(java.lang.ClassLoader classLoader)
DeploymentInfo
setConfidentialPortManager(ConfidentialPortManager confidentialPortManager)
DeploymentInfo
setContainerMajorVersion(int containerMajorVersion)
DeploymentInfo
setContainerMinorVersion(int containerMinorVersion)
DeploymentInfo
setContentTypeCacheSize(int contentTypeCacheSize)
DeploymentInfo
setContextPath(java.lang.String contextPath)
DeploymentInfo
setCrawlerSessionManagerConfig(CrawlerSessionManagerConfig crawlerSessionManagerConfig)
DeploymentInfo
setDefaultCookieVersion(int defaultCookieVersion)
DeploymentInfo
setDefaultEncoding(java.lang.String defaultEncoding)
Sets the default encoding that will be used for servlet responsesDeploymentInfo
setDefaultMultipartConfig(jakarta.servlet.MultipartConfigElement defaultMultipartConfig)
DeploymentInfo
setDefaultRequestEncoding(java.lang.String defaultRequestEncoding)
DeploymentInfo
setDefaultResponseEncoding(java.lang.String defaultResponseEncoding)
DeploymentInfo
setDefaultServletConfig(DefaultServletConfig defaultServletConfig)
DeploymentInfo
setDefaultSessionTimeout(int defaultSessionTimeout)
DeploymentInfo
setDenyUncoveredHttpMethods(boolean denyUncoveredHttpMethods)
DeploymentInfo
setDeploymentName(java.lang.String deploymentName)
DeploymentInfo
setDisableCachingForSecuredPages(boolean disableCachingForSecuredPages)
DeploymentInfo
setDisplayName(java.lang.String displayName)
DeploymentInfo
setEagerFilterInit(boolean eagerFilterInit)
DeploymentInfo
setEscapeErrorMessage(boolean escapeErrorMessage)
Set if if the message passed toHttpServletResponse.sendError(int, String)
should be escaped.DeploymentInfo
setExceptionHandler(ExceptionHandler exceptionHandler)
Sets the default exception handler for this deploymentDeploymentInfo
setExecutor(java.util.concurrent.Executor executor)
Sets the executor that will be used to run servlet invocations.DeploymentInfo
setHostName(java.lang.String hostName)
DeploymentInfo
setIdentityManager(io.undertow.security.idm.IdentityManager identityManager)
DeploymentInfo
setIgnoreFlush(boolean ignoreFlush)
DeploymentInfo
setInitialSecurityWrapper(io.undertow.server.HandlerWrapper wrapper)
Sets the initial handler wrapper that will take over responsibility for establishing a security context that will handle authentication for the request.DeploymentInfo
setInvalidateSessionOnLogout(boolean invalidateSessionOnLogout)
DeploymentInfo
setJaspiAuthenticationMechanism(io.undertow.security.api.AuthenticationMechanism jaspiAuthenticationMechanism)
DeploymentInfo
setJspConfigDescriptor(jakarta.servlet.descriptor.JspConfigDescriptor jspConfigDescriptor)
DeploymentInfo
setLoginConfig(LoginConfig loginConfig)
DeploymentInfo
setMajorVersion(int majorVersion)
DeploymentInfo
setMetricsCollector(MetricsCollector metricsCollector)
DeploymentInfo
setMinorVersion(int minorVersion)
void
setOrphanSessionAllowed(boolean allowOrphanSession)
void
setPreservePathOnForward(boolean preservePathOnForward)
DeploymentInfo
setResourceManager(io.undertow.server.handlers.resource.ResourceManager resourceManager)
DeploymentInfo
setSecurityContextFactory(io.undertow.security.api.SecurityContextFactory securityContextFactory)
DeploymentInfo
setSecurityDisabled(boolean securityDisabled)
DeploymentInfo
setSendCustomReasonPhraseOnError(boolean sendCustomReasonPhraseOnError)
If this is true then the message parameter ofHttpServletResponse.sendError(int, String)
andjakarta.servlet.http.HttpServletResponse#setStatus(int, String)
will be used as the HTTP reason phrase in the response.DeploymentInfo
setServerName(java.lang.String serverName)
DeploymentInfo
setServletContextAttributeBackingMap(java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> servletContextAttributeBackingMap)
Sets the map that will be used by the ServletContext implementation to store attributes.DeploymentInfo
setServletSessionConfig(ServletSessionConfig servletSessionConfig)
DeploymentInfo
setServletStackTraces(ServletStackTraces servletStackTraces)
DeploymentInfo
setSessionConfigWrapper(SessionConfigWrapper sessionConfigWrapper)
DeploymentInfo
setSessionIdGenerator(io.undertow.server.session.SessionIdGenerator sessionIdGenerator)
DeploymentInfo
setSessionManagerFactory(SessionManagerFactory sessionManagerFactory)
DeploymentInfo
setSessionPersistenceManager(SessionPersistenceManager sessionPersistenceManager)
DeploymentInfo
setTempDir(java.io.File tempDir)
DeploymentInfo
setTempDir(java.nio.file.Path tempDir)
DeploymentInfo
setUrlEncoding(java.lang.String urlEncoding)
Sets the URL encoding.DeploymentInfo
setUseCachedAuthenticationMechanism(boolean useCachedAuthenticationMechanism)
If this is set to false the the cached authenticated session mechanism won't be installed.void
validate()
-
-
-
Method Detail
-
validate
public void validate()
-
getDeploymentName
public java.lang.String getDeploymentName()
-
setDeploymentName
public DeploymentInfo setDeploymentName(java.lang.String deploymentName)
-
getDisplayName
public java.lang.String getDisplayName()
-
setDisplayName
public DeploymentInfo setDisplayName(java.lang.String displayName)
-
getContextPath
public java.lang.String getContextPath()
-
setContextPath
public DeploymentInfo setContextPath(java.lang.String contextPath)
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
-
setClassLoader
public DeploymentInfo setClassLoader(java.lang.ClassLoader classLoader)
-
getResourceManager
public io.undertow.server.handlers.resource.ResourceManager getResourceManager()
-
setResourceManager
public DeploymentInfo setResourceManager(io.undertow.server.handlers.resource.ResourceManager resourceManager)
-
getClassIntrospecter
public ClassIntrospecter getClassIntrospecter()
-
setClassIntrospecter
public DeploymentInfo setClassIntrospecter(ClassIntrospecter classIntrospecter)
-
isAllowNonStandardWrappers
public boolean isAllowNonStandardWrappers()
-
setAllowNonStandardWrappers
public DeploymentInfo setAllowNonStandardWrappers(boolean allowNonStandardWrappers)
-
getDefaultSessionTimeout
public int getDefaultSessionTimeout()
-
setDefaultSessionTimeout
public DeploymentInfo setDefaultSessionTimeout(int defaultSessionTimeout)
- Parameters:
defaultSessionTimeout
- The default session timeout, in seconds
-
getDefaultEncoding
public java.lang.String getDefaultEncoding()
-
setDefaultEncoding
public DeploymentInfo setDefaultEncoding(java.lang.String defaultEncoding)
Sets the default encoding that will be used for servlet responses- Parameters:
defaultEncoding
- The default encoding
-
getUrlEncoding
public java.lang.String getUrlEncoding()
-
setUrlEncoding
public DeploymentInfo setUrlEncoding(java.lang.String urlEncoding)
Sets the URL encoding. This will only take effect if theUndertowOptions.DECODE_URL
parameter has been set to false. This allows multiple deployments in the same server to use a different URL encoding- Parameters:
urlEncoding
- The encoding to use
-
addServlet
public DeploymentInfo addServlet(ServletInfo servlet)
-
addServlets
public DeploymentInfo addServlets(ServletInfo... servlets)
-
addServlets
public DeploymentInfo addServlets(java.util.Collection<ServletInfo> servlets)
-
getServlets
public java.util.Map<java.lang.String,ServletInfo> getServlets()
-
addFilter
public DeploymentInfo addFilter(FilterInfo filter)
-
addFilters
public DeploymentInfo addFilters(FilterInfo... filters)
-
addFilters
public DeploymentInfo addFilters(java.util.Collection<FilterInfo> filters)
-
getFilters
public java.util.Map<java.lang.String,FilterInfo> getFilters()
-
addFilterUrlMapping
public DeploymentInfo addFilterUrlMapping(java.lang.String filterName, java.lang.String mapping, jakarta.servlet.DispatcherType dispatcher)
-
addFilterServletNameMapping
public DeploymentInfo addFilterServletNameMapping(java.lang.String filterName, java.lang.String mapping, jakarta.servlet.DispatcherType dispatcher)
-
insertFilterUrlMapping
public DeploymentInfo insertFilterUrlMapping(int pos, java.lang.String filterName, java.lang.String mapping, jakarta.servlet.DispatcherType dispatcher)
-
insertFilterServletNameMapping
public DeploymentInfo insertFilterServletNameMapping(int pos, java.lang.String filterName, java.lang.String mapping, jakarta.servlet.DispatcherType dispatcher)
-
getFilterMappings
public java.util.List<FilterMappingInfo> getFilterMappings()
-
addListener
public DeploymentInfo addListener(ListenerInfo listener)
-
addListeners
public DeploymentInfo addListeners(ListenerInfo... listeners)
-
addListeners
public DeploymentInfo addListeners(java.util.Collection<ListenerInfo> listeners)
-
getListeners
public java.util.List<ListenerInfo> getListeners()
-
getMajorVersion
public int getMajorVersion()
-
setMajorVersion
public DeploymentInfo setMajorVersion(int majorVersion)
-
getMinorVersion
public int getMinorVersion()
-
setMinorVersion
public DeploymentInfo setMinorVersion(int minorVersion)
-
addServletContainerInitializer
public DeploymentInfo addServletContainerInitializer(ServletContainerInitializerInfo servletContainerInitializer)
-
addServletContainerInitalizer
@Deprecated public DeploymentInfo addServletContainerInitalizer(ServletContainerInitializerInfo servletContainerInitializer)
Deprecated.
-
addServletContainerInitializers
public DeploymentInfo addServletContainerInitializers(ServletContainerInitializerInfo... servletContainerInitializer)
-
addServletContainerInitalizers
@Deprecated public DeploymentInfo addServletContainerInitalizers(ServletContainerInitializerInfo... servletContainerInitializer)
Deprecated.
-
addServletContainerInitializers
public DeploymentInfo addServletContainerInitializers(java.util.List<ServletContainerInitializerInfo> servletContainerInitializer)
-
addServletContainerInitalizers
@Deprecated public DeploymentInfo addServletContainerInitalizers(java.util.List<ServletContainerInitializerInfo> servletContainerInitializers)
Deprecated.
-
getServletContainerInitializers
public java.util.List<ServletContainerInitializerInfo> getServletContainerInitializers()
-
addThreadSetupAction
@Deprecated public DeploymentInfo addThreadSetupAction(ThreadSetupAction action)
Deprecated.
-
addThreadSetupAction
public DeploymentInfo addThreadSetupAction(ThreadSetupHandler action)
-
getThreadSetupActions
public java.util.List<ThreadSetupHandler> getThreadSetupActions()
-
isEagerFilterInit
public boolean isEagerFilterInit()
-
setEagerFilterInit
public DeploymentInfo setEagerFilterInit(boolean eagerFilterInit)
-
addInitParameter
public DeploymentInfo addInitParameter(java.lang.String name, java.lang.String value)
-
getInitParameters
public java.util.Map<java.lang.String,java.lang.String> getInitParameters()
-
addServletContextAttribute
public DeploymentInfo addServletContextAttribute(java.lang.String name, java.lang.Object value)
-
getServletContextAttributes
public java.util.Map<java.lang.String,java.lang.Object> getServletContextAttributes()
-
addWelcomePage
public DeploymentInfo addWelcomePage(java.lang.String welcomePage)
-
addWelcomePages
public DeploymentInfo addWelcomePages(java.lang.String... welcomePages)
-
addWelcomePages
public DeploymentInfo addWelcomePages(java.util.Collection<java.lang.String> welcomePages)
-
getWelcomePages
public java.util.List<java.lang.String> getWelcomePages()
-
addErrorPage
public DeploymentInfo addErrorPage(ErrorPage errorPage)
-
addErrorPages
public DeploymentInfo addErrorPages(ErrorPage... errorPages)
-
addErrorPages
public DeploymentInfo addErrorPages(java.util.Collection<ErrorPage> errorPages)
-
getErrorPages
public java.util.List<ErrorPage> getErrorPages()
-
addMimeMapping
public DeploymentInfo addMimeMapping(MimeMapping mimeMappings)
-
addMimeMappings
public DeploymentInfo addMimeMappings(MimeMapping... mimeMappings)
-
addMimeMappings
public DeploymentInfo addMimeMappings(java.util.Collection<MimeMapping> mimeMappings)
-
getMimeMappings
public java.util.List<MimeMapping> getMimeMappings()
-
addSecurityConstraint
public DeploymentInfo addSecurityConstraint(SecurityConstraint securityConstraint)
-
addSecurityConstraints
public DeploymentInfo addSecurityConstraints(SecurityConstraint... securityConstraints)
-
addSecurityConstraints
public DeploymentInfo addSecurityConstraints(java.util.Collection<SecurityConstraint> securityConstraints)
-
getSecurityConstraints
public java.util.List<SecurityConstraint> getSecurityConstraints()
-
getExecutor
public java.util.concurrent.Executor getExecutor()
-
setExecutor
public DeploymentInfo setExecutor(java.util.concurrent.Executor executor)
Sets the executor that will be used to run servlet invocations. If this is null then the XNIO worker pool will be used.Individual servlets may use a different executor
If this is null then the current executor is used, which is generally the XNIO worker pool
- Parameters:
executor
- The executor- See Also:
ServletInfo.executor
-
getAsyncExecutor
public java.util.concurrent.Executor getAsyncExecutor()
-
setAsyncExecutor
public DeploymentInfo setAsyncExecutor(java.util.concurrent.Executor asyncExecutor)
Sets the executor that is used to run async tasks.If this is null then
executor
is used, if this is also null then the default is used- Parameters:
asyncExecutor
- The executor
-
getTempDir
public java.io.File getTempDir()
-
getTempPath
public java.nio.file.Path getTempPath()
-
requireTempPath
public java.nio.file.Path requireTempPath()
- 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 propertyjava.io.tmpdir
-
setTempDir
public DeploymentInfo setTempDir(java.io.File tempDir)
-
setTempDir
public DeploymentInfo setTempDir(java.nio.file.Path tempDir)
-
isIgnoreFlush
public boolean isIgnoreFlush()
-
setIgnoreFlush
public DeploymentInfo setIgnoreFlush(boolean ignoreFlush)
-
getJspConfigDescriptor
public jakarta.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor()
-
setJspConfigDescriptor
public DeploymentInfo setJspConfigDescriptor(jakarta.servlet.descriptor.JspConfigDescriptor jspConfigDescriptor)
-
getDefaultServletConfig
public DefaultServletConfig getDefaultServletConfig()
-
setDefaultServletConfig
public DeploymentInfo setDefaultServletConfig(DefaultServletConfig defaultServletConfig)
-
addLocaleCharsetMapping
public DeploymentInfo addLocaleCharsetMapping(java.lang.String locale, java.lang.String charset)
-
getLocaleCharsetMapping
public java.util.Map<java.lang.String,java.lang.String> getLocaleCharsetMapping()
-
getSessionManagerFactory
public SessionManagerFactory getSessionManagerFactory()
-
setSessionManagerFactory
public DeploymentInfo setSessionManagerFactory(SessionManagerFactory sessionManagerFactory)
-
getLoginConfig
public LoginConfig getLoginConfig()
-
setLoginConfig
public DeploymentInfo setLoginConfig(LoginConfig loginConfig)
-
getIdentityManager
public io.undertow.security.idm.IdentityManager getIdentityManager()
-
setIdentityManager
public DeploymentInfo setIdentityManager(io.undertow.security.idm.IdentityManager identityManager)
-
getConfidentialPortManager
public ConfidentialPortManager getConfidentialPortManager()
-
setConfidentialPortManager
public DeploymentInfo setConfidentialPortManager(ConfidentialPortManager confidentialPortManager)
-
addSecurityRole
public DeploymentInfo addSecurityRole(java.lang.String role)
-
addSecurityRoles
public DeploymentInfo addSecurityRoles(java.lang.String... roles)
-
addSecurityRoles
public DeploymentInfo addSecurityRoles(java.util.Collection<java.lang.String> roles)
-
getSecurityRoles
public java.util.Set<java.lang.String> getSecurityRoles()
-
addOuterHandlerChainWrapper
public DeploymentInfo addOuterHandlerChainWrapper(io.undertow.server.HandlerWrapper wrapper)
Adds an outer handler wrapper. This handler will be run after the servlet initial handler, but before any other handlers. These are only run on REQUEST invocations, they are not invoked on a FORWARD or INCLUDE.- Parameters:
wrapper
- The wrapper
-
getOuterHandlerChainWrappers
public java.util.List<io.undertow.server.HandlerWrapper> getOuterHandlerChainWrappers()
-
addInnerHandlerChainWrapper
public DeploymentInfo addInnerHandlerChainWrapper(io.undertow.server.HandlerWrapper wrapper)
Adds an inner handler chain wrapper. This handler will be run after the security handler, but before any other servlet handlers, and will be run for every request- Parameters:
wrapper
- The wrapper
-
getInnerHandlerChainWrappers
public java.util.List<io.undertow.server.HandlerWrapper> getInnerHandlerChainWrappers()
-
addInitialHandlerChainWrapper
public DeploymentInfo addInitialHandlerChainWrapper(io.undertow.server.HandlerWrapper wrapper)
-
getInitialHandlerChainWrappers
public java.util.List<io.undertow.server.HandlerWrapper> getInitialHandlerChainWrappers()
-
setInitialSecurityWrapper
public DeploymentInfo setInitialSecurityWrapper(io.undertow.server.HandlerWrapper wrapper)
Sets the initial handler wrapper that will take over responsibility for establishing a security context that will handle authentication for the request. Undertow specific authentication mechanisms will not be installed but Undertow handlers will still make the decision as to if authentication is required and will subsequently callSecurityContext.authenticate()
as required.- Parameters:
wrapper
- theHandlerWrapper
to handle the initial security context installation.- Returns:
this
to allow chaining.
-
getInitialSecurityWrapper
public io.undertow.server.HandlerWrapper getInitialSecurityWrapper()
-
addSecurityWrapper
public DeploymentInfo addSecurityWrapper(io.undertow.server.HandlerWrapper wrapper)
Adds a security handler. These are invoked before the authentication mechanism, and are always invoked even if authentication is not required.- Parameters:
wrapper
-- Returns:
-
getSecurityWrappers
public java.util.List<io.undertow.server.HandlerWrapper> getSecurityWrappers()
-
addNotificationReceiver
public DeploymentInfo addNotificationReceiver(io.undertow.security.api.NotificationReceiver notificationReceiver)
-
addNotificactionReceivers
public DeploymentInfo addNotificactionReceivers(io.undertow.security.api.NotificationReceiver... notificationReceivers)
-
addNotificationReceivers
public DeploymentInfo addNotificationReceivers(java.util.Collection<io.undertow.security.api.NotificationReceiver> notificationReceivers)
-
getNotificationReceivers
public java.util.List<io.undertow.security.api.NotificationReceiver> getNotificationReceivers()
-
getServletContextAttributeBackingMap
public java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> getServletContextAttributeBackingMap()
-
setServletContextAttributeBackingMap
public DeploymentInfo setServletContextAttributeBackingMap(java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> servletContextAttributeBackingMap)
Sets the map that will be used by the ServletContext implementation to store attributes.This should usuablly be null, in which case Undertow will create a new map. This is only used in situations where you want multiple deployments to share the same servlet context attributes.
- Parameters:
servletContextAttributeBackingMap
- The backing map
-
getServletSessionConfig
public ServletSessionConfig getServletSessionConfig()
-
setServletSessionConfig
public DeploymentInfo setServletSessionConfig(ServletSessionConfig servletSessionConfig)
-
getHostName
public java.lang.String getHostName()
- Returns:
- the host name
-
setHostName
public DeploymentInfo setHostName(java.lang.String hostName)
-
isDenyUncoveredHttpMethods
public boolean isDenyUncoveredHttpMethods()
-
setDenyUncoveredHttpMethods
public DeploymentInfo setDenyUncoveredHttpMethods(boolean denyUncoveredHttpMethods)
-
getServletStackTraces
public ServletStackTraces getServletStackTraces()
-
setServletStackTraces
public DeploymentInfo setServletStackTraces(ServletStackTraces servletStackTraces)
-
isInvalidateSessionOnLogout
public boolean isInvalidateSessionOnLogout()
-
setInvalidateSessionOnLogout
public DeploymentInfo setInvalidateSessionOnLogout(boolean invalidateSessionOnLogout)
-
getDefaultCookieVersion
public int getDefaultCookieVersion()
-
setDefaultCookieVersion
public DeploymentInfo setDefaultCookieVersion(int defaultCookieVersion)
-
getSessionPersistenceManager
public SessionPersistenceManager getSessionPersistenceManager()
-
setSessionPersistenceManager
public DeploymentInfo setSessionPersistenceManager(SessionPersistenceManager sessionPersistenceManager)
-
getAuthorizationManager
public AuthorizationManager getAuthorizationManager()
-
setAuthorizationManager
public DeploymentInfo setAuthorizationManager(AuthorizationManager authorizationManager)
-
addPrincipalVsRoleMapping
public DeploymentInfo addPrincipalVsRoleMapping(java.lang.String principal, java.lang.String mapping)
-
addPrincipalVsRoleMappings
public DeploymentInfo addPrincipalVsRoleMappings(java.lang.String principal, java.lang.String... mappings)
-
addPrincipalVsRoleMappings
public DeploymentInfo addPrincipalVsRoleMappings(java.lang.String principal, java.util.Collection<java.lang.String> mappings)
-
getPrincipalVersusRolesMap
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getPrincipalVersusRolesMap()
-
clearLoginMethods
public DeploymentInfo clearLoginMethods()
Removes all configured authentication mechanisms from the deployment.- Returns:
- this deployment info
-
addFirstAuthenticationMechanism
public DeploymentInfo addFirstAuthenticationMechanism(java.lang.String name, io.undertow.security.api.AuthenticationMechanism mechanism)
Adds an authentication mechanism directly to the deployment. This mechanism will be first in the list. In general you should just useaddAuthenticationMechanism(String, io.undertow.security.api.AuthenticationMechanismFactory)
and allow the user to configure the methods they want by name. This method is essentially a convenience method, if is the same as registering a factory under the provided name that returns and authentication mechanism, and then adding it to the login config list. If you want your mechanism to be the only one in the deployment you should first invokeclearLoginMethods()
.- Parameters:
name
- The authentication mechanism namemechanism
- The mechanism- Returns:
- this deployment info
-
addLastAuthenticationMechanism
public DeploymentInfo addLastAuthenticationMechanism(java.lang.String name, io.undertow.security.api.AuthenticationMechanism mechanism)
Adds an authentication mechanism directly to the deployment. This mechanism will be last in the list. In general you should just useaddAuthenticationMechanism(String, io.undertow.security.api.AuthenticationMechanismFactory)
and allow the user to configure the methods they want by name. This method is essentially a convenience method, if is the same as registering a factory under the provided name that returns and authentication mechanism, and then adding it to the login config list. If you want your mechanism to be the only one in the deployment you should first invokeclearLoginMethods()
.- Parameters:
name
- The authentication mechanism namemechanism
- The mechanism- Returns:
-
addAuthenticationMechanism
public DeploymentInfo addAuthenticationMechanism(java.lang.String name, io.undertow.security.api.AuthenticationMechanismFactory factory)
Adds an authentication mechanism. The name is case insenstive, and will be converted to uppercase internally.- Parameters:
name
- The namefactory
- The factory- Returns:
-
getAuthenticationMechanisms
public java.util.Map<java.lang.String,io.undertow.security.api.AuthenticationMechanismFactory> getAuthenticationMechanisms()
-
isAuthenticationMechanismPresent
public boolean isAuthenticationMechanismPresent(java.lang.String mechanismName)
Returns true if the specified mechanism is present in the login config- Parameters:
mechanismName
- The mechanism name- Returns:
- true if the mechanism is enabled
-
addServletExtension
public DeploymentInfo addServletExtension(ServletExtension servletExtension)
Adds an additional servlet extension to the deployment. Servlet extensions are generally discovered using META-INF/services entries, however this may not be practical in all environments.- Parameters:
servletExtension
- The servlet extension- Returns:
- this
-
getServletExtensions
public java.util.List<ServletExtension> getServletExtensions()
-
getJaspiAuthenticationMechanism
public io.undertow.security.api.AuthenticationMechanism getJaspiAuthenticationMechanism()
-
setJaspiAuthenticationMechanism
public DeploymentInfo setJaspiAuthenticationMechanism(io.undertow.security.api.AuthenticationMechanism jaspiAuthenticationMechanism)
-
getSecurityContextFactory
public io.undertow.security.api.SecurityContextFactory getSecurityContextFactory()
-
setSecurityContextFactory
public DeploymentInfo setSecurityContextFactory(io.undertow.security.api.SecurityContextFactory securityContextFactory)
-
getServerName
public java.lang.String getServerName()
-
setServerName
public DeploymentInfo setServerName(java.lang.String serverName)
-
setMetricsCollector
public DeploymentInfo setMetricsCollector(MetricsCollector metricsCollector)
-
getMetricsCollector
public MetricsCollector getMetricsCollector()
-
getSessionConfigWrapper
public SessionConfigWrapper getSessionConfigWrapper()
-
setSessionConfigWrapper
public DeploymentInfo setSessionConfigWrapper(SessionConfigWrapper sessionConfigWrapper)
-
isDisableCachingForSecuredPages
public boolean isDisableCachingForSecuredPages()
-
setDisableCachingForSecuredPages
public DeploymentInfo setDisableCachingForSecuredPages(boolean disableCachingForSecuredPages)
-
addLifecycleInterceptor
public DeploymentInfo addLifecycleInterceptor(LifecycleInterceptor interceptor)
-
getLifecycleInterceptors
public java.util.List<LifecycleInterceptor> getLifecycleInterceptors()
-
getExceptionHandler
public ExceptionHandler getExceptionHandler()
Returns the exception handler that is used by this deployment. By default this will simply log unhandled exceptions
-
setExceptionHandler
public DeploymentInfo setExceptionHandler(ExceptionHandler exceptionHandler)
Sets the default exception handler for this deployment- Parameters:
exceptionHandler
- The exception handler- Returns:
-
isEscapeErrorMessage
public boolean isEscapeErrorMessage()
-
setEscapeErrorMessage
public DeploymentInfo setEscapeErrorMessage(boolean escapeErrorMessage)
Set if if the message passed toHttpServletResponse.sendError(int, String)
should be escaped. If this is false applications must be careful not to use user provided data (such as the URI) in the message- Parameters:
escapeErrorMessage
- If the error message should be escaped
-
addSessionListener
public DeploymentInfo addSessionListener(io.undertow.server.session.SessionListener sessionListener)
-
getSessionListeners
public java.util.List<io.undertow.server.session.SessionListener> getSessionListeners()
-
getAuthenticationMode
public io.undertow.security.api.AuthenticationMode getAuthenticationMode()
-
setAuthenticationMode
public DeploymentInfo setAuthenticationMode(io.undertow.security.api.AuthenticationMode 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. Pro active auth means that requests for unprotected resources will still be associated with a user, which may be useful for access logging.- Parameters:
authenticationMode
- The authentication mode to use- Returns:
-
getDefaultMultipartConfig
public jakarta.servlet.MultipartConfigElement getDefaultMultipartConfig()
-
setDefaultMultipartConfig
public DeploymentInfo setDefaultMultipartConfig(jakarta.servlet.MultipartConfigElement defaultMultipartConfig)
-
getContentTypeCacheSize
public int getContentTypeCacheSize()
-
setContentTypeCacheSize
public DeploymentInfo setContentTypeCacheSize(int contentTypeCacheSize)
-
getSessionIdGenerator
public io.undertow.server.session.SessionIdGenerator getSessionIdGenerator()
-
setSessionIdGenerator
public DeploymentInfo setSessionIdGenerator(io.undertow.server.session.SessionIdGenerator sessionIdGenerator)
-
isSendCustomReasonPhraseOnError
public boolean isSendCustomReasonPhraseOnError()
-
getCrawlerSessionManagerConfig
public CrawlerSessionManagerConfig getCrawlerSessionManagerConfig()
-
setCrawlerSessionManagerConfig
public DeploymentInfo setCrawlerSessionManagerConfig(CrawlerSessionManagerConfig crawlerSessionManagerConfig)
-
setSendCustomReasonPhraseOnError
public DeploymentInfo setSendCustomReasonPhraseOnError(boolean sendCustomReasonPhraseOnError)
If this is true then the message parameter ofHttpServletResponse.sendError(int, String)
andjakarta.servlet.http.HttpServletResponse#setStatus(int, String)
will be used as the HTTP reason phrase in the response.- Parameters:
sendCustomReasonPhraseOnError
- If the parameter to sendError should be used as a HTTP reason phrase- Returns:
- this
-
isChangeSessionIdOnLogin
public boolean isChangeSessionIdOnLogin()
-
setChangeSessionIdOnLogin
public DeploymentInfo setChangeSessionIdOnLogin(boolean changeSessionIdOnLogin)
-
isUseCachedAuthenticationMechanism
public boolean isUseCachedAuthenticationMechanism()
-
setUseCachedAuthenticationMechanism
public DeploymentInfo setUseCachedAuthenticationMechanism(boolean useCachedAuthenticationMechanism)
If this is set to false the the cached authenticated session mechanism won't be installed. If you want FORM and other auth methods that require caching to work then you need to install another caching based auth method (such as SSO).- Parameters:
useCachedAuthenticationMechanism
- If Undertow should use its internal authentication cache mechanism- Returns:
- this
-
isSecurityDisabled
public boolean isSecurityDisabled()
-
setSecurityDisabled
public DeploymentInfo setSecurityDisabled(boolean securityDisabled)
-
isCheckOtherSessionManagers
public boolean isCheckOtherSessionManagers()
-
setCheckOtherSessionManagers
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. If it does then the session id will be re-used.
-
getDefaultRequestEncoding
public java.lang.String getDefaultRequestEncoding()
-
setDefaultRequestEncoding
public DeploymentInfo setDefaultRequestEncoding(java.lang.String defaultRequestEncoding)
-
getDefaultResponseEncoding
public java.lang.String getDefaultResponseEncoding()
-
setDefaultResponseEncoding
public DeploymentInfo setDefaultResponseEncoding(java.lang.String defaultResponseEncoding)
-
addPreCompressedResourceEncoding
public DeploymentInfo addPreCompressedResourceEncoding(java.lang.String encoding, java.lang.String extension)
Adds a pre compressed resource encoding and maps it to a file extension- Parameters:
encoding
- The content encodingextension
- The file extension- Returns:
- this builder
-
getPreCompressedResources
public java.util.Map<java.lang.String,java.lang.String> getPreCompressedResources()
-
getContainerMajorVersion
public int getContainerMajorVersion()
-
setContainerMajorVersion
public DeploymentInfo setContainerMajorVersion(int containerMajorVersion)
-
getContainerMinorVersion
public int getContainerMinorVersion()
-
setContainerMinorVersion
public DeploymentInfo setContainerMinorVersion(int containerMinorVersion)
-
isPreservePathOnForward
public boolean isPreservePathOnForward()
-
setPreservePathOnForward
public void setPreservePathOnForward(boolean preservePathOnForward)
-
addDeploymentCompleteListener
public DeploymentInfo addDeploymentCompleteListener(jakarta.servlet.ServletContextListener servletContextListener)
Add's a listener that is only invoked once all other deployment steps have been completed The listenerscontextDestroyed
method will be called after all undeployment steps are undertaken- Parameters:
servletContextListener
-- Returns:
-
getDeploymentCompleteListeners
public java.util.List<jakarta.servlet.ServletContextListener> getDeploymentCompleteListeners()
-
isOrphanSessionAllowed
public boolean isOrphanSessionAllowed()
-
setOrphanSessionAllowed
public void setOrphanSessionAllowed(boolean allowOrphanSession)
-
clone
public DeploymentInfo clone()
- Overrides:
clone
in classjava.lang.Object
-
-