Class AbstractHttp11Protocol<S>

All Implemented Interfaces:
MBeanRegistration, ProtocolHandler
Direct Known Subclasses:
Http11Nio2Protocol, Http11NioProtocol

public abstract class AbstractHttp11Protocol<S> extends AbstractProtocol<S>
  • Field Details

  • Constructor Details

    • AbstractHttp11Protocol

      public AbstractHttp11Protocol(AbstractEndpoint<S,?> endpoint)
  • Method Details

    • init

      public void init() throws Exception
      Description copied from interface: ProtocolHandler
      Initialise the protocol.
      Specified by:
      init in interface ProtocolHandler
      init in class AbstractProtocol<S>
      Exception - If the protocol handler fails to initialise
    • destroy

      public void destroy() throws Exception
      Description copied from interface: ProtocolHandler
      Destroy the protocol (optional).
      Specified by:
      destroy in interface ProtocolHandler
      destroy in class AbstractProtocol<S>
      Exception - If the protocol handler fails to destroy
    • getProtocolName

      protected String getProtocolName()
      Description copied from class: AbstractProtocol
      Obtain the name of the protocol, (Http, Ajp, etc.). Used with JMX.
      Specified by:
      getProtocolName in class AbstractProtocol<S>
      the protocol name
    • getEndpoint

      protected AbstractEndpoint<S,?> getEndpoint()

      Over-ridden here to make the method visible to nested classes.

      getEndpoint in class AbstractProtocol<S>
    • getContinueResponseTiming

      public String getContinueResponseTiming()
    • setContinueResponseTiming

      public void setContinueResponseTiming(String continueResponseTiming)
    • getContinueResponseTimingInternal

      public ContinueResponseTiming getContinueResponseTimingInternal()
    • getUseKeepAliveResponseHeader

      public boolean getUseKeepAliveResponseHeader()
    • setUseKeepAliveResponseHeader

      public void setUseKeepAliveResponseHeader(boolean useKeepAliveResponseHeader)
    • getRelaxedPathChars

      public String getRelaxedPathChars()
    • setRelaxedPathChars

      public void setRelaxedPathChars(String relaxedPathChars)
    • getRelaxedQueryChars

      public String getRelaxedQueryChars()
    • setRelaxedQueryChars

      public void setRelaxedQueryChars(String relaxedQueryChars)
    • getMaxSavePostSize

      public int getMaxSavePostSize()
      Return the maximum size of the post which will be saved during FORM or CLIENT-CERT authentication.
      The size in bytes
    • setMaxSavePostSize

      public void setMaxSavePostSize(int maxSavePostSize)
      Set the maximum size of a POST which will be buffered during FORM or CLIENT-CERT authentication. When a POST is received where the security constraints require a client certificate, the POST body needs to be buffered while an SSL handshake takes place to obtain the certificate. A similar buffering is required during FORM auth.
      maxSavePostSize - The maximum size POST body to buffer in bytes
    • getMaxHttpHeaderSize

      public int getMaxHttpHeaderSize()
    • setMaxHttpHeaderSize

      public void setMaxHttpHeaderSize(int valueI)
    • getMaxHttpRequestHeaderSize

      public int getMaxHttpRequestHeaderSize()
    • setMaxHttpRequestHeaderSize

      public void setMaxHttpRequestHeaderSize(int valueI)
    • getMaxHttpResponseHeaderSize

      public int getMaxHttpResponseHeaderSize()
    • setMaxHttpResponseHeaderSize

      public void setMaxHttpResponseHeaderSize(int valueI)
    • getConnectionUploadTimeout

      public int getConnectionUploadTimeout()
      Specifies a different (usually longer) connection timeout during data upload. Default is 5 minutes as in Apache HTTPD server.
      The timeout in milliseconds
    • setConnectionUploadTimeout

      public void setConnectionUploadTimeout(int timeout)
      Set the upload timeout.
      timeout - Upload timeout in milliseconds
    • getDisableUploadTimeout

      public boolean getDisableUploadTimeout()
      Get the flag that controls upload time-outs. If true, the connectionUploadTimeout will be ignored and the regular socket timeout will be used for the full duration of the connection.
      true if the separate upload timeout is disabled
    • setDisableUploadTimeout

      public void setDisableUploadTimeout(boolean isDisabled)
      Set the flag to control whether a separate connection timeout is used during upload of a request body.
      isDisabled - true if the separate upload timeout should be disabled
    • setCompression

      public void setCompression(String compression)
    • getCompression

      public String getCompression()
    • getCompressionLevel

      protected int getCompressionLevel()
    • getNoCompressionUserAgents

      public String getNoCompressionUserAgents()
    • getNoCompressionUserAgentsPattern

      protected Pattern getNoCompressionUserAgentsPattern()
    • setNoCompressionUserAgents

      public void setNoCompressionUserAgents(String noCompressionUserAgents)
    • getCompressibleMimeType

      public String getCompressibleMimeType()
    • setCompressibleMimeType

      public void setCompressibleMimeType(String valueS)
    • getCompressibleMimeTypes

      public String[] getCompressibleMimeTypes()
    • getCompressionMinSize

      public int getCompressionMinSize()
    • setCompressionMinSize

      public void setCompressionMinSize(int compressionMinSize)
    • useCompression

      public boolean useCompression(Request request, Response response)
    • getRestrictedUserAgents

      public String getRestrictedUserAgents()
      Get the string form of the regular expression that defines the User agents which should be restricted to HTTP/1.0 support.
      The regular expression as a String
    • getRestrictedUserAgentsPattern

      protected Pattern getRestrictedUserAgentsPattern()
    • setRestrictedUserAgents

      public void setRestrictedUserAgents(String restrictedUserAgents)
      Set restricted user agent list (which will downgrade the connector to HTTP/1.0 mode). Regular expression as supported by Pattern.
      restrictedUserAgents - The regular expression as supported by Pattern for the user agents e.g. "gorilla|desesplorer|tigrus"
    • getServer

      public String getServer()
    • setServer

      public void setServer(String server)
      Set the server header name.
      server - The new value to use for the server header
    • getServerRemoveAppProvidedValues

      public boolean getServerRemoveAppProvidedValues()
      Should application provider values for the HTTP Server header be removed. Note that if server is set, any application provided value will be over-ridden.
      true if application provided values should be removed, otherwise false
    • setServerRemoveAppProvidedValues

      public void setServerRemoveAppProvidedValues(boolean serverRemoveAppProvidedValues)
    • getMaxTrailerSize

      public int getMaxTrailerSize()
    • setMaxTrailerSize

      public void setMaxTrailerSize(int maxTrailerSize)
    • getMaxExtensionSize

      public int getMaxExtensionSize()
    • setMaxExtensionSize

      public void setMaxExtensionSize(int maxExtensionSize)
    • getMaxSwallowSize

      public int getMaxSwallowSize()
    • setMaxSwallowSize

      public void setMaxSwallowSize(int maxSwallowSize)
    • getSecure

      public boolean getSecure()
    • setSecure

      public void setSecure(boolean b)
    • setAllowedTrailerHeaders

      public void setAllowedTrailerHeaders(String commaSeparatedHeaders)
    • getAllowedTrailerHeadersInternal

      protected Set<String> getAllowedTrailerHeadersInternal()
    • isTrailerHeaderAllowed

      public boolean isTrailerHeaderAllowed(String headerName)
    • getAllowedTrailerHeaders

      public String getAllowedTrailerHeaders()
    • addAllowedTrailerHeader

      public void addAllowedTrailerHeader(String header)
    • removeAllowedTrailerHeader

      public void removeAllowedTrailerHeader(String header)
    • addUpgradeProtocol

      public void addUpgradeProtocol(UpgradeProtocol upgradeProtocol)
      Description copied from interface: ProtocolHandler
      Add a new protocol for used by HTTP/1.1 upgrade or ALPN.
      upgradeProtocol - the protocol
    • findUpgradeProtocols

      public UpgradeProtocol[] findUpgradeProtocols()
      Description copied from interface: ProtocolHandler
      Return all configured upgrade protocols.
      the protocols
    • getNegotiatedProtocol

      public UpgradeProtocol getNegotiatedProtocol(String negotiatedName)
      Description copied from class: AbstractProtocol
      Find a suitable handler for the protocol negotiated at the network layer.
      Specified by:
      getNegotiatedProtocol in class AbstractProtocol<S>
      negotiatedName - The name of the requested negotiated protocol.
      The instance where UpgradeProtocol.getAlpnName() matches the requested protocol
    • getUpgradeProtocol

      public UpgradeProtocol getUpgradeProtocol(String upgradedName)
      Description copied from class: AbstractProtocol
      Find a suitable handler for the protocol upgraded name specified. This is used for direct connection protocol selection.
      Specified by:
      getUpgradeProtocol in class AbstractProtocol<S>
      upgradedName - The name of the requested negotiated protocol.
      The instance where UpgradeProtocol.getAlpnName() matches the requested protocol
    • getUpgradeGroupInfo

      public UpgradeGroupInfo getUpgradeGroupInfo(String upgradeProtocol)
    • getONameForUpgrade

      public ObjectName getONameForUpgrade(String upgradeProtocol)
    • isSSLEnabled

      public boolean isSSLEnabled()
    • setSSLEnabled

      public void setSSLEnabled(boolean SSLEnabled)
    • getUseSendfile

      public boolean getUseSendfile()
    • setUseSendfile

      public void setUseSendfile(boolean useSendfile)
    • getMaxKeepAliveRequests

      public int getMaxKeepAliveRequests()
      The maximum number of requests which can be performed over a keep-alive connection. The default is the same as for Apache HTTP Server (100).
    • setMaxKeepAliveRequests

      public void setMaxKeepAliveRequests(int mkar)
      Set the maximum number of Keep-Alive requests to allow. This is to safeguard from DoS attacks. Setting to a negative value disables the limit.
      mkar - The new maximum number of Keep-Alive requests allowed
    • getDefaultSSLHostConfigName

      public String getDefaultSSLHostConfigName()
    • setDefaultSSLHostConfigName

      public void setDefaultSSLHostConfigName(String defaultSSLHostConfigName)
    • addSslHostConfig

      public void addSslHostConfig(SSLHostConfig sslHostConfig)
      Description copied from interface: ProtocolHandler
      Add a new SSL configuration for a virtual host.
      sslHostConfig - the configuration
    • findSslHostConfigs

      public SSLHostConfig[] findSslHostConfigs()
      Description copied from interface: ProtocolHandler
      Find all configured SSL virtual host configurations which will be used by SNI.
      the configurations
    • reloadSslHostConfigs

      public void reloadSslHostConfigs()
    • reloadSslHostConfig

      public void reloadSslHostConfig(String hostName)
    • getSslImplementationShortName

      protected String getSslImplementationShortName()
    • getSslImplementationName

      public String getSslImplementationName()
    • setSslImplementationName

      public void setSslImplementationName(String s)
    • getSniParseLimit

      public int getSniParseLimit()
    • setSniParseLimit

      public void setSniParseLimit(int sniParseLimit)
    • createProcessor

      protected abstract Processor createProcessor()
      Description copied from class: AbstractProtocol
      Create and configure a new Processor instance for the current protocol implementation.
      Specified by:
      createProcessor in class AbstractProtocol<S>
      A fully configured Processor instance that is ready to use
    • createUpgradeProcessor

      protected Processor createUpgradeProcessor(SocketWrapperBase<?> socket, UpgradeToken upgradeToken)
      Specified by:
      createUpgradeProcessor in class AbstractProtocol<S>