Package

com.twitter.finatra.http

filters

Permalink

package filters

Visibility
  1. Public
  2. All

Type Members

  1. class AccessLoggingFilter[R <: Request] extends SimpleFilter[R, Response] with Logging

    Permalink

    Provides a standard "Access Log" -- a list of all requests through this Filter.

    Provides a standard "Access Log" -- a list of all requests through this Filter. Typically, this Filter is provided by the com.twitter.finatra.http.modules.AccessLogModule which provides an implementation for the LogFormatter param as an instance of com.twitter.finagle.http.filter.CommonLogFormatter.

    Usage: To use, configure a logger (with your preferred logging implementation) over this class that writes to a specific file (usually named, access.log).

    R

    - "Request" type param which must be a subtype of com.twitter.finagle.http.Request.

    Annotations
    @Singleton()
    Note

    This Filter is included in the Finatra com.twitter.finatra.http.filters.CommonFilters.

    ,

    This Filter should occur as early in the Filter chain as possible such that it is "above" the ExceptionMappingFilter as it is expected that servicing requests with this Filter will always return a com.twitter.finagle.http.Response.

    See also

    com.twitter.finagle.http.filter.CommonLogFormatter

    com.twitter.finagle.filter.LogFormatter

    com.twitter.finatra.http.modules.AccessLogModule

    com.twitter.finatra.http.filters.ExceptionMappingFilter

    com.twitter.finatra.http.filters.CommonFilters

  2. class CommonFilters extends MergedFilter[Request, Response]

    Permalink

    A typical collection of Filters for HTTP services.

    A typical collection of Filters for HTTP services. Ordering of Filters is important.

    Annotations
    @Singleton()
    Note

    HttpNackFilter converts Finagle's nacks into HttpNackExceptions. This Filter MUST come "below" the ExceptionMappingFilter otherwise the HttpNackExceptions will not be properly converted into a meaningful HTTP response.

    ,

    Filter ordering is determined by the implementation of MergedFilter and can be read as Requests enter the top Filter and progress down, Responses traverse in the opposite manner from the bottom up.

  3. class ExceptionMappingFilter[R <: Request] extends SimpleFilter[R, Response]

    Permalink

    Filter which converts exceptions into HTTP responses.

    Filter which converts exceptions into HTTP responses. NOTE: Should be as close to the start of the filter chain as possible.

    Annotations
    @Singleton()
  4. class HttpNackFilter[R <: Request] extends SimpleFilter[R, Response]

    Permalink

    This Filter converts Finagle nacks into HttpNackExceptions to be handled by a registered ExceptionMapper[HttpNackException].

    This Filter converts Finagle nacks into HttpNackExceptions to be handled by a registered ExceptionMapper[HttpNackException]. A "nack" is a Negative ACKnowledgement. Responding with a nack is one way a service may exert back pressure.

    Annotations
    @Singleton()
    See also

    Finagle NACK

    Finagle HttpNackFilter

    com.twitter.finatra.http.internal.exceptions.HttpNackExceptionMapper

  5. class HttpResponseFilter[R <: Request] extends SimpleFilter[R, Response]

    Permalink

    HttpResponseFilter does the following: - sets the 'Server' and 'Date' response headers - turns a 'partial' Location header into a full URL

    HttpResponseFilter does the following: - sets the 'Server' and 'Date' response headers - turns a 'partial' Location header into a full URL

    Annotations
    @Singleton()
  6. class LoggingMDCFilter[Req, Rep] extends SimpleFilter[Req, Rep]

    Permalink
    Annotations
    @Singleton()
  7. class StatsFilter[R <: Request] extends SimpleFilter[R, Response] with Logging

    Permalink

    A drop-in replacement for com.twitter.finagle.http.filter.StatsFilter with per-route stats scoped under route/<name>/<method>.

    A drop-in replacement for com.twitter.finagle.http.filter.StatsFilter with per-route stats scoped under route/<name>/<method>.

    Annotations
    @Singleton()
  8. class TraceIdMDCFilter[Req, Rep] extends SimpleFilter[Req, Rep]

    Permalink

    Note: Any MDC filter must be used in conjunction with the LoggingMDCFilter to ensure that diagnostic context is properly managed.

    Note: Any MDC filter must be used in conjunction with the LoggingMDCFilter to ensure that diagnostic context is properly managed.

    Annotations
    @Singleton()

Value Members

  1. object StatsFilter

    Permalink

Ungrouped