データクライアント通知アプリ

NotificationApiNotification REST API をミラーリングします。

カタログまたはサブスクリプションが変更されたときに通知を受け取る方法を提供します。

NotificationApiのすべての仕様については 、 NotificationApi を参照してください。

次のページで は、リクエストごとの設定メトリックについて説明します。

Scala
Java
val client = BaseClient()
val notificationApi = client.of[NotificationAPIV2Api]

val someHrn = "hrn:here:data::olp-here-test:whatever"
val someLayer = "whateverStreamLayer"
val result: Future[String] =
  notificationApi
    .subscribe(someHrn,
               SubscribeRequest(notificationCatalogHRN = Some(someHrn),
                                notificationStreamLayerId = Some(someLayer)))
    .executeToEntity()

result
  .andThen {
    case Success(subscriptionId) =>
      // do something with the subscription id
      println(s"${subscriptionId}")
    case Failure(ex) =>
      ex.printStackTrace()
  }

Await.result(result, Duration.Inf)
BaseClient client = BaseClientJava.instance();
NotificationAPIV2Api notificationApi = new NotificationAPIV2Api(client);

String someHrn = "hrn:here:data::olp-here-test:whatever";
String someLayer = "whateverStreamLayer";

String subscriptionId =
    notificationApi
        .subscribe()
        .withHrn(someHrn)
        .withSubscribeRequest(
            new JSubscribeRequest.Builder()
                .withNotificationCatalogHRN(someHrn)
                .withNotificationStreamLayerId(someLayer)
                .build())
        .build()
        .executeToEntity()
        .toCompletableFuture()
        .join();

// do something with the the subscription id
System.out.println(subscriptionId);

」に一致する結果は 件です

    」に一致する結果はありません