Class EventGridCloudNativeEventPublisher
- java.lang.Object
-
- com.azure.messaging.eventgrid.cloudnative.cloudevents.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, seeEventGridPublisherClient
.
-
-
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
- ifevent
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
- ifevent
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
- ifevents
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
- ifevents
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
- ifevents
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
- ifevents
is null.
-
-