Class EventGridClientImpl
- java.lang.Object
-
- com.microsoft.rest.ServiceClient
-
- com.microsoft.azure.AzureServiceClient
-
- com.microsoft.azure.eventgrid.implementation.EventGridClientImpl
-
- All Implemented Interfaces:
EventGridClient
public class EventGridClientImpl extends com.microsoft.azure.AzureServiceClient implements EventGridClient
Initializes a new instance of the EventGridClientImpl class.
-
-
Constructor Summary
Constructors Constructor Description EventGridClientImpl(com.microsoft.rest.credentials.ServiceClientCredentials credentials)Initializes an instance of EventGridClient client.EventGridClientImpl(com.microsoft.rest.RestClient restClient)Initializes an instance of EventGridClient client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringacceptLanguage()Gets Gets or sets the preferred language for the response.StringapiVersion()Gets Version of the API to be used with the client request.booleangenerateClientRequestId()Gets When set to true a unique x-ms-client-request-id value is generated and included in each request.com.microsoft.azure.AzureClientgetAzureClient()Gets theAzureClientused for long running operations.protected voidinitialize()intlongRunningOperationRetryTimeout()Gets Gets or sets the retry timeout in seconds for Long Running Operations.voidpublishEvents(String topicHostname, List<EventGridEvent> events)Publishes a batch of events to an Azure Event Grid topic.rx.Observable<Void>publishEventsAsync(String topicHostname, List<EventGridEvent> events)Publishes a batch of events to an Azure Event Grid topic.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.rx.Observable<com.microsoft.rest.ServiceResponse<Void>>publishEventsWithServiceResponseAsync(String topicHostname, List<EventGridEvent> events)Publishes a batch of events to an Azure Event Grid topic.StringuserAgent()Gets the User-Agent header for the client.EventGridClientImplwithAcceptLanguage(String acceptLanguage)Sets Gets or sets the preferred language for the response.EventGridClientImplwithGenerateClientRequestId(boolean generateClientRequestId)Sets When set to true a unique x-ms-client-request-id value is generated and included in each request.EventGridClientImplwithLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout)Sets Gets or sets the retry timeout in seconds for Long Running Operations.-
Methods inherited from class com.microsoft.rest.ServiceClient
httpClient, restClient, retrofit, serializerAdapter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microsoft.azure.eventgrid.EventGridClient
restClient
-
-
-
-
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 theAzureClientused for long running operations.- Specified by:
getAzureClientin interfaceEventGridClient- Returns:
- the azure client;
-
apiVersion
public String apiVersion()
Gets Version of the API to be used with the client request.- Specified by:
apiVersionin interfaceEventGridClient- Returns:
- the apiVersion value.
-
acceptLanguage
public String acceptLanguage()
Gets Gets or sets the preferred language for the response.- Specified by:
acceptLanguagein interfaceEventGridClient- Returns:
- the acceptLanguage value.
-
withAcceptLanguage
public EventGridClientImpl withAcceptLanguage(String acceptLanguage)
Sets Gets or sets the preferred language for the response.- Specified by:
withAcceptLanguagein interfaceEventGridClient- 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:
longRunningOperationRetryTimeoutin interfaceEventGridClient- 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:
withLongRunningOperationRetryTimeoutin interfaceEventGridClient- 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:
generateClientRequestIdin interfaceEventGridClient- 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:
withGenerateClientRequestIdin interfaceEventGridClient- 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:
userAgentin interfaceEventGridClient- Overrides:
userAgentin classcom.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:
publishEventsin interfaceEventGridClient- Parameters:
topicHostname- The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.netevents- An array of events to be published to Event Grid.- Throws:
IllegalArgumentException- thrown if parameters fail the validationcom.microsoft.azure.CloudException- thrown if the request is rejected by serverRuntimeException- 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:
publishEventsAsyncin interfaceEventGridClient- Parameters:
topicHostname- The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.netevents- An array of events to be published to Event Grid.serviceCallback- the async ServiceCallback to handle successful and failed responses.- Returns:
- the
ServiceFutureobject - 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:
publishEventsAsyncin interfaceEventGridClient- Parameters:
topicHostname- The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.netevents- An array of events to be published to Event Grid.- Returns:
- the
ServiceResponseobject 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:
publishEventsWithServiceResponseAsyncin interfaceEventGridClient- Parameters:
topicHostname- The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.netevents- An array of events to be published to Event Grid.- Returns:
- the
ServiceResponseobject if successful. - Throws:
IllegalArgumentException- thrown if parameters fail the validation
-
-