Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.seeq.api;
import com.seeq.ApiException;
import com.seeq.ApiClient;
import com.seeq.Configuration;
import com.seeq.model.*;
import com.seeq.Pair;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.ProcessingException;
import com.seeq.model.DebugCacheBlockOutputV1;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UnstableApi {
private ApiClient apiClient;
private long retryTimeout = 5_000; // Default of 5 seconds
public UnstableApi() {
this(Configuration.getDefaultApiClient());
}
public UnstableApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public void setRetryTimeout(long retryTimeout) {
this.retryTimeout = retryTimeout;
}
public long getRetryTimeout() {
return this.retryTimeout;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get raw cache data associated with the supplied cacheId.
*
* @param cacheId (required)
* @param start An 8601 timestamp corresponding to the key at the beginning of the query interval. (required)
* @param exclusiveEnd An 8601 timestamp corresponding to the key at the end of the query interval. (required)
* @param maxDatums The maximum number of datums to retrieve from the persistent cache. If a request exceeds this value, the result will be truncated. Cannot be larger than: 1048576 unless `metadataOnly` is true. (optional)
* @param metadataOnly If set to true, the endpoint will only return cache record metadata (no decompression). (required)
* @param overrideTimeout A duration, in minutes, that should be used as a timeout for the GRPC connection. Default: 2 minutes. (optional)
* @return DebugCacheBlockOutputV1
* @throws ApiException if fails to make API call
*/
public DebugCacheBlockOutputV1 getCache(String cacheId, String start, String exclusiveEnd, String maxDatums, Boolean metadataOnly, String overrideTimeout) throws ApiException {
ApiClient.ApiResponse localVarResponse = getCacheWithHttpInfo(cacheId, start, exclusiveEnd, maxDatums, metadataOnly, overrideTimeout);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get raw cache data associated with the supplied cacheId.
*
* @param cacheId (required)
* @param start An 8601 timestamp corresponding to the key at the beginning of the query interval. (required)
* @param exclusiveEnd An 8601 timestamp corresponding to the key at the end of the query interval. (required)
* @param maxDatums The maximum number of datums to retrieve from the persistent cache. If a request exceeds this value, the result will be truncated. Cannot be larger than: 1048576 unless `metadataOnly` is true. (optional)
* @param metadataOnly If set to true, the endpoint will only return cache record metadata (no decompression). (required)
* @param overrideTimeout A duration, in minutes, that should be used as a timeout for the GRPC connection. Default: 2 minutes. (optional)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getCacheWithHttpInfo(String cacheId, String start, String exclusiveEnd, String maxDatums, Boolean metadataOnly, String overrideTimeout) throws ApiException {
Map localVarHeaderParams = new HashMap();
return getCacheWithHeadersAndHttpInfo(cacheId, start, exclusiveEnd, maxDatums, metadataOnly, overrideTimeout, localVarHeaderParams);
}
/**
* Get raw cache data associated with the supplied cacheId.
*
* @param cacheId (required)
* @param start An 8601 timestamp corresponding to the key at the beginning of the query interval. (required)
* @param exclusiveEnd An 8601 timestamp corresponding to the key at the end of the query interval. (required)
* @param maxDatums The maximum number of datums to retrieve from the persistent cache. If a request exceeds this value, the result will be truncated. Cannot be larger than: 1048576 unless `metadataOnly` is true. (optional)
* @param metadataOnly If set to true, the endpoint will only return cache record metadata (no decompression). (required)
* @param overrideTimeout A duration, in minutes, that should be used as a timeout for the GRPC connection. Default: 2 minutes. (optional)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getCacheWithHeadersAndHttpInfo(String cacheId, String start, String exclusiveEnd, String maxDatums, Boolean metadataOnly, String overrideTimeout, Map customHeaders) throws ApiException {
// verify the required query parameter 'start' is set
if (start == null) {
throw new ApiException(400, "Missing the required query parameter 'start' when calling getCache");
}
// verify the required query parameter 'exclusiveEnd' is set
if (exclusiveEnd == null) {
throw new ApiException(400, "Missing the required query parameter 'exclusiveEnd' when calling getCache");
}
// verify the required query parameter 'metadataOnly' is set
if (metadataOnly == null) {
throw new ApiException(400, "Missing the required query parameter 'metadataOnly' when calling getCache");
}
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "exclusiveEnd", exclusiveEnd));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "maxDatums", maxDatums));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "metadataOnly", metadataOnly));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "overrideTimeout", overrideTimeout));
localVarHeaderParams.putAll(customHeaders);
return getCacheInternal(cacheId, localVarQueryParams, localVarHeaderParams);
}
private ApiClient.ApiResponse getCacheInternal(String cacheId, List queryParams, Map headerParams) throws ApiException {
Object localVarPostBody = null;
// verify the required path parameter 'cacheId' is set
if (cacheId == null) {
throw new ApiException(400, "Missing the required path parameter 'cacheId' when calling getCache");
}
// create path and map variables
String localVarPath = "/cache/{cacheId}/blocks"
.replaceAll("\\{" + "cacheId" + "\\}", apiClient.escapeString(cacheId.toString()));
// query params
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", queryParams, localVarPostBody, headerParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
// OVERLOADS START
/**
* Get raw cache data associated with the supplied cacheId.
*
* @param cacheId (required)
* @param start An 8601 timestamp corresponding to the key at the beginning of the query interval. (required)
* @param exclusiveEnd An 8601 timestamp corresponding to the key at the end of the query interval. (required)
* @param maxDatums The maximum number of datums to retrieve from the persistent cache. If a request exceeds this value, the result will be truncated. Cannot be larger than: 1048576 unless `metadataOnly` is true. (optional)
* @param metadataOnly If set to true, the endpoint will only return cache record metadata (no decompression). (required)
* @return DebugCacheBlockOutputV1
* @throws ApiException if fails to make API call
*/
public DebugCacheBlockOutputV1 getCache(String cacheId, String start, String exclusiveEnd, String maxDatums, Boolean metadataOnly) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (start == null) {
throw new ApiException(400, "Missing the required query parameter 'start' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));
if (exclusiveEnd == null) {
throw new ApiException(400, "Missing the required query parameter 'exclusiveEnd' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "exclusiveEnd", exclusiveEnd));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "maxDatums", maxDatums));
if (metadataOnly == null) {
throw new ApiException(400, "Missing the required query parameter 'metadataOnly' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "metadataOnly", metadataOnly));
ApiClient.ApiResponse localVarResponse = getCacheInternal(cacheId, localVarQueryParams, localVarHeaderParams);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get raw cache data associated with the supplied cacheId.
* @param cacheId (required)
* @param start An 8601 timestamp corresponding to the key at the beginning of the query interval. (required)
* @param exclusiveEnd An 8601 timestamp corresponding to the key at the end of the query interval. (required)
* @param maxDatums The maximum number of datums to retrieve from the persistent cache. If a request exceeds this value, the result will be truncated. Cannot be larger than: 1048576 unless `metadataOnly` is true. (optional)
* @param metadataOnly If set to true, the endpoint will only return cache record metadata (no decompression). (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getCacheWithHttpInfo(String cacheId, String start, String exclusiveEnd, String maxDatums, Boolean metadataOnly) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (start == null) {
throw new ApiException(400, "Missing the required query parameter 'start' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));
if (exclusiveEnd == null) {
throw new ApiException(400, "Missing the required query parameter 'exclusiveEnd' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "exclusiveEnd", exclusiveEnd));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "maxDatums", maxDatums));
if (metadataOnly == null) {
throw new ApiException(400, "Missing the required query parameter 'metadataOnly' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "metadataOnly", metadataOnly));
return getCacheInternal(cacheId, localVarQueryParams, localVarHeaderParams);
}
/**
* Get raw cache data associated with the supplied cacheId.
*
* @param cacheId (required)
* @param start An 8601 timestamp corresponding to the key at the beginning of the query interval. (required)
* @param exclusiveEnd An 8601 timestamp corresponding to the key at the end of the query interval. (required)
* @param maxDatums The maximum number of datums to retrieve from the persistent cache. If a request exceeds this value, the result will be truncated. Cannot be larger than: 1048576 unless `metadataOnly` is true. (optional)
* @param metadataOnly If set to true, the endpoint will only return cache record metadata (no decompression). (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getCacheWithHeadersAndHttpInfo(String cacheId, String start, String exclusiveEnd, String maxDatums, Boolean metadataOnly, Map customHeaders) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (start == null) {
throw new ApiException(400, "Missing the required query parameter 'start' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));
if (exclusiveEnd == null) {
throw new ApiException(400, "Missing the required query parameter 'exclusiveEnd' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "exclusiveEnd", exclusiveEnd));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "maxDatums", maxDatums));
if (metadataOnly == null) {
throw new ApiException(400, "Missing the required query parameter 'metadataOnly' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "metadataOnly", metadataOnly));
localVarHeaderParams.putAll(customHeaders);
return getCacheInternal(cacheId, localVarQueryParams, localVarHeaderParams);
}
/**
* Get raw cache data associated with the supplied cacheId.
*
* @param cacheId (required)
* @param start An 8601 timestamp corresponding to the key at the beginning of the query interval. (required)
* @param exclusiveEnd An 8601 timestamp corresponding to the key at the end of the query interval. (required)
* @param metadataOnly If set to true, the endpoint will only return cache record metadata (no decompression). (required)
* @return DebugCacheBlockOutputV1
* @throws ApiException if fails to make API call
*/
public DebugCacheBlockOutputV1 getCache(String cacheId, String start, String exclusiveEnd, Boolean metadataOnly) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (start == null) {
throw new ApiException(400, "Missing the required query parameter 'start' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));
if (exclusiveEnd == null) {
throw new ApiException(400, "Missing the required query parameter 'exclusiveEnd' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "exclusiveEnd", exclusiveEnd));
if (metadataOnly == null) {
throw new ApiException(400, "Missing the required query parameter 'metadataOnly' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "metadataOnly", metadataOnly));
ApiClient.ApiResponse localVarResponse = getCacheInternal(cacheId, localVarQueryParams, localVarHeaderParams);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get raw cache data associated with the supplied cacheId.
* @param cacheId (required)
* @param start An 8601 timestamp corresponding to the key at the beginning of the query interval. (required)
* @param exclusiveEnd An 8601 timestamp corresponding to the key at the end of the query interval. (required)
* @param metadataOnly If set to true, the endpoint will only return cache record metadata (no decompression). (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getCacheWithHttpInfo(String cacheId, String start, String exclusiveEnd, Boolean metadataOnly) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (start == null) {
throw new ApiException(400, "Missing the required query parameter 'start' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));
if (exclusiveEnd == null) {
throw new ApiException(400, "Missing the required query parameter 'exclusiveEnd' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "exclusiveEnd", exclusiveEnd));
if (metadataOnly == null) {
throw new ApiException(400, "Missing the required query parameter 'metadataOnly' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "metadataOnly", metadataOnly));
return getCacheInternal(cacheId, localVarQueryParams, localVarHeaderParams);
}
/**
* Get raw cache data associated with the supplied cacheId.
*
* @param cacheId (required)
* @param start An 8601 timestamp corresponding to the key at the beginning of the query interval. (required)
* @param exclusiveEnd An 8601 timestamp corresponding to the key at the end of the query interval. (required)
* @param metadataOnly If set to true, the endpoint will only return cache record metadata (no decompression). (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getCacheWithHeadersAndHttpInfo(String cacheId, String start, String exclusiveEnd, Boolean metadataOnly, Map customHeaders) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (start == null) {
throw new ApiException(400, "Missing the required query parameter 'start' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));
if (exclusiveEnd == null) {
throw new ApiException(400, "Missing the required query parameter 'exclusiveEnd' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "exclusiveEnd", exclusiveEnd));
if (metadataOnly == null) {
throw new ApiException(400, "Missing the required query parameter 'metadataOnly' when calling getCache");
}
localVarQueryParams.addAll(apiClient.parameterToPairs("", "metadataOnly", metadataOnly));
localVarHeaderParams.putAll(customHeaders);
return getCacheInternal(cacheId, localVarQueryParams, localVarHeaderParams);
}
// OVERLOADS END
}