public interface HttpClient
Provides methods to make outbound HTTP calls, leveraging a ThirdPartyServiceModel to encapsulate the
configuration for the destination of the call.
A plugin obtains an instance of this interface by annotating a setter method for a HttpClient property with
the Inject annotation.
private HttpClient httpClient;
@Inject
void setHttpClient(HttpClient httpClient)
{
this.httpClient = httpClient;
}
Abstract base classes provided by the SDK for plugin interfaces also provide access to a HttpClient
instance without each plugin needing to declare a setter to receive the HttpClient instance and
a field to store the instance.
| Modifier and Type | Method and Description |
|---|---|
CompletionStage<ClientResponse> |
send(ClientRequest request,
ThirdPartyServiceModel thirdPartyServiceModel)
Sends the specified
ClientRequest to the third-party service represented by the
ThirdPartyServiceModel. |
CompletionStage<ClientResponse> send(ClientRequest request, ThirdPartyServiceModel thirdPartyServiceModel)
ClientRequest to the third-party service represented by the
ThirdPartyServiceModel.request - the ClientRequestthirdPartyServiceModel - the ThirdPartyServiceModel representing the third-party serviceCompletionStage representing the pending response served by the third-party service. The
CompletionStage will complete normally when the service produces a response. Otherwise, the
CompletionStage will complete exceptionally. If PingAccess fails to retrieve a response from
the third-party service, the exception will be a HttpClientException. The exception type is
otherwise unspecified.IllegalArgumentException - in the following cases:
ThirdPartyServiceModel does not represent a configured third-party service.
This can be expected to occur if ThirdPartyServiceModel is instantiated directly by a plugin
instead of delegating the construction to PingAccess.
IllegalStateException - if this method is invoked from a different thread than the thread originally used
to invoke the calling plugin.Copyright 2023 Ping Identity Corp. All rights reserved.