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 a Finatra Http service.

    A typical collection of filters for a Finatra Http service. Ordering of filters is important.

    HttpNackFilter converts Finagle's nacks into HttpExceptions. This must come below the ExceptionMappingFilter or else that will convert them to generic 500s.

    Annotations
    @Singleton()
  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

    Finatra's exception handling/mapping conflicts with Finagle's internal signaling mechanisms.

    Finatra's exception handling/mapping conflicts with Finagle's internal signaling mechanisms. This filter converts Finagle nack exceptions into Finatra's HttpExceptions which can be handled appropriately by the ExceptionMapper

    Annotations
    @Singleton()
  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