@SuppressWarnings({ "deprecation" }) private void successBatchGetKV(BatchGetKVRequest request, Response<BatchKVResponse<K, EntityResponse<RT>>> responseToBatch, Entry<RestRequestBatchKey, BatchEntry<Response<Object>>> entry, final ProtocolVersion version) { Set<String> ids = (Set<String>) request.getObjectIds().stream() .map(o -> BatchResponse.keyToString(o, version)) .collect(Collectors.toSet()); DataMap dm = filterIdsInBatchResult(responseToBatch.getEntity().data(), ids); BatchKVResponse br = new BatchKVResponse(dm, request.getResourceSpec().getKeyType(), request.getResourceSpec().getValueType(), request.getResourceSpec().getKeyParts(), request.getResourceSpec().getComplexKeyType(), version); Response rsp = new ResponseImpl(responseToBatch, br); entry.getValue().getPromise().done(rsp); }
throws ServiceUnavailableException Set<K> idObjects = (Set<K>) request.getObjectIds(); new BatchGetRequestBuilder<K, T>(request.getBaseUriTemplate(), (Class<T>)request.getResourceProperties().getValueType().getType(), request.getResourceSpec(), request.getRequestOptions()); for (Map.Entry<String, Object> param : request.getQueryParamsObjects().entrySet()) for (Map.Entry<String, String> header : request.getHeaders().entrySet())
final ResourceSpec firstResourceSpec = firstRequest.getResourceSpec(); final Map<String, Object> batchQueryParams = getReadOnlyQueryParameters(BatchGetRequestUtil.getBatchQueryParam(requests, batchFields)); getReadOnlyHeaders(firstRequest.getHeaders()), getReadOnlyCookies(firstRequest.getCookies()), firstRequest.getResponseDecoder(), batchQueryParams, Collections.<String, Class<?>>emptyMap(), firstResourceSpec, firstRequest.getBaseUriTemplate(), getReadOnlyPathKeys(firstRequest.getPathKeys()), firstRequest.getRequestOptions());
public BatchGetKVRequest<K, V> buildKV() { ensureBatchKeys(); //Framework code should ensure that the ResourceSpec matches the static types of these parameters @SuppressWarnings("unchecked") BatchKVResponseDecoder<K, V> decoder = new BatchKVResponseDecoder<K, V>((TypeSpec<V>) _resourceSpec.getValueType(), (TypeSpec<K>) _resourceSpec.getKeyType(), _resourceSpec.getKeyParts(), _resourceSpec.getComplexKeyType()); return new BatchGetKVRequest<K, V>(buildReadOnlyHeaders(), buildReadOnlyCookies(), decoder, buildReadOnlyQueryParameters(), getQueryParamClasses(), _resourceSpec, getBaseUriTemplate(), buildReadOnlyPathKeys(), getRequestOptions()); }