This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-connectors.git
The following commit(s) were added to refs/heads/main by this push:
new bb6496bdc remove more deprecated methods (#1187)
bb6496bdc is described below
commit bb6496bdc454a3a80e0cc44e1f28679a1599620d
Author: PJ Fanning <[email protected]>
AuthorDate: Fri Sep 12 12:17:11 2025 +0100
remove more deprecated methods (#1187)
---
.../remove-deprecated-methods.backwards.excludes | 32 ++++
.../firebase/fcm/FcmNotificationModels.scala | 202 ---------------------
.../google/firebase/fcm/impl/FcmFlows.scala | 87 ---------
.../google/firebase/fcm/impl/FcmJsonSupport.scala | 98 ----------
.../google/firebase/fcm/impl/FcmSender.scala | 70 -------
.../google/firebase/fcm/javadsl/GoogleFcm.scala | 51 ------
.../google/firebase/fcm/scaladsl/GoogleFcm.scala | 44 -----
...UploadSink-type-param-change.backwards.excludes | 17 ++
.../remove-deprecated-methods.backwards.excludes | 21 +++
.../pekko/stream/connectors/s3/javadsl/S3.scala | 137 --------------
.../pekko/stream/connectors/s3/scaladsl/S3.scala | 39 ----
11 files changed, 70 insertions(+), 728 deletions(-)
diff --git
a/google-fcm/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.backwards.excludes
b/google-fcm/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.backwards.excludes
new file mode 100644
index 000000000..2eedd19ba
--- /dev/null
+++
b/google-fcm/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.backwards.excludes
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# remove deprecated methods
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.FcmErrorResponse")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.FcmErrorResponse$")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.FcmNotification")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.FcmNotification$")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.FcmNotificationModels")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.FcmNotificationModels$")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.FcmNotificationModels$*")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.FcmResponse")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.FcmSuccessResponse")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.FcmSuccessResponse$")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.javadsl.GoogleFcm")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.javadsl.GoogleFcm$")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.scaladsl.GoogleFcm")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.connectors.google.firebase.fcm.scaladsl.GoogleFcm$")
diff --git
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/FcmNotificationModels.scala
b/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/FcmNotificationModels.scala
deleted file mode 100644
index 4b7ed8263..000000000
---
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/FcmNotificationModels.scala
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * license agreements; and to You under the Apache License, version 2.0:
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * This file is part of the Apache Pekko project, which was derived from Akka.
- */
-
-/*
- * Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com>
- */
-
-package org.apache.pekko.stream.connectors.google.firebase.fcm
-
-import
org.apache.pekko.stream.connectors.google.firebase.fcm.FcmNotificationModels._
-
-/** Use class from package
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models */
-@deprecated("Use class from package
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models", "Alpakka
3.0.2")
-@Deprecated
-object FcmNotificationModels {
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.BasicNotification
*/
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.BasicNotification",
"Alpakka 3.0.2")
- @Deprecated
- case class BasicNotification(title: String, body: String)
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.AndroidNotification
*/
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.AndroidNotification",
- "Alpakka 3.0.2")
- @Deprecated
- case class AndroidNotification(
- title: String,
- body: String,
- icon: String,
- color: String,
- sound: String,
- tag: String,
- click_action: String,
- body_loc_key: String,
- body_loc_args: Seq[String],
- title_loc_key: String,
- title_loc_args: Seq[String])
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.AndroidConfig
*/
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.AndroidConfig",
"Alpakka 3.0.2")
- @Deprecated
- case class AndroidConfig(
- collapse_key: String,
- priority: AndroidMessagePriority,
- ttl: String,
- restricted_package_name: String,
- data: Map[String, String],
- notification: AndroidNotification)
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.AndroidMessagePriority
*/
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.AndroidMessagePriority",
- "Alpakka 3.0.2")
- @Deprecated
- sealed trait AndroidMessagePriority
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.Normal */
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.Normal",
"Alpakka 3.0.2")
- @Deprecated
- case object Normal extends AndroidMessagePriority
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.High */
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.High",
"Alpakka 3.0.2")
- @Deprecated
- case object High extends AndroidMessagePriority
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.WebPushConfig
*/
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.WebPushConfig",
"Alpakka 3.0.2")
- @Deprecated
- case class WebPushNotification(title: String, body: String, icon: String)
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.WebPushConfig
*/
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.WebPushConfig",
"Alpakka 3.0.2")
- @Deprecated
- case class WebPushConfig(headers: Map[String, String], data: Map[String,
String], notification: WebPushNotification)
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.ApnsConfig */
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.ApnsConfig",
"Alpakka 3.0.2")
- @Deprecated
- case class ApnsConfig(headers: Map[String, String], rawPayload: String)
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.NotificationTarget
*/
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.NotificationTarget",
- "Alpakka 3.0.2")
- @Deprecated
- sealed trait NotificationTarget
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.Token */
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.Token",
"Alpakka 3.0.2")
- @Deprecated
- case class Token(token: String) extends NotificationTarget
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.Topic */
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.Topic",
"Alpakka 3.0.2")
- @Deprecated
- case class Topic(topic: String) extends NotificationTarget
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.Condition */
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.Condition",
"Alpakka 3.0.2")
- @Deprecated
- case class Condition(conditionText: String) extends NotificationTarget
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.Condition */
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.Condition",
"Alpakka 3.0.2")
- @Deprecated
- object Condition {
- sealed trait ConditionBuilder {
- def &&(condition: ConditionBuilder) = And(this, condition)
- def ||(condition: ConditionBuilder) = Or(this, condition)
- def unary_! = Not(this)
- def toConditionText: String
- }
- case class Topic(topic: String) extends ConditionBuilder {
- def toConditionText: String = s"'$topic' in topics"
- }
- case class And(condition1: ConditionBuilder, condition2: ConditionBuilder)
extends ConditionBuilder {
- def toConditionText: String = s"(${condition1.toConditionText} &&
${condition2.toConditionText})"
- }
- case class Or(condition1: ConditionBuilder, condition2: ConditionBuilder)
extends ConditionBuilder {
- def toConditionText: String = s"(${condition1.toConditionText} ||
${condition2.toConditionText})"
- }
- case class Not(condition: ConditionBuilder) extends ConditionBuilder {
- def toConditionText: String = s"!(${condition.toConditionText})"
- }
-
- def apply(builder: ConditionBuilder): Condition =
- Condition(builder.toConditionText)
- }
-}
-
-/** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.FcmNotification
*/
-@deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.FcmNotification",
"Alpakka 3.0.2")
-@Deprecated
-case class FcmNotification(
- data: Option[Map[String, String]] = None,
- notification: Option[BasicNotification] = None,
- android: Option[AndroidConfig] = None,
- webPush: Option[WebPushConfig] = None,
- apns: Option[ApnsConfig] = None,
- token: Option[String] = None,
- topic: Option[String] = None,
- condition: Option[String] = None) {
- def withData(data: Map[String, String]): FcmNotification = this.copy(data =
Option(data))
- def withBasicNotification(notification: BasicNotification): FcmNotification =
- this.copy(notification = Option(notification))
- def withBasicNotification(title: String, body: String): FcmNotification =
- this.copy(notification = Option(BasicNotification(title, body)))
- def withAndroidConfig(android: AndroidConfig): FcmNotification =
this.copy(android = Option(android))
- def withWebPushConfig(webPush: WebPushConfig): FcmNotification =
this.copy(webPush = Option(webPush))
- def withApnsConfig(apns: ApnsConfig): FcmNotification = this.copy(apns =
Option(apns))
- def withTarget(target: NotificationTarget): FcmNotification = target match {
- case Token(t) => this.copy(token = Option(t), topic = None, condition
= None)
- case Topic(t) => this.copy(token = None, topic = Option(t), condition
= None)
- case Condition(t) => this.copy(token = None, topic = None, condition =
Option(t))
- }
- def isSendable: Boolean =
- (token.isDefined ^ topic.isDefined ^ condition.isDefined) &&
!(token.isDefined && topic.isDefined)
-}
-
-/** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.FcmNotification
*/
-@deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.FcmNotification",
"Alpakka 3.0.2")
-@Deprecated
-object FcmNotification {
- val empty: FcmNotification = FcmNotification()
- def fromJava(): FcmNotification = empty
- def apply(notification: BasicNotification, target: NotificationTarget):
FcmNotification =
- empty.withBasicNotification(notification).withTarget(target)
- def apply(title: String, body: String, target: NotificationTarget):
FcmNotification =
- empty.withBasicNotification(title, body).withTarget(target)
- def basic(title: String, body: String, target: NotificationTarget) =
FcmNotification(title, body, target)
-}
-
-/** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.FcmResponse */
-@deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.FcmResponse",
"Alpakka 3.0.2")
-@Deprecated
-sealed trait FcmResponse {
- def isFailure: Boolean
- def isSuccess: Boolean
-}
-
-/** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.FcmSuccessResponse
*/
-@deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.FcmSuccessResponse",
"Alpakka 3.0.2")
-@Deprecated
-final case class FcmSuccessResponse(name: String) extends FcmResponse {
- val isFailure = false
- val isSuccess = true
- def getName: String = name
-}
-
-/** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.FcmErrorResponse
*/
-@deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.models.FcmErrorResponse",
"Alpakka 3.0.2")
-@Deprecated
-final case class FcmErrorResponse(rawError: String) extends FcmResponse {
- val isFailure = true
- val isSuccess = false
- def getRawError: String = rawError
-}
diff --git
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/impl/FcmFlows.scala
b/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/impl/FcmFlows.scala
deleted file mode 100644
index e6c04873f..000000000
---
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/impl/FcmFlows.scala
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * license agreements; and to You under the Apache License, version 2.0:
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * This file is part of the Apache Pekko project, which was derived from Akka.
- */
-
-/*
- * Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com>
- */
-
-package org.apache.pekko.stream.connectors.google.firebase.fcm.impl
-
-import org.apache.pekko
-import pekko.NotUsed
-import pekko.annotation.InternalApi
-import pekko.http.scaladsl.Http
-import pekko.stream.connectors.google.auth.{ Credentials,
ServiceAccountCredentials }
-import pekko.stream.connectors.google.{ GoogleAttributes, GoogleSettings }
-import pekko.stream.{ Attributes, Materializer }
-import pekko.stream.connectors.google.firebase.fcm._
-import pekko.stream.scaladsl.Flow
-
-import scala.concurrent.Future
-
-/**
- * INTERNAL API
- */
-@InternalApi
-private[fcm] object FcmFlows {
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmFlows */
-
@deprecated("org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmFlows",
"Alpakka 3.0.2")
- @Deprecated
- private[fcm] def fcmWithData[T](conf: FcmSettings): Flow[(FcmNotification,
T), (FcmResponse, T), NotUsed] =
- Flow
- .fromMaterializer { (mat, attr) =>
- implicit val settings: GoogleSettings = resolveSettings(conf)(mat,
attr)
- val sender = new FcmSender()
- Flow[(FcmNotification, T)].mapAsync(conf.maxConcurrentConnections) {
- case (notification, data) =>
- sender
- .send(Http(mat.system), FcmSend(conf.isTest, notification))(mat,
settings)
- .zip(Future.successful(data))
- }
- }
- .mapMaterializedValue(_ => NotUsed)
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmFlows */
-
@deprecated("org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmFlows",
"Alpakka 3.0.2")
- @Deprecated
- private[fcm] def fcm(conf: FcmSettings): Flow[FcmNotification, FcmResponse,
NotUsed] =
- Flow
- .fromMaterializer { (mat, attr) =>
- implicit val settings: GoogleSettings = resolveSettings(conf)(mat,
attr)
- val sender = new FcmSender()
- Flow[FcmNotification].mapAsync(conf.maxConcurrentConnections) {
notification =>
- sender.send(Http(mat.system), FcmSend(conf.isTest,
notification))(mat, settings)
- }
- }
- .mapMaterializedValue(_ => NotUsed)
-
-
@deprecated("org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmFlows",
"Alpakka 3.0.2")
- @Deprecated
- private def resolveSettings(conf: FcmSettings)(mat: Materializer, attr:
Attributes): GoogleSettings = {
- val settings = GoogleAttributes.resolveSettings(mat, attr)
- val scopes = Set("https://www.googleapis.com/auth/firebase.messaging")
- val credentials =
- if (conf.privateKey == "deprecated")
- settings.credentials
- else
- Credentials.cache((conf.projectId, conf.clientEmail, conf.privateKey,
scopes, mat.system.name)) {
- ServiceAccountCredentials(
- conf.projectId,
- conf.clientEmail,
- conf.privateKey,
- scopes)(mat.system)
- }
- val forwardProxy =
-
conf.forwardProxy.map(_.toCommonForwardProxy(mat.system)).orElse(settings.requestSettings.forwardProxy)
- settings.copy(
- credentials = credentials,
- requestSettings = settings.requestSettings.copy(forwardProxy =
forwardProxy))
- }
-}
diff --git
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/impl/FcmJsonSupport.scala
b/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/impl/FcmJsonSupport.scala
deleted file mode 100644
index 4e1768204..000000000
---
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/impl/FcmJsonSupport.scala
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * license agreements; and to You under the Apache License, version 2.0:
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * This file is part of the Apache Pekko project, which was derived from Akka.
- */
-
-/*
- * Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com>
- */
-
-package org.apache.pekko.stream.connectors.google.firebase.fcm.impl
-
-import org.apache.pekko
-import pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
-import pekko.stream.connectors.google.firebase.fcm.{ FcmErrorResponse,
FcmResponse, FcmSuccessResponse }
-import pekko.annotation.InternalApi
-import pekko.stream.connectors.google.firebase.fcm.FcmNotification
-import pekko.stream.connectors.google.firebase.fcm.FcmNotificationModels._
-import spray.json._
-
-/**
- * INTERNAL API
- */
-@InternalApi
-@deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmSend",
"Alpakka 3.0.2")
-@Deprecated
-private[fcm] case class FcmSend(validate_only: Boolean, message:
FcmNotification)
-
-/**
- * INTERNAL API
- */
-@InternalApi
-@deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmJsonSupport",
"Alpakka 3.0.2")
-@Deprecated
-private[fcm] object FcmJsonSupport extends DefaultJsonProtocol with
SprayJsonSupport {
-
- // custom formatters
- implicit object FcmSuccessResponseJsonFormat extends
RootJsonFormat[FcmSuccessResponse] {
- def write(c: FcmSuccessResponse): JsValue = JsString(c.name)
-
- def read(value: JsValue) = value match {
- case JsObject(fields) if fields.contains("name") =>
FcmSuccessResponse(fields("name").convertTo[String])
- case other => throw
DeserializationException(s"object containing `name` expected, but we get
$other")
- }
- }
- implicit object FcmErrorResponseJsonFormat extends
RootJsonFormat[FcmErrorResponse] {
- def write(c: FcmErrorResponse): JsValue = c.rawError.parseJson
- def read(value: JsValue) = FcmErrorResponse(value.toString)
- }
-
- implicit object FcmResponseFormat extends RootJsonReader[FcmResponse] {
- def read(value: JsValue): FcmResponse = value match {
- case JsObject(fields) if fields.keys.exists(_ == "name") =>
value.convertTo[FcmSuccessResponse]
- case JsObject(fields) if fields.keys.exists(_ == "error_code") =>
value.convertTo[FcmErrorResponse]
- case other => throw
DeserializationException(s"FcmResponse expected, but we get $other")
- }
- }
-
- implicit object AndroidMessagePriorityFormat extends
RootJsonFormat[AndroidMessagePriority] {
- def write(c: AndroidMessagePriority): JsString =
- c match {
- case Normal => JsString("NORMAL")
- case High => JsString("HIGH")
- }
-
- def read(value: JsValue): AndroidMessagePriority = value match {
- case JsString("NORMAL") => Normal
- case JsString("HIGH") => High
- case other => throw
DeserializationException(s"AndroidMessagePriority expected, but we get $other")
- }
- }
-
- implicit object ApnsConfigResponseJsonFormat extends
RootJsonFormat[ApnsConfig] {
- def write(c: ApnsConfig): JsObject =
- JsObject(
- "headers" -> c.headers.toJson,
- "payload" -> c.rawPayload.parseJson)
-
- def read(value: JsValue): ApnsConfig = {
- val map = value.asJsObject
- ApnsConfig(map.fields("headers").convertTo[Map[String, String]],
map.fields("payload").toString)
- }
- }
-
- // app -> google
- implicit val webPushNotificationJsonFormat:
RootJsonFormat[WebPushNotification] =
- jsonFormat3(WebPushNotification.apply)
- implicit val webPushConfigJsonFormat: RootJsonFormat[WebPushConfig] =
jsonFormat3(WebPushConfig.apply)
- implicit val androidNotificationJsonFormat:
RootJsonFormat[AndroidNotification] =
- jsonFormat11(AndroidNotification.apply)
- implicit val androidConfigJsonFormat: RootJsonFormat[AndroidConfig] =
jsonFormat6(AndroidConfig.apply)
- implicit val basicNotificationJsonFormat: RootJsonFormat[BasicNotification]
= jsonFormat2(BasicNotification.apply)
- implicit val sendableFcmNotificationJsonFormat:
RootJsonFormat[FcmNotification] = jsonFormat8(FcmNotification.apply)
- implicit val fcmSendJsonFormat: RootJsonFormat[FcmSend] =
jsonFormat2(FcmSend.apply)
-}
diff --git
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/impl/FcmSender.scala
b/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/impl/FcmSender.scala
deleted file mode 100644
index 859543def..000000000
---
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/impl/FcmSender.scala
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * license agreements; and to You under the Apache License, version 2.0:
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * This file is part of the Apache Pekko project, which was derived from Akka.
- */
-
-/*
- * Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com>
- */
-
-package org.apache.pekko.stream.connectors.google.firebase.fcm.impl
-
-import org.apache.pekko
-import pekko.annotation.InternalApi
-import pekko.http.scaladsl.HttpExt
-import pekko.http.scaladsl.marshalling.Marshal
-import pekko.http.scaladsl.model._
-import pekko.http.scaladsl.unmarshalling.{ FromResponseUnmarshaller,
Unmarshal, Unmarshaller }
-import pekko.stream.Materializer
-import pekko.stream.connectors.google.GoogleSettings
-import pekko.stream.connectors.google.firebase.fcm.{ FcmErrorResponse,
FcmResponse, FcmSuccessResponse }
-import pekko.stream.connectors.google.http.GoogleHttp
-import pekko.stream.connectors.google.implicits._
-
-import scala.annotation.nowarn
-import scala.concurrent.Future
-
-/**
- * INTERNAL API
- */
-@nowarn("msg=deprecated")
-@InternalApi
-private[fcm] class FcmSender {
- import FcmJsonSupport._
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmSender */
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmSender",
"Alpakka 3.0.2")
- @Deprecated
- def send(http: HttpExt, fcmSend: FcmSend)(
- implicit mat: Materializer,
- settings: GoogleSettings): Future[FcmResponse] = {
- import mat.executionContext
- import settings.projectId
- val url =
s"https://fcm.googleapis.com/v1/projects/$projectId/messages:send"
-
- Marshal(fcmSend).to[RequestEntity].flatMap { entity =>
- GoogleHttp(http)
-
.singleAuthenticatedRequest[FcmSuccessResponse](HttpRequest(HttpMethods.POST,
url, entity = entity))
- }.recover {
- case FcmErrorException(error) => error
- }
- }
-
- implicit private val unmarshaller:
FromResponseUnmarshaller[FcmSuccessResponse] = Unmarshaller.withMaterializer {
- implicit ec => implicit mat => (response: HttpResponse) =>
- if (response.status.isSuccess) {
- Unmarshal(response.entity).to[FcmSuccessResponse]
- } else {
- Unmarshal(response.entity).to[FcmErrorResponse].map(error => throw
FcmErrorException(error))
- }
- }.withDefaultRetry
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmErrorException
*/
- @deprecated("Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.impl.FcmErrorException",
"Alpakka 3.0.2")
- @Deprecated
- private case class FcmErrorException(error: FcmErrorResponse) extends
Exception
-}
diff --git
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/javadsl/GoogleFcm.scala
b/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/javadsl/GoogleFcm.scala
deleted file mode 100644
index 195c6ae5a..000000000
---
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/javadsl/GoogleFcm.scala
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * license agreements; and to You under the Apache License, version 2.0:
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * This file is part of the Apache Pekko project, which was derived from Akka.
- */
-
-/*
- * Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com>
- */
-
-package org.apache.pekko.stream.connectors.google.firebase.fcm.javadsl
-
-import org.apache.pekko
-import pekko.japi.Pair
-import pekko.stream.connectors.google.firebase.fcm.impl.FcmFlows
-import pekko.stream.connectors.google.firebase.fcm.{ FcmNotification,
FcmResponse, FcmSettings }
-import pekko.stream.{ javadsl, scaladsl }
-import pekko.{ Done, NotUsed }
-
-import java.util.concurrent.CompletionStage
-
-object GoogleFcm {
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.javadsl.GoogleFcm" */
-
@deprecated("org.apache.pekko.stream.connectors.google.firebase.fcm.v1.javadsl.GoogleFcm",
"Alpakka 3.0.2")
- @Deprecated
- def sendWithPassThrough[T](conf: FcmSettings):
javadsl.Flow[Pair[FcmNotification, T], Pair[FcmResponse, T], NotUsed] =
- scaladsl
- .Flow[Pair[FcmNotification, T]]
- .map(_.toScala)
- .via(FcmFlows.fcmWithData[T](conf))
- .map(t => Pair(t._1, t._2))
- .asJava
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.javadsl.GoogleFcm" */
-
@deprecated("org.apache.pekko.stream.connectors.google.firebase.fcm.v1.javadsl.GoogleFcm",
"Alpakka 3.0.2")
- @Deprecated
- def send(conf: FcmSettings): javadsl.Flow[FcmNotification, FcmResponse,
NotUsed] =
- FcmFlows.fcm(conf).asJava
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.javadsl.GoogleFcm" */
-
@deprecated("org.apache.pekko.stream.connectors.google.firebase.fcm.v1.javadsl.GoogleFcm",
"Alpakka 3.0.2")
- @Deprecated
- def fireAndForget(conf: FcmSettings): javadsl.Sink[FcmNotification,
CompletionStage[Done]] =
- send(conf)
- .toMat(javadsl.Sink.ignore(), javadsl.Keep.right[NotUsed,
CompletionStage[Done]])
-
-}
diff --git
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/scaladsl/GoogleFcm.scala
b/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/scaladsl/GoogleFcm.scala
deleted file mode 100644
index f27a1f650..000000000
---
a/google-fcm/src/main/scala/org/apache/pekko/stream/connectors/google/firebase/fcm/scaladsl/GoogleFcm.scala
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * license agreements; and to You under the Apache License, version 2.0:
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * This file is part of the Apache Pekko project, which was derived from Akka.
- */
-
-/*
- * Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com>
- */
-
-package org.apache.pekko.stream.connectors.google.firebase.fcm.scaladsl
-
-import org.apache.pekko
-import pekko.stream.connectors.google.firebase.fcm.impl.FcmFlows
-import pekko.stream.connectors.google.firebase.fcm.{ FcmNotification,
FcmResponse, FcmSettings }
-import pekko.stream.scaladsl.{ Flow, Keep, Sink }
-import pekko.{ Done, NotUsed }
-
-import scala.concurrent.Future
-
-object GoogleFcm {
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.scaladsl.GoogleFcm */
-
@deprecated("org.apache.pekko.stream.connectors.google.firebase.fcm.v1.scaladsl.GoogleFcm",
"Alpakka 3.0.2")
- @Deprecated
- def sendWithPassThrough[T](conf: FcmSettings): Flow[(FcmNotification, T),
(FcmResponse, T), NotUsed] =
- FcmFlows.fcmWithData[T](conf)
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.scaladsl.GoogleFcm */
-
@deprecated("org.apache.pekko.stream.connectors.google.firebase.fcm.v1.scaladsl.GoogleFcm",
"Alpakka 3.0.2")
- @Deprecated
- def send(conf: FcmSettings): Flow[FcmNotification, FcmResponse, NotUsed] =
- FcmFlows.fcm(conf)
-
- /** Use
org.apache.pekko.stream.connectors.google.firebase.fcm.v1.scaladsl.GoogleFcm */
-
@deprecated("org.apache.pekko.stream.connectors.google.firebase.fcm.v1.scaladsl.GoogleFcm",
"Alpakka 3.0.2")
- @Deprecated
- def fireAndForget(conf: FcmSettings): Sink[FcmNotification, Future[Done]] =
- FcmFlows.fcm(conf).toMat(Sink.ignore)(Keep.right)
-
-}
diff --git
a/s3/src/main/mima-filters/1.0.x.backwards.excludes/chunkUploadSink-type-param-change.backwards.excludes
b/s3/src/main/mima-filters/1.0.x.backwards.excludes/chunkUploadSink-type-param-change.backwards.excludes
index 1d9a11221..daaaefb58 100644
---
a/s3/src/main/mima-filters/1.0.x.backwards.excludes/chunkUploadSink-type-param-change.backwards.excludes
+++
b/s3/src/main/mima-filters/1.0.x.backwards.excludes/chunkUploadSink-type-param-change.backwards.excludes
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
# These filters are here because a type argument in the chunkUploadSink
parameter was changed from
# NotUsed to _ which has zero effect on runtime
ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.stream.connectors.s3.javadsl.S3.resumeMultipartUploadWithContext")
diff --git
a/s3/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.backwards.excludes
b/s3/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.backwards.excludes
new file mode 100644
index 000000000..6e073f4fe
--- /dev/null
+++
b/s3/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.backwards.excludes
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# remove deprecated methods
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.connectors.s3.javadsl.S3.download")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.connectors.s3.scaladsl.S3.download")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.connectors.s3.scaladsl.S3.download$*")
diff --git
a/s3/src/main/scala/org/apache/pekko/stream/connectors/s3/javadsl/S3.scala
b/s3/src/main/scala/org/apache/pekko/stream/connectors/s3/javadsl/S3.scala
index 3e3eed57e..66e5d6540 100644
--- a/s3/src/main/scala/org/apache/pekko/stream/connectors/s3/javadsl/S3.scala
+++ b/s3/src/main/scala/org/apache/pekko/stream/connectors/s3/javadsl/S3.scala
@@ -341,143 +341,6 @@ object S3 {
_.map { case (stream, meta) => JPair(stream.asJava, meta) }.toJava
}.asJava
- /**
- * Downloads a S3 Object
- *
- * @param bucket the s3 bucket name
- * @param key the s3 object key
- * @return A [[pekko.japi.Pair]] with a [[pekko.stream.javadsl.Source
Source]] of [[pekko.util.ByteString ByteString]], and a
[[pekko.stream.javadsl.Source Source]] containing the [[ObjectMetadata]]
- */
- @deprecated("Use S3.getObject instead", "4.0.0")
- def download(bucket: String,
- key: String): Source[Optional[JPair[Source[ByteString, NotUsed],
ObjectMetadata]], NotUsed] =
- toJava(S3Stream.download(S3Location(bucket, key), None, None,
S3Headers.empty))
-
- /**
- * Downloads a S3 Object
- *
- * @param bucket the s3 bucket name
- * @param key the s3 object key
- * @param sse the server side encryption to use
- * @return A [[pekko.japi.Pair]] with a [[pekko.stream.javadsl.Source
Source]] of [[pekko.util.ByteString ByteString]], and a
[[pekko.stream.javadsl.Source Source]] containing the [[ObjectMetadata]]
- */
- @deprecated("Use S3.getObject instead", "4.0.0")
- def download(
- bucket: String,
- key: String,
- sse: ServerSideEncryption): Source[Optional[JPair[Source[ByteString,
NotUsed], ObjectMetadata]], NotUsed] =
- download(bucket, key,
S3Headers.empty.withOptionalServerSideEncryption(Option(sse)))
-
- /**
- * Downloads a specific byte range of a S3 Object
- *
- * @param bucket the s3 bucket name
- * @param key the s3 object key
- * @param range the [[pekko.http.javadsl.model.headers.ByteRange ByteRange]]
you want to download
- * @return A [[pekko.japi.Pair]] with a [[pekko.stream.javadsl.Source
Source]] of [[pekko.util.ByteString ByteString]], and a
[[pekko.stream.javadsl.Source Source]] containing the [[ObjectMetadata]]
- */
- @deprecated("Use S3.getObject instead", "4.0.0")
- def download(bucket: String,
- key: String,
- range: ByteRange): Source[Optional[JPair[Source[ByteString, NotUsed],
ObjectMetadata]], NotUsed] = {
- val scalaRange = range.asInstanceOf[ScalaByteRange]
- toJava(S3Stream.download(S3Location(bucket, key), Some(scalaRange), None,
S3Headers.empty))
- }
-
- /**
- * Downloads a specific byte range of a S3 Object
- *
- * @param bucket the s3 bucket name
- * @param key the s3 object key
- * @param range the [[pekko.http.javadsl.model.headers.ByteRange ByteRange]]
you want to download
- * @param sse the server side encryption to use
- * @return A [[pekko.japi.Pair]] with a [[pekko.stream.javadsl.Source
Source]] of [[pekko.util.ByteString ByteString]], and a
[[pekko.stream.javadsl.Source Source]] containing the [[ObjectMetadata]]
- */
- @deprecated("Use S3.getObject instead", "4.0.0")
- def download(
- bucket: String,
- key: String,
- range: ByteRange,
- sse: ServerSideEncryption): Source[Optional[JPair[Source[ByteString,
NotUsed], ObjectMetadata]], NotUsed] =
- download(bucket, key, range,
S3Headers.empty.withOptionalServerSideEncryption(Option(sse)))
-
- /**
- * Downloads a specific byte range of a S3 Object
- *
- * @param bucket the s3 bucket name
- * @param key the s3 object key
- * @param range the [[pekko.http.javadsl.model.headers.ByteRange ByteRange]]
you want to download
- * @param versionId optional version id of the object
- * @param sse the server side encryption to use
- * @return A [[pekko.japi.Pair]] with a [[pekko.stream.javadsl.Source
Source]] of [[pekko.util.ByteString ByteString]], and a
[[pekko.stream.javadsl.Source Source]] containing the [[ObjectMetadata]]
- */
- @deprecated("Use S3.getObject instead", "4.0.0")
- def download(
- bucket: String,
- key: String,
- range: ByteRange,
- versionId: Optional[String],
- sse: ServerSideEncryption): Source[Optional[JPair[Source[ByteString,
NotUsed], ObjectMetadata]], NotUsed] =
- download(bucket, key, range, versionId,
S3Headers.empty.withOptionalServerSideEncryption(Option(sse)))
-
- /**
- * Downloads a S3 Object
- *
- * @param bucket the s3 bucket name
- * @param key the s3 object key
- * @param s3Headers any headers you want to add
- * @return A [[pekko.japi.Pair]] with a [[pekko.stream.javadsl.Source
Source]] of [[pekko.util.ByteString ByteString]], and a
[[pekko.stream.javadsl.Source Source]] containing the [[ObjectMetadata]]
- */
- @deprecated("Use S3.getObject instead", "4.0.0")
- def download(
- bucket: String,
- key: String,
- s3Headers: S3Headers): Source[Optional[JPair[Source[ByteString,
NotUsed], ObjectMetadata]], NotUsed] =
- toJava(
- S3Stream.download(S3Location(bucket, key), None, None, s3Headers))
-
- /**
- * Downloads a specific byte range of a S3 Object
- *
- * @param bucket the s3 bucket name
- * @param key the s3 object key
- * @param range the [[pekko.http.javadsl.model.headers.ByteRange ByteRange]]
you want to download
- * @param s3Headers any headers you want to add
- * @return A [[pekko.japi.Pair]] with a [[pekko.stream.javadsl.Source
Source]] of [[pekko.util.ByteString ByteString]], and a
[[pekko.stream.javadsl.Source Source]] containing the [[ObjectMetadata]]
- */
- @deprecated("Use S3.getObject instead", "4.0.0")
- def download(
- bucket: String,
- key: String,
- range: ByteRange,
- s3Headers: S3Headers): Source[Optional[JPair[Source[ByteString,
NotUsed], ObjectMetadata]], NotUsed] = {
- val scalaRange = range.asInstanceOf[ScalaByteRange]
- toJava(
- S3Stream.download(S3Location(bucket, key), Some(scalaRange), None,
s3Headers))
- }
-
- /**
- * Downloads a specific byte range of a S3 Object
- *
- * @param bucket the s3 bucket name
- * @param key the s3 object key
- * @param range the [[pekko.http.javadsl.model.headers.ByteRange ByteRange]]
you want to download
- * @param versionId optional version id of the object
- * @param s3Headers any headers you want to add
- * @return A [[pekko.japi.Pair]] with a [[pekko.stream.javadsl.Source
Source]] of [[pekko.util.ByteString ByteString]], and a
[[pekko.stream.javadsl.Source Source]] containing the [[ObjectMetadata]]
- */
- @deprecated("Use S3.getObject instead", "4.0.0")
- def download(
- bucket: String,
- key: String,
- range: ByteRange,
- versionId: Optional[String],
- s3Headers: S3Headers): Source[Optional[JPair[Source[ByteString,
NotUsed], ObjectMetadata]], NotUsed] = {
- val scalaRange = range.asInstanceOf[ScalaByteRange]
- toJava(
- S3Stream.download(S3Location(bucket, key), Option(scalaRange),
Option(versionId.orElse(null)), s3Headers))
- }
-
/**
* Gets a S3 Object
*
diff --git
a/s3/src/main/scala/org/apache/pekko/stream/connectors/s3/scaladsl/S3.scala
b/s3/src/main/scala/org/apache/pekko/stream/connectors/s3/scaladsl/S3.scala
index 9a09fef56..6e1fcb36b 100644
--- a/s3/src/main/scala/org/apache/pekko/stream/connectors/s3/scaladsl/S3.scala
+++ b/s3/src/main/scala/org/apache/pekko/stream/connectors/s3/scaladsl/S3.scala
@@ -194,45 +194,6 @@ object S3 {
s3Headers: S3Headers): Source[ObjectMetadata, NotUsed] =
S3Stream.putObject(S3Location(bucket, key), contentType, data,
contentLength, s3Headers)
- /**
- * Downloads a S3 Object
- *
- * @param bucket the s3 bucket name
- * @param key the s3 object key
- * @param range [optional] the [[pekko.http.scaladsl.model.headers.ByteRange
ByteRange]] you want to download
- * @param sse [optional] the server side encryption used on upload
- * @return The source will emit an empty [[scala.Option Option]] if an
object can not be found.
- * Otherwise [[scala.Option Option]] will contain a tuple of
object's data and metadata.
- */
- @deprecated("Use S3.getObject instead", "4.0.0")
- def download(
- bucket: String,
- key: String,
- range: Option[ByteRange] = None,
- versionId: Option[String] = None,
- sse: Option[ServerSideEncryption] = None)
- : Source[Option[(Source[ByteString, NotUsed], ObjectMetadata)], NotUsed]
=
- download(bucket, key, range, versionId,
S3Headers.empty.withOptionalServerSideEncryption(sse))
-
- /**
- * Downloads a S3 Object
- *
- * @param bucket the s3 bucket name
- * @param key the s3 object key
- * @param range [optional] the [[pekko.http.scaladsl.model.headers.ByteRange
ByteRange]] you want to download
- * @param s3Headers any headers you want to add
- * @return The source will emit an empty [[scala.Option Option]] if an
object can not be found.
- * Otherwise [[scala.Option Option]] will contain a tuple of
object's data and metadata.
- */
- @deprecated("Use S3.getObject instead", "4.0.0")
- def download(
- bucket: String,
- key: String,
- range: Option[ByteRange],
- versionId: Option[String],
- s3Headers: S3Headers): Source[Option[(Source[ByteString, NotUsed],
ObjectMetadata)], NotUsed] =
- S3Stream.download(S3Location(bucket, key), range, versionId, s3Headers)
-
/**
* Gets a S3 Object
*
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]