Class EventGridClientImpl

  • All Implemented Interfaces:
    EventGridClient

    public class EventGridClientImpl
    extends com.microsoft.azure.AzureServiceClient
    implements EventGridClient
    Initializes a new instance of the EventGridClientImpl class.
    • Constructor Detail

      • EventGridClientImpl

        public EventGridClientImpl​(com.microsoft.rest.credentials.ServiceClientCredentials credentials)
        Initializes an instance of EventGridClient client.
        Parameters:
        credentials - the management credentials for Azure
      • EventGridClientImpl

        public EventGridClientImpl​(com.microsoft.rest.RestClient restClient)
        Initializes an instance of EventGridClient client.
        Parameters:
        restClient - the REST client to connect to Azure.
    • Method Detail

      • getAzureClient

        public com.microsoft.azure.AzureClient getAzureClient()
        Gets the AzureClient used for long running operations.
        Specified by:
        getAzureClient in interface EventGridClient
        Returns:
        the azure client;
      • apiVersion

        public String apiVersion()
        Gets Version of the API to be used with the client request.
        Specified by:
        apiVersion in interface EventGridClient
        Returns:
        the apiVersion value.
      • acceptLanguage

        public String acceptLanguage()
        Gets Gets or sets the preferred language for the response.
        Specified by:
        acceptLanguage in interface EventGridClient
        Returns:
        the acceptLanguage value.
      • withAcceptLanguage

        public EventGridClientImpl withAcceptLanguage​(String acceptLanguage)
        Sets Gets or sets the preferred language for the response.
        Specified by:
        withAcceptLanguage in interface EventGridClient
        Parameters:
        acceptLanguage - the acceptLanguage value.
        Returns:
        the service client itself
      • longRunningOperationRetryTimeout

        public int longRunningOperationRetryTimeout()
        Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
        Specified by:
        longRunningOperationRetryTimeout in interface EventGridClient
        Returns:
        the longRunningOperationRetryTimeout value.
      • withLongRunningOperationRetryTimeout

        public EventGridClientImpl withLongRunningOperationRetryTimeout​(int longRunningOperationRetryTimeout)
        Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
        Specified by:
        withLongRunningOperationRetryTimeout in interface EventGridClient
        Parameters:
        longRunningOperationRetryTimeout - the longRunningOperationRetryTimeout value.
        Returns:
        the service client itself
      • generateClientRequestId

        public boolean generateClientRequestId()
        Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
        Specified by:
        generateClientRequestId in interface EventGridClient
        Returns:
        the generateClientRequestId value.
      • withGenerateClientRequestId

        public EventGridClientImpl withGenerateClientRequestId​(boolean generateClientRequestId)
        Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
        Specified by:
        withGenerateClientRequestId in interface EventGridClient
        Parameters:
        generateClientRequestId - the generateClientRequestId value.
        Returns:
        the service client itself
      • initialize

        protected void initialize()
      • userAgent

        public String userAgent()
        Gets the User-Agent header for the client.
        Specified by:
        userAgent in interface EventGridClient
        Overrides:
        userAgent in class com.microsoft.azure.AzureServiceClient
        Returns:
        the user agent string.
      • publishEvents

        public void publishEvents​(String topicHostname,
                                  List<EventGridEvent> events)
        Publishes a batch of events to an Azure Event Grid topic.
        Specified by:
        publishEvents in interface EventGridClient
        Parameters:
        topicHostname - The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net
        events - An array of events to be published to Event Grid.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
        com.microsoft.azure.CloudException - thrown if the request is rejected by server
        RuntimeException - all other wrapped checked exceptions if the request fails to be sent
      • publishEventsAsync

        public com.microsoft.rest.ServiceFuture<Void> publishEventsAsync​(String topicHostname,
                                                                         List<EventGridEvent> events,
                                                                         com.microsoft.rest.ServiceCallback<Void> serviceCallback)
        Publishes a batch of events to an Azure Event Grid topic.
        Specified by:
        publishEventsAsync in interface EventGridClient
        Parameters:
        topicHostname - The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net
        events - An array of events to be published to Event Grid.
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • publishEventsAsync

        public rx.Observable<Void> publishEventsAsync​(String topicHostname,
                                                      List<EventGridEvent> events)
        Publishes a batch of events to an Azure Event Grid topic.
        Specified by:
        publishEventsAsync in interface EventGridClient
        Parameters:
        topicHostname - The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net
        events - An array of events to be published to Event Grid.
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • publishEventsWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<Void>> publishEventsWithServiceResponseAsync​(String topicHostname,
                                                                                                             List<EventGridEvent> events)
        Publishes a batch of events to an Azure Event Grid topic.
        Specified by:
        publishEventsWithServiceResponseAsync in interface EventGridClient
        Parameters:
        topicHostname - The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net
        events - An array of events to be published to Event Grid.
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation