Packages

package server

Content Hierarchy
Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package directives

Type Members

  1. abstract class AllDirectives extends FramedEntityStreamingDirectives
  2. trait AuthenticationFailedRejection extends Rejection

    Rejection created by the various pekko.http.javadsl.server.directives.SecurityDirectives.

    Rejection created by the various pekko.http.javadsl.server.directives.SecurityDirectives. Signals that the request was rejected because the user could not be authenticated. The reason for the rejection is specified in the cause.

    Annotations
    @DoNotInherit()
  3. trait AuthorizationFailedRejection extends Rejection

    Rejection created by the 'authorize' directive.

    Rejection created by the 'authorize' directive. Signals that the request was rejected because the user is not authorized.

    Annotations
    @DoNotInherit()
  4. trait CircuitBreakerOpenRejection extends Rejection

    Rejection created by the onCompleteWithBreaker directive.

    Rejection created by the onCompleteWithBreaker directive. Signals that the request was rejected because the supplied circuit breaker is open and requests are failing fast.

    Annotations
    @DoNotInherit()
  5. trait Complete extends RouteResult
  6. trait CustomRejection extends scaladsl.server.Rejection

    To be extended by user-provided custom rejections, such that they may be consumed in either Java or Scala DSLs.

  7. final class ExceptionHandler extends AnyRef

    Handles exceptions by turning them into routes.

    Handles exceptions by turning them into routes. You can create an exception handler in Java code like the following example:

        ExceptionHandler myHandler = ExceptionHandler.of (ExceptionHandler.newPFBuilder()
            .match(IllegalArgumentException.class, x -> Directives.complete(StatusCodes.BAD_REQUEST))
            .build()
        ));
    

  8. class ExceptionHandlerBuilder extends AnyRef
  9. trait ExpectedWebSocketRequestRejection extends Rejection

    Rejection created when a websocket request was expected but none was found.

    Rejection created when a websocket request was expected but none was found.

    Annotations
    @DoNotInherit()
  10. trait InvalidOriginRejection extends Rejection

    Rejection created by pekko.http.scaladsl.server.directives.HeaderDirectives.checkSameOrigin.

    Rejection created by pekko.http.scaladsl.server.directives.HeaderDirectives.checkSameOrigin. Signals that the request was rejected because Origin header value is invalid.

    Annotations
    @DoNotInherit()
  11. trait InvalidRequiredValueForQueryParamRejection extends Rejection

    Rejection created by parameter filters.

    Rejection created by parameter filters. Signals that the request was rejected because a query parameter value was not equal to required one.

    Annotations
    @DoNotInherit()
  12. trait MalformedFormFieldRejection extends Rejection

    Rejection created by form field filters.

    Rejection created by form field filters. Signals that the request was rejected because a form field could not be interpreted.

    Annotations
    @DoNotInherit()
  13. trait MalformedHeaderRejection extends Rejection

    Rejection created by header directives.

    Rejection created by header directives. Signals that the request was rejected because a header value is malformed.

    Annotations
    @DoNotInherit()
  14. trait MalformedQueryParamRejection extends Rejection

    Rejection created by parameter filters.

    Rejection created by parameter filters. Signals that the request was rejected because a query parameter could not be interpreted.

    Annotations
    @DoNotInherit()
  15. trait MalformedRequestContentRejection extends Rejection

    Rejection created by unmarshallers.

    Rejection created by unmarshallers. Signals that the request was rejected because unmarshalling failed with an error that wasn't an IllegalArgumentException. Usually that means that the request content was not of the expected format. Note that semantic issues with the request content (e.g. because some parameter was out of range) will usually trigger a ValidationRejection instead.

    Annotations
    @DoNotInherit()
  16. trait MethodRejection extends Rejection

    Rejection created by method filters.

    Rejection created by method filters. Signals that the request was rejected because the HTTP method is unsupported.

    Annotations
    @DoNotInherit()
  17. trait MissingAttributeRejection[T] extends Rejection

    Rejection created by attribute directives.

    Rejection created by attribute directives. Signals that the request was rejected because a required request attribute could not be found.

    Annotations
    @DoNotInherit()
  18. trait MissingCookieRejection extends Rejection

    Rejection created by the cookie directive.

    Rejection created by the cookie directive. Signals that the request was rejected because a cookie was not found.

    Annotations
    @DoNotInherit()
  19. trait MissingFormFieldRejection extends Rejection

    Rejection created by form field filters.

    Rejection created by form field filters. Signals that the request was rejected because a form field was not found.

    Annotations
    @DoNotInherit()
  20. trait MissingHeaderRejection extends Rejection

    Rejection created by header directives.

    Rejection created by header directives. Signals that the request was rejected because a required header could not be found.

    Annotations
    @DoNotInherit()
  21. trait MissingQueryParamRejection extends Rejection

    Rejection created by parameter filters.

    Rejection created by parameter filters. Signals that the request was rejected because a query parameter was not found.

    Annotations
    @DoNotInherit()
  22. final class PathMatcher0 extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  23. final class PathMatcher1[T1] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  24. final class PathMatcher10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  25. final class PathMatcher11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  26. final class PathMatcher12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  27. final class PathMatcher13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  28. final class PathMatcher14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  29. final class PathMatcher15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  30. final class PathMatcher16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  31. final class PathMatcher17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  32. final class PathMatcher18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  33. final class PathMatcher19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  34. final class PathMatcher2[T1, T2] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  35. final class PathMatcher20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  36. final class PathMatcher21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

    It is not possible to append more matchers with keeping their values as parameters (due to limit of Tuple22).

  37. final class PathMatcher22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

    It is not possible to append more matchers with keeping their values as parameters (due to limit of Tuple22).

  38. final class PathMatcher3[T1, T2, T3] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  39. final class PathMatcher4[T1, T2, T3, T4] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  40. final class PathMatcher5[T1, T2, T3, T4, T5] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  41. final class PathMatcher6[T1, T2, T3, T4, T5, T6] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  42. final class PathMatcher7[T1, T2, T3, T4, T5, T6, T7] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  43. final class PathMatcher8[T1, T2, T3, T4, T5, T6, T7, T8] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  44. final class PathMatcher9[T1, T2, T3, T4, T5, T6, T7, T8, T9] extends AnyRef

    A PathMatcher tries to match a prefix of a given string and returns either a PathMatcher.Matched instance if matched, otherwise PathMatchers.Unmatched.

  45. final class PathMatchers extends AnyRef
  46. trait Rejected extends RouteResult
  47. trait Rejection extends AnyRef

    A rejection encapsulates a specific reason why a Route was not able to handle a request.

    A rejection encapsulates a specific reason why a Route was not able to handle a request. Rejections are gathered up over the course of a Route evaluation and finally converted to pekko.http.scaladsl.model.HttpResponses by the handleRejections directive, if there was no way for the request to be completed.

    If providing custom rejections, extend CustomRejection instead.

  48. trait RejectionError extends RuntimeException

    A Throwable wrapping a Rejection.

    A Throwable wrapping a Rejection. Can be used for marshalling Future[T] or Try[T] instances, whose failure side is supposed to trigger a route rejection rather than an Exception that is handled by the nearest ExceptionHandler. (Custom marshallers can of course use it as well.)

  49. final class RejectionHandler extends AnyRef
  50. class RejectionHandlerBuilder extends AnyRef
  51. class RequestContext extends AnyRef
  52. abstract class RequestEntityExpectedRejection extends Rejection

    Rejection created by unmarshallers.

    Rejection created by unmarshallers. Signals that the request was rejected because an message body entity was expected but not supplied.

    Annotations
    @DoNotInherit()
  53. trait Route extends HandlerProvider

    In the Java DSL, a Route can only consist of combinations of the built-in directives.

    In the Java DSL, a Route can only consist of combinations of the built-in directives. A Route can not be instantiated directly.

    However, the built-in directives may be combined methods like:

    Route myDirective(String test, Supplier inner) {
      return
        path("fixed", () ->
          path(test),
            inner
          )
        );
    }
    

    The above example will invoke [inner] whenever the path "fixed/{test}" is matched, where "{test}" is the actual String that was given as method argument.

    Annotations
    @DoNotInherit()
  54. trait RouteResult extends AnyRef
  55. trait SchemeRejection extends Rejection

    Rejection created by scheme filters.

    Rejection created by scheme filters. Signals that the request was rejected because the Uri scheme is unsupported.

    Annotations
    @DoNotInherit()
  56. trait TooManyRangesRejection extends Rejection

    Rejection created by range directives.

    Rejection created by range directives. Signals that the request contains too many ranges. An irregular high number of ranges indicates a broken client or a denial of service attack.

    Annotations
    @DoNotInherit()
  57. trait TransformationRejection extends Rejection

    A special Rejection that serves as a container for a transformation function on rejections.

    A special Rejection that serves as a container for a transformation function on rejections. It is used by some directives to "cancel" rejections that are added by later directives of a similar type.

    Consider this route structure for example:

    put { reject(ValidationRejection("no") } ~ get { ... }

    If this structure is applied to a PUT request the list of rejections coming back contains three elements:

    1. A ValidationRejection 2. A MethodRejection 3. A TransformationRejection holding a function filtering out the MethodRejection

    so that in the end the RejectionHandler will only see one rejection (the ValidationRejection), because the MethodRejection added by the get directive is canceled by the put directive (since the HTTP method did indeed match eventually).

    Annotations
    @DoNotInherit()
  58. trait UnacceptedResponseContentTypeRejection extends Rejection

    Rejection created by marshallers.

    Rejection created by marshallers. Signals that the request was rejected because the service is not capable of producing a response entity whose content type is accepted by the client

    Annotations
    @DoNotInherit()
  59. trait UnacceptedResponseEncodingRejection extends Rejection

    Rejection created by encoding filters.

    Rejection created by encoding filters. Signals that the request was rejected because the service is not capable of producing a response entity whose content encoding is accepted by the client

    Annotations
    @DoNotInherit()
  60. trait UnsatisfiableRangeRejection extends Rejection

    Rejection created by range directives.

    Rejection created by range directives. Signals that the request was rejected because the requests contains only unsatisfiable ByteRanges. The actualEntityLength gives the client a hint to create satisfiable ByteRanges.

    Annotations
    @DoNotInherit()
  61. trait UnsupportedRequestContentTypeRejection extends Rejection

    Rejection created by unmarshallers.

    Rejection created by unmarshallers. Signals that the request was rejected because the requests content-type is unsupported.

    Annotations
    @DoNotInherit()
  62. trait UnsupportedRequestEncodingRejection extends Rejection

    Rejection created by decoding filters.

    Rejection created by decoding filters. Signals that the request was rejected because the requests content encoding is unsupported.

    Annotations
    @DoNotInherit()
  63. trait UnsupportedWebSocketSubprotocolRejection extends Rejection

    Rejection created when a websocket request was not handled because none of the given subprotocols was supported.

    Rejection created when a websocket request was not handled because none of the given subprotocols was supported.

    Annotations
    @DoNotInherit()
  64. trait ValidationRejection extends Rejection

    Rejection created by the validation directive as well as for IllegalArgumentExceptions thrown by domain model constructors (e.g.

    Rejection created by the validation directive as well as for IllegalArgumentExceptions thrown by domain model constructors (e.g. via require). It signals that an expected value was semantically invalid.

    Annotations
    @DoNotInherit()

Deprecated Type Members

  1. abstract class HttpApp extends AllDirectives

    DEPRECATED, consider https://github.com/apache/pekko-http-quickstart-java.g8 instead

    DEPRECATED, consider https://github.com/apache/pekko-http-quickstart-java.g8 instead

    Bootstrap trait for Http Server. It helps booting up a pekko-http server by only defining the desired routes. It offers additional hooks to modify the default behavior.

    Annotations
    @Deprecated
    Deprecated

Value Members

  1. object AuthenticationFailedRejection
  2. object AuthorizationFailedRejection
  3. object Directives extends AllDirectives

    Collects all default directives into one class for simple importing of static functions.

    Collects all default directives into one class for simple importing of static functions.

    See pekko.http.scaladsl.server.Directives for ScalaDSL equivalent of this class.

  4. object ExceptionHandler
  5. object ExpectedWebSocketRequestRejection
  6. object JavaPathMatchers
  7. object PathMatchers
  8. object RejectionHandler
  9. object Rejections
  10. object RequestContext
  11. object RequestEntityExpectedRejection
  12. object RouteResults
  13. object UnacceptedResponseEncodingRejection

Ungrouped