Package com.azure.messaging.eventgrid
Class EventGridPublisherClientBuilder
java.lang.Object
com.azure.messaging.eventgrid.EventGridPublisherClientBuilder
- All Implemented Interfaces:
com.azure.core.client.traits.AzureKeyCredentialTrait<EventGridPublisherClientBuilder>,com.azure.core.client.traits.AzureSasCredentialTrait<EventGridPublisherClientBuilder>,com.azure.core.client.traits.ConfigurationTrait<EventGridPublisherClientBuilder>,com.azure.core.client.traits.EndpointTrait<EventGridPublisherClientBuilder>,com.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>,com.azure.core.client.traits.TokenCredentialTrait<EventGridPublisherClientBuilder>
public final class EventGridPublisherClientBuilder
extends Object
implements com.azure.core.client.traits.TokenCredentialTrait<EventGridPublisherClientBuilder>, com.azure.core.client.traits.AzureKeyCredentialTrait<EventGridPublisherClientBuilder>, com.azure.core.client.traits.AzureSasCredentialTrait<EventGridPublisherClientBuilder>, com.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>, com.azure.core.client.traits.ConfigurationTrait<EventGridPublisherClientBuilder>, com.azure.core.client.traits.EndpointTrait<EventGridPublisherClientBuilder>
A Builder class to create service clients that can publish events to EventGrid.
- See Also:
-
EventGridPublisherAsyncClientEventGridEventCloudEvent
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance with default building settings. -
Method Summary
Modifier and TypeMethodDescriptionaddPolicy(com.azure.core.http.policy.HttpPipelinePolicy httpPipelinePolicy) EventGridPublisherAsyncClient<com.azure.core.models.CloudEvent>Build aCloudEventpublisher client with asynchronous publishing methods and the current settings.EventGridPublisherClient<com.azure.core.models.CloudEvent>Build aCloudEventpublisher client with synchronous publishing methods and the current settings.EventGridPublisherAsyncClient<com.azure.core.util.BinaryData>Build a custom event publisher client with asynchronous publishing methods and the current settings.EventGridPublisherClient<com.azure.core.util.BinaryData>Build a custom event publisher client with synchronous publishing methods and the current settings.Build anEventGridEventpublisher client with asynchronous publishing methods and the current settings.Build anEventGridEventpublisher client with synchronous publishing methods and the current settings.clientOptions(com.azure.core.util.ClientOptions clientOptions) configuration(com.azure.core.util.Configuration configuration) credential(com.azure.core.credential.AzureKeyCredential credential) credential(com.azure.core.credential.AzureSasCredential credential) credential(com.azure.core.credential.TokenCredential credential) Set the domain or topic endpoint.httpClient(com.azure.core.http.HttpClient httpClient) httpLogOptions(com.azure.core.http.policy.HttpLogOptions httpLogOptions) pipeline(com.azure.core.http.HttpPipeline httpPipeline) retryOptions(com.azure.core.http.policy.RetryOptions retryOptions) retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy) Add a custom retry policy to the pipeline.serviceVersion(EventGridServiceVersion serviceVersion) Set the service version to use for requests to the event grid service.
-
Constructor Details
-
EventGridPublisherClientBuilder
public EventGridPublisherClientBuilder()Construct a new instance with default building settings. The endpoint and one credential method must be set in order for the client to be built.
-
-
Method Details
-
addPolicy
public EventGridPublisherClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy httpPipelinePolicy) - Specified by:
addPolicyin interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>
-
retryPolicy
public EventGridPublisherClientBuilder retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy) Add a custom retry policy to the pipeline. The default isRetryPolicy(). Setting this is mutually exclusive with usingretryOptions(RetryOptions).- Parameters:
retryPolicy- the retry policy to add.- Returns:
- the builder itself.
-
retryOptions
public EventGridPublisherClientBuilder retryOptions(com.azure.core.http.policy.RetryOptions retryOptions) - Specified by:
retryOptionsin interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>
-
clientOptions
public EventGridPublisherClientBuilder clientOptions(com.azure.core.util.ClientOptions clientOptions) - Specified by:
clientOptionsin interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>
-
configuration
public EventGridPublisherClientBuilder configuration(com.azure.core.util.Configuration configuration) - Specified by:
configurationin interfacecom.azure.core.client.traits.ConfigurationTrait<EventGridPublisherClientBuilder>
-
credential
public EventGridPublisherClientBuilder credential(com.azure.core.credential.AzureKeyCredential credential) - Specified by:
credentialin interfacecom.azure.core.client.traits.AzureKeyCredentialTrait<EventGridPublisherClientBuilder>
-
credential
public EventGridPublisherClientBuilder credential(com.azure.core.credential.AzureSasCredential credential) - Specified by:
credentialin interfacecom.azure.core.client.traits.AzureSasCredentialTrait<EventGridPublisherClientBuilder>
-
credential
public EventGridPublisherClientBuilder credential(com.azure.core.credential.TokenCredential credential) - Specified by:
credentialin interfacecom.azure.core.client.traits.TokenCredentialTrait<EventGridPublisherClientBuilder>
-
endpoint
Set the domain or topic endpoint. This is the address to publish events to. It must be the full url of the endpoint instead of just the hostname.- Specified by:
endpointin interfacecom.azure.core.client.traits.EndpointTrait<EventGridPublisherClientBuilder>- Parameters:
endpoint- the endpoint as a url.- Returns:
- the builder itself.
- Throws:
NullPointerException- ifendpointis null.IllegalArgumentException- ifendpointcannot be parsed into a valid URL.
-
httpClient
- Specified by:
httpClientin interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>
-
httpLogOptions
public EventGridPublisherClientBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions httpLogOptions) - Specified by:
httpLogOptionsin interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>
-
pipeline
- Specified by:
pipelinein interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>
-
serviceVersion
Set the service version to use for requests to the event grid service. SeeEventGridServiceVersionfor more information about possible service versions.- Parameters:
serviceVersion- the service version to set. By default this will use the latest available version.- Returns:
- the builder itself
-
buildCloudEventPublisherAsyncClient
public EventGridPublisherAsyncClient<com.azure.core.models.CloudEvent> buildCloudEventPublisherAsyncClient()Build aCloudEventpublisher client with asynchronous publishing methods and the current settings. An endpoint must be set, and either a pipeline with correct authentication must be set, or a credential must be set in the form of anAzureSasCredentialor aAzureKeyCredentialat the respective methods. All other settings have defaults and are optional.- Returns:
- a publisher client with asynchronous publishing methods.
-
buildEventGridEventPublisherAsyncClient
Build anEventGridEventpublisher client with asynchronous publishing methods and the current settings. An endpoint must be set, and either a pipeline with correct authentication must be set, or a credential must be set in the form of anAzureSasCredentialor aAzureKeyCredentialat the respective methods. All other settings have defaults and are optional.- Returns:
- a publisher client with asynchronous publishing methods.
-
buildCustomEventPublisherAsyncClient
public EventGridPublisherAsyncClient<com.azure.core.util.BinaryData> buildCustomEventPublisherAsyncClient()Build a custom event publisher client with asynchronous publishing methods and the current settings. An endpoint must be set, and either a pipeline with correct authentication must be set, or a credential must be set in the form of anAzureSasCredentialor aAzureKeyCredentialat the respective methods. All other settings have defaults and are optional.- Returns:
- a publisher client with asynchronous publishing methods.
-
buildCloudEventPublisherClient
Build aCloudEventpublisher client with synchronous publishing methods and the current settings. Endpoint and a credential must be set (either keyCredential or sharedAccessSignatureCredential), all other settings have defaults and/or are optional.- Returns:
- a publisher client with synchronous publishing methods.
-
buildEventGridEventPublisherClient
Build anEventGridEventpublisher client with synchronous publishing methods and the current settings. Endpoint and a credential must be set (either keyCredential or sharedAccessSignatureCredential), all other settings have defaults and/or are optional.- Returns:
- a publisher client with synchronous publishing methods.
-
buildCustomEventPublisherClient
Build a custom event publisher client with synchronous publishing methods and the current settings. Endpoint and a credential must be set (either keyCredential or sharedAccessSignatureCredential), all other settings have defaults and/or are optional.- Returns:
- a publisher client with synchronous publishing methods.
-