Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,14 @@ ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scalad
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.unmarshalling.sse.EventStreamUnmarshalling.maxEventSize")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.unmarshalling.sse.EventStreamUnmarshalling.fromEventStream")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.unmarshalling.sse.EventStreamUnmarshalling.$init$")

# Remove deprecated TimeoutDirectives and BasicDirectives FiniteDuration overloads (since 1.3.0)
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.server.directives.TimeoutDirectives.withRequestTimeout")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.server.directives.BasicDirectives.extractStrictEntity")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.server.directives.BasicDirectives.toStrictEntity")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.server.directives.TimeoutDirectives.withRequestTimeout")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.server.directives.BasicDirectives.extractStrictEntity")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.server.directives.BasicDirectives.toStrictEntity")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.server.Directives.withRequestTimeout")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.server.Directives.extractStrictEntity")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.server.Directives.toStrictEntity")
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import java.util.function.Predicate
import java.util.function.Supplier

import scala.concurrent.{ ExecutionContext, ExecutionContextExecutor }
import scala.concurrent.duration.FiniteDuration
import scala.jdk.DurationConverters._
import scala.jdk.FutureConverters._

Expand Down Expand Up @@ -337,25 +336,6 @@ abstract class BasicDirectives {
*/
def extractRequestEntity(inner: JFunction[RequestEntity, Route]): Route = extractEntity(inner)

/**
* WARNING: This will read the entire request entity into memory and effectively disable streaming.
*
* To help protect against excessive memory use, the request will be aborted if the request is larger
* than allowed by the `pekko.http.parsing.max-to-strict-bytes` configuration setting.
*
* Converts the HttpEntity from the [[pekko.http.javadsl.server.RequestContext]] into an
* [[pekko.http.javadsl.model.HttpEntity.Strict]] and extracts it, or fails the route if unable to drain the
* entire request body within the timeout.
*
* @param timeout The directive is failed if the stream isn't completed after the given timeout.
* @deprecated As of 1.3.0, use the overloaded method taking a `java.time.Duration` instead.
*/
@Deprecated(since = "1.3.0")
@deprecated("use the overloaded method taking a `java.time.Duration` instead.", "1.3.0")
def extractStrictEntity(timeout: FiniteDuration, inner: JFunction[HttpEntity.Strict, Route]): Route = RouteAdapter {
D.extractStrictEntity(timeout) { strict => inner.apply(strict).delegate }
}

/**
* WARNING: This will read the entire request entity into memory and effectively disable streaming.
*
Expand All @@ -373,26 +353,6 @@ abstract class BasicDirectives {
D.extractStrictEntity(timeout.toScala) { strict => inner.apply(strict).delegate }
}

/**
* WARNING: This will read the entire request entity into memory and effectively disable streaming.
*
* To help protect against excessive memory use, the request will be aborted if the request is larger
* than allowed by the `pekko.http.parsing.max-to-strict-bytes` configuration setting.
*
* Converts the HttpEntity from the [[pekko.http.javadsl.server.RequestContext]] into an
* [[pekko.http.javadsl.model.HttpEntity.Strict]] and extracts it, or fails the route if unable to drain the
* entire request body within the timeout.
*
* @param timeout The directive is failed if the stream isn't completed after the given timeout.
* @deprecated As of 1.3.0, use the overloaded method taking a `java.time.Duration` instead.
*/
@Deprecated(since = "1.3.0")
@deprecated("use the overloaded method taking a `java.time.Duration` instead.", "1.3.0")
def extractStrictEntity(timeout: FiniteDuration, maxBytes: Long, inner: JFunction[HttpEntity.Strict, Route]): Route =
RouteAdapter {
D.extractStrictEntity(timeout, maxBytes) { strict => inner.apply(strict).delegate }
}

/**
* WARNING: This will read the entire request entity into memory and effectively disable streaming.
*
Expand All @@ -411,24 +371,6 @@ abstract class BasicDirectives {
D.extractStrictEntity(timeout.toScala, maxBytes) { strict => inner.apply(strict).delegate }
}

/**
* WARNING: This will read the entire request entity into memory and effectively disable streaming.
*
* To help protect against excessive memory use, the request will be aborted if the request is larger
* than allowed by the `pekko.http.parsing.max-to-strict-bytes` configuration setting.
*
* Extracts the [[pekko.http.javadsl.server.RequestContext]] itself with the strict HTTP entity,
* or fails the route if unable to drain the entire request body within the timeout.
*
* @param timeout The directive is failed if the stream isn't completed after the given timeout.
* @deprecated As of 1.3.0, use the overloaded method taking a `java.time.Duration` instead.
*/
@Deprecated(since = "1.3.0")
@deprecated("use the overloaded method taking a `java.time.Duration` instead.", "1.3.0")
def toStrictEntity(timeout: FiniteDuration, inner: Supplier[Route]): Route = RouteAdapter {
D.toStrictEntity(timeout) { inner.get.delegate }
}

/**
* WARNING: This will read the entire request entity into memory and effectively disable streaming.
*
Expand All @@ -445,24 +387,6 @@ abstract class BasicDirectives {
D.toStrictEntity(timeout.toScala) { inner.get.delegate }
}

/**
* WARNING: This will read the entire request entity into memory and effectively disable streaming.
*
* To help protect against excessive memory use, the request will be aborted if the request is larger
* than allowed by the `pekko.http.parsing.max-to-strict-bytes` configuration setting.
*
* Extracts the [[pekko.http.javadsl.server.RequestContext]] itself with the strict HTTP entity,
* or fails the route if unable to drain the entire request body within the timeout.
*
* @param timeout The directive is failed if the stream isn't completed after the given timeout.
* @deprecated As of 1.3.0, use the overloaded method taking a `java.time.Duration` instead.
*/
@Deprecated(since = "1.3.0")
@deprecated("use the overloaded method taking a `java.time.Duration` instead.", "1.3.0")
def toStrictEntity(timeout: FiniteDuration, maxBytes: Long, inner: Supplier[Route]): Route = RouteAdapter {
D.toStrictEntity(timeout, maxBytes) { inner.get.delegate }
}

/**
* WARNING: This will read the entire request entity into memory and effectively disable streaming.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,6 @@ abstract class TimeoutDirectives extends WebSocketDirectives {
}
}

/**
* Tries to set a new request timeout and handler (if provided) at the same time.
*
* Due to the inherent raciness it is not guaranteed that the update will be applied before
* the previously set timeout has expired!
* @deprecated As of 1.3.0, use the overloaded method taking a `java.time.Duration` instead.
*/
@Deprecated(since = "1.3.0")
@deprecated("use the overloaded method taking a `java.time.Duration` instead.", "1.3.0")
def withRequestTimeout(timeout: scala.concurrent.duration.Duration, inner: Supplier[Route]): RouteAdapter =
RouteAdapter {
D.withRequestTimeout(timeout) { inner.get.delegate }
}

/**
* Tries to set a new request timeout and handler (if provided) at the same time.
*
Expand All @@ -66,21 +52,6 @@ abstract class TimeoutDirectives extends WebSocketDirectives {
D.withRequestTimeout(timeout.toScala) { inner.get.delegate }
}

/**
* Tries to set a new request timeout and handler (if provided) at the same time.
*
* Due to the inherent raciness it is not guaranteed that the update will be applied before
* the previously set timeout has expired!
* @deprecated As of 1.3.0, use the overloaded method taking a `java.time.Duration` instead.
*/
@Deprecated(since = "1.3.0")
@deprecated("use the overloaded method taking a `java.time.Duration` instead.", "1.3.0")
def withRequestTimeout(timeout: scala.concurrent.duration.Duration,
timeoutHandler: JFunction[HttpRequest, HttpResponse],
inner: Supplier[Route]): RouteAdapter = RouteAdapter {
D.withRequestTimeout(timeout, in => timeoutHandler(in.asJava).asScala) { inner.get.delegate }
}

/**
* Tries to set a new request timeout and handler (if provided) at the same time.
*
Expand Down