Packages

abstract class Filter[-ReqIn, +RepOut, +ReqOut, -RepIn] extends (ReqIn, Service[ReqOut, RepIn]) ⇒ Future[RepOut]

A Filter acts as a decorator/transformer of a service. It may apply transformations to the input and output of that service:

          (*  MyService  *)
[ReqIn -> (ReqOut -> RepIn) -> RepOut]

For example, you may have a service that takes Strings and parses them as Ints. If you want to expose this as a Network Service via Thrift, it is nice to isolate the protocol handling from the business rules. Hence you might have a Filter that converts back and forth between Thrift structs. Again, your service deals with plain objects:

[ThriftIn -> (String  ->  Int) -> ThriftOut]

Thus, a Filter[A, B, C, D] converts a Service[C, D] to a Service[A, B]. In other words, it converts a Service[ReqOut, RepIn] to a Service[ReqIn, RepOut].

See also

The user guide for details and examples.

Linear Supertypes
(ReqIn, Service[ReqOut, RepIn]) ⇒ Future[RepOut], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Filter
  2. Function2
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Filter()

Abstract Value Members

  1. abstract def apply(request: ReqIn, service: Service[ReqOut, RepIn]): Future[RepOut]

    This is the method to override/implement to create your own Filter.

    This is the method to override/implement to create your own Filter.

    request

    the input request type

    service

    a service that takes the output request type and the input response type

    Definition Classes
    Filter → Function2

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def agnosticAndThen(next: TypeAgnostic): Filter[ReqIn, RepOut, ReqOut, RepIn]

    Convert the Filter.TypeAgnostic filter to a Filter and chain it with andThen.

  5. def andThen(factory: ServiceFactory[ReqOut, RepIn]): ServiceFactory[ReqIn, RepOut]

    Terminates a filter chain in a ServiceFactory.

    Terminates a filter chain in a ServiceFactory. For example,

    myFilter.andThen(myServiceFactory)
    factory

    a service factory that takes the output request type and the input response type.

  6. def andThen(service: Service[ReqOut, RepIn]): Service[ReqIn, RepOut]

    Terminates a filter chain in a Service.

    Terminates a filter chain in a Service. For example,

    myFilter.andThen(myService)
    service

    a service that takes the output request type and the input response type.

  7. def andThen[Req2, Rep2](next: Filter[ReqOut, RepIn, Req2, Rep2]): Filter[ReqIn, RepOut, Req2, Rep2]

    Chains a series of filters together:

    Chains a series of filters together:

    myModularService = handleExceptions.andThen(thrift2Pojo.andThen(parseString))
    next

    another filter to follow after this one

    Note

    synchronously thrown exceptions in the underlying service are automatically lifted into Future.exception.

  8. def andThenIf[Req2 >: ReqOut, Rep2 <: RepIn](condAndFilter: (Boolean, Filter[ReqOut, RepIn, Req2, Rep2])): Filter[ReqIn, RepOut, Req2, Rep2]

    Conditionally propagates requests down the filter chain.

    Conditionally propagates requests down the filter chain. This may useful if you are statically wiring together filter chains based on a configuration file, for instance.

    condAndFilter

    a tuple of boolean and filter.

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def curried: (ReqIn) ⇒ (Service[ReqOut, RepIn]) ⇒ Future[RepOut]
    Definition Classes
    Function2
    Annotations
    @unspecialized()
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    Function2 → AnyRef → Any
  23. def tupled: ((ReqIn, Service[ReqOut, RepIn])) ⇒ Future[RepOut]
    Definition Classes
    Function2
    Annotations
    @unspecialized()
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from (ReqIn, Service[ReqOut, RepIn]) ⇒ Future[RepOut]

Inherited from AnyRef

Inherited from Any

Ungrouped