public final class ClientCall<REQ extends BmcRequest<?>,RESP extends BmcResponse,RESP_BUILDER extends BmcResponse.Builder<RESP>> extends Object
public static <REQ extends BmcRequest<?>,RESP extends BmcResponse,RESP_BUILDER extends BmcResponse.Builder<RESP>> ClientCall<REQ,RESP,RESP_BUILDER> builder(com.oracle.bmc.http.client.HttpClient httpClient, REQ request, Supplier<RESP_BUILDER> responseBuilder)
public ClientCall<REQ,RESP,RESP_BUILDER> clientConfigurator(ClientConfigurator clientConfigurator)
public ClientCall<REQ,RESP,RESP_BUILDER> circuitBreaker(@Nullable OciCircuitBreaker circuitBreaker)
Use a circuit breaker for this call. The results passed to OciCircuitBreaker.onResult(long, java.util.concurrent.TimeUnit, java.lang.Object)
are always of type HttpResponse
public ClientCall<REQ,RESP,RESP_BUILDER> logger(org.slf4j.Logger logger, String nickname)
public ClientCall<REQ,RESP,RESP_BUILDER> serviceDetails(String serviceName, String operationName, String apiReferenceLink)
public ClientCall<REQ,RESP,RESP_BUILDER> method(com.oracle.bmc.http.client.Method method)
public ClientCall<REQ,RESP,RESP_BUILDER> hasBinaryRequestBody()
public ClientCall<REQ,RESP,RESP_BUILDER> hasBody()
public ClientCall<REQ,RESP,RESP_BUILDER> operationUsesDefaultRetries()
public ClientCall<REQ,RESP,RESP_BUILDER> obmcsSigningStrategy(SigningStrategy obmcsSigningStrategy)
public ClientCall<REQ,RESP,RESP_BUILDER> authenticationDetailsProvider(AbstractAuthenticationDetailsProvider authenticationDetailsProvider)
public ClientCall<REQ,RESP,RESP_BUILDER> retryConfiguration(RetryConfiguration retryConfiguration)
public ClientCall<REQ,RESP,RESP_BUILDER> requestBuilder(Supplier<BmcRequest.Builder<? extends REQ,?>> requestBuilder)
public ClientCall<REQ,RESP,RESP_BUILDER> interceptResponse(UnaryOperator<RESP> interceptResponse)
public ClientCall<REQ,RESP,RESP_BUILDER> basePath(String basePath)
public ClientCall<REQ,RESP,RESP_BUILDER> appendPathPart(String pathPart)
public ClientCall<REQ,RESP,RESP_BUILDER> appendPathParam(String pathParamValue)
public ClientCall<REQ,RESP,RESP_BUILDER> appendPathParam(Number pathParamValue)
public ClientCall<REQ,RESP,RESP_BUILDER> appendPathParam(UUID pathParamValue)
public ClientCall<REQ,RESP,RESP_BUILDER> appendQueryParam(String name, Object value)
public ClientCall<REQ,RESP,RESP_BUILDER> appendEnumQueryParam(String name, BmcEnum value)
public ClientCall<REQ,RESP,RESP_BUILDER> appendListQueryParam(String name, List<?> values, CollectionFormatType collectionFormatType)
public ClientCall<REQ,RESP,RESP_BUILDER> appendMapQueryParam(String prefix, Map<String,?> values)
public ClientCall<REQ,RESP,RESP_BUILDER> accept(String... contentType)
public ClientCall<REQ,RESP,RESP_BUILDER> appendHeader(String name, String value)
public ClientCall<REQ,RESP,RESP_BUILDER> appendHeader(String name, Range value)
public ClientCall<REQ,RESP,RESP_BUILDER> appendHeader(String name, Number value)
public ClientCall<REQ,RESP,RESP_BUILDER> appendHeader(String name, Date value)
public ClientCall<REQ,RESP,RESP_BUILDER> appendHeader(String name, Boolean value)
public ClientCall<REQ,RESP,RESP_BUILDER> appendHeader(String name, BmcEnum value)
public ClientCall<REQ,RESP,RESP_BUILDER> appendEnumHeader(String name, BmcEnum value)
public ClientCall<REQ,RESP,RESP_BUILDER> appendMapHeader(String prefix, Map<String,?> queryParam)
Attempts to encode a header param if it is a Map
. Each key is prefixed with the value
passed as prefix
. If a value is a Collection
, then the “{prefix}{key}={item}”
output is repeated for each item in the collection, where “{item}” is encoded using encodeObjectQueryParam(Object)
. If the value is not a collection, then the output
is simply “{prefix}{key}={value}”, where the value is again encoded.
Note: this should be called much lower in the HTTP stack (currently being called through the generated code), so it can encode the serialized values.
prefix
- prefix for each keyqueryParam
- The map query parameter to encode.public <T> ClientCall<REQ,RESP,RESP_BUILDER> appendListHeader(String headerParamName, List<T> values, CollectionFormatType collectionFormatType)
Attempts to encode a header parameter which is described by a list of values for that
parameter and a CollectionFormatType
which describes how
the values should appear in the headers (e.g. as multiple parameters, as a single parameter
with a given delimiter).
headerParamName
- the name of the header parameter as it should appear in the query
stringvalues
- the values for the query parameter. An empty or null list will result in no
action being taken on the target instance. Additionally, any null values inside the list
will be ignoredcollectionFormatType
- describes how entries should appear in the query string, for
example as multiple parameters with the name query string parameter name/key, or as a
single parameter with its values separated by a delimiter character (comma, space, tab or
pipe)public ClientCall<REQ,RESP,RESP_BUILDER> appendHeaders(Map<String,String> values)
public <RESP_BODY> ClientCall<REQ,RESP,RESP_BUILDER> handleEventStream(BiConsumer<RESP_BUILDER,RESP_BODY> handle)
public <RESP_BODY> ClientCall<REQ,RESP,RESP_BUILDER> handleBody(Class<RESP_BODY> type, BiConsumer<RESP_BUILDER,RESP_BODY> handle)
@Deprecated public <RESP_BODY> ClientCall<REQ,RESP,RESP_BUILDER> handleBodyMap(Class<RESP_BODY> type, BiConsumer<RESP_BUILDER,Map<String,RESP_BODY>> handle)
Map
, instead declare
a wrapper type that takes the complex type as the parameter of a constructor annotated
with @JsonCreator(mode = DELEGATING)
. You can then pass the wrapper type to
handleBody(Class, BiConsumer)
and unwrap it in the handle
lambda.public <RESP_BODY> ClientCall<REQ,RESP,RESP_BUILDER> handleBodyList(Class<RESP_BODY> type, BiConsumer<RESP_BUILDER,List<RESP_BODY>> handle)
public ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeaderString(String name, BiConsumer<RESP_BUILDER,String> handle)
public ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeaderInteger(String name, BiConsumer<RESP_BUILDER,Integer> handle)
public ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeaderLong(String name, BiConsumer<RESP_BUILDER,Long> handle)
public ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeaderFloat(String name, BiConsumer<RESP_BUILDER,Float> handle)
public ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeaderDouble(String name, BiConsumer<RESP_BUILDER,Double> handle)
public ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeaderBoolean(String name, BiConsumer<RESP_BUILDER,Boolean> handle)
public ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeaderDate(String name, BiConsumer<RESP_BUILDER,Date> handle)
public ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeaderRange(String name, BiConsumer<RESP_BUILDER,Range> handle)
public ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeaderBigDecimal(String name, BiConsumer<RESP_BUILDER,BigDecimal> handle)
public <E> ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeaderEnum(String name, Function<String,E> parse, BiConsumer<RESP_BUILDER,E> handle)
public ClientCall<REQ,RESP,RESP_BUILDER> handleResponseHeadersMap(String prefix, BiConsumer<RESP_BUILDER,Map<String,String>> handle)
public Future<RESP> callAsync(AsyncHandler<REQ,RESP> handler)
public static RuntimeException tryUnwrapBmcException(CompletionException ce)
Try to unwrap the BmcException
that is somewhere in the causal chain of the CompletionException
, or return the original CompletionException
, if there was none.
ce
- the CompletionException
which may have a BmcException
in its causal
chainBmcException
from causal chain, or CompletionException
if there was
nonepublic RESP callSync()
public static String generateRequestId()
Copyright © 2016–2024. All rights reserved.