Class EventGridCloudNativeEventPublisher


  • public final class EventGridCloudNativeEventPublisher
    extends Object
    EventGrid cloud native event publisher sends the Cloud Native Computing Foundation(CNCF) CloudEvents by using Azure EventGrid publisher client, see EventGridPublisherClient.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void sendEvent​(com.azure.messaging.eventgrid.EventGridPublisherClient<com.azure.core.models.CloudEvent> syncClient, io.cloudevents.CloudEvent event)
      Publishes the given native cloud event to the set topic or domain.
      static Mono<Void> sendEventAsync​(com.azure.messaging.eventgrid.EventGridPublisherAsyncClient<com.azure.core.models.CloudEvent> asyncClient, io.cloudevents.CloudEvent event)
      Publishes the given native cloud event to the set topic or domain.
      static void sendEvents​(com.azure.messaging.eventgrid.EventGridPublisherClient<com.azure.core.models.CloudEvent> syncClient, Iterable<io.cloudevents.CloudEvent> events)
      Publishes the given native cloud events to the set topic or domain.
      static Mono<Void> sendEventsAsync​(com.azure.messaging.eventgrid.EventGridPublisherAsyncClient<com.azure.core.models.CloudEvent> asyncClient, Iterable<io.cloudevents.CloudEvent> events)
      Publishes the given native cloud events to the set topic or domain.
      static com.azure.core.http.rest.Response<Void> sendEventsWithResponse​(com.azure.messaging.eventgrid.EventGridPublisherClient<com.azure.core.models.CloudEvent> syncClient, Iterable<io.cloudevents.CloudEvent> events, com.azure.core.util.Context context)
      Publishes the given native cloud events to the set topic or domain and gives the response issued by EventGrid.
      static Mono<com.azure.core.http.rest.Response<Void>> sendEventsWithResponseAsync​(com.azure.messaging.eventgrid.EventGridPublisherAsyncClient<com.azure.core.models.CloudEvent> asyncClient, Iterable<io.cloudevents.CloudEvent> events)
      Publishes the given native cloud events to the set topic or domain and gives the response issued by EventGrid.
    • Method Detail

      • sendEvent

        public static void sendEvent​(com.azure.messaging.eventgrid.EventGridPublisherClient<com.azure.core.models.CloudEvent> syncClient,
                                     io.cloudevents.CloudEvent event)
        Publishes the given native cloud event to the set topic or domain.
        Parameters:
        syncClient - a service client that publishes events to an EventGrid topic or domain.
        event - the native cloud event to publish.
        Throws:
        NullPointerException - if event is null.
      • sendEventAsync

        public static Mono<Void> sendEventAsync​(com.azure.messaging.eventgrid.EventGridPublisherAsyncClient<com.azure.core.models.CloudEvent> asyncClient,
                                                io.cloudevents.CloudEvent event)
        Publishes the given native cloud event to the set topic or domain.
        Parameters:
        asyncClient - a service asynchronous client that publishes events to an EventGrid topic or domain.
        event - the native cloud event to publish.
        Returns:
        a Mono that completes when the events are sent to the service.
        Throws:
        NullPointerException - if event is null.
      • sendEvents

        public static void sendEvents​(com.azure.messaging.eventgrid.EventGridPublisherClient<com.azure.core.models.CloudEvent> syncClient,
                                      Iterable<io.cloudevents.CloudEvent> events)
        Publishes the given native cloud events to the set topic or domain.
        Parameters:
        syncClient - a service client that publishes events to an EventGrid topic or domain.
        events - the native cloud events to publish.
        Throws:
        NullPointerException - if events is null.
      • sendEventsAsync

        public static Mono<Void> sendEventsAsync​(com.azure.messaging.eventgrid.EventGridPublisherAsyncClient<com.azure.core.models.CloudEvent> asyncClient,
                                                 Iterable<io.cloudevents.CloudEvent> events)
        Publishes the given native cloud events to the set topic or domain.
        Parameters:
        asyncClient - a service asynchronous client that publishes events to an EventGrid topic or domain.
        events - the native cloud events to publish.
        Returns:
        a Mono that completes when the events are sent to the service.
        Throws:
        NullPointerException - if events is null.
      • sendEventsWithResponse

        public static com.azure.core.http.rest.Response<Void> sendEventsWithResponse​(com.azure.messaging.eventgrid.EventGridPublisherClient<com.azure.core.models.CloudEvent> syncClient,
                                                                                     Iterable<io.cloudevents.CloudEvent> events,
                                                                                     com.azure.core.util.Context context)
        Publishes the given native cloud events to the set topic or domain and gives the response issued by EventGrid.
        Parameters:
        syncClient - a service client that publishes events to an EventGrid topic or domain.
        events - the native cloud events to publish.
        context - the context to use along the pipeline.
        Returns:
        the response from the EventGrid service.
        Throws:
        NullPointerException - if events is null.
      • sendEventsWithResponseAsync

        public static Mono<com.azure.core.http.rest.Response<Void>> sendEventsWithResponseAsync​(com.azure.messaging.eventgrid.EventGridPublisherAsyncClient<com.azure.core.models.CloudEvent> asyncClient,
                                                                                                Iterable<io.cloudevents.CloudEvent> events)
        Publishes the given native cloud events to the set topic or domain and gives the response issued by EventGrid.
        Parameters:
        asyncClient - a service asynchronous client that publishes events to an EventGrid topic or domain.
        events - the native cloud events to publish.
        Returns:
        the response from the EventGrid service.
        Throws:
        NullPointerException - if events is null.