All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
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.
org.openqa.selenium.devtools.v88.cachestorage.CacheStorage Maven / Gradle / Ivy
package org.openqa.selenium.devtools.v88.cachestorage;
import org.openqa.selenium.Beta;
import org.openqa.selenium.devtools.Command;
import org.openqa.selenium.devtools.Event;
import org.openqa.selenium.devtools.ConverterFunctions;
import com.google.common.collect.ImmutableMap;
import org.openqa.selenium.json.JsonInput;
@Beta()
public class CacheStorage {
/**
* Deletes a cache.
*/
public static Command deleteCache(org.openqa.selenium.devtools.v88.cachestorage.model.CacheId cacheId) {
java.util.Objects.requireNonNull(cacheId, "cacheId is required");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("cacheId", cacheId);
return new Command<>("CacheStorage.deleteCache", params.build());
}
/**
* Deletes a cache entry.
*/
public static Command deleteEntry(org.openqa.selenium.devtools.v88.cachestorage.model.CacheId cacheId, java.lang.String request) {
java.util.Objects.requireNonNull(cacheId, "cacheId is required");
java.util.Objects.requireNonNull(request, "request is required");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("cacheId", cacheId);
params.put("request", request);
return new Command<>("CacheStorage.deleteEntry", params.build());
}
/**
* Requests cache names.
*/
public static Command> requestCacheNames(java.lang.String securityOrigin) {
java.util.Objects.requireNonNull(securityOrigin, "securityOrigin is required");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("securityOrigin", securityOrigin);
return new Command<>("CacheStorage.requestCacheNames", params.build(), ConverterFunctions.map("caches", new com.google.common.reflect.TypeToken>() {
}.getType()));
}
/**
* Fetches cache entry.
*/
public static Command requestCachedResponse(org.openqa.selenium.devtools.v88.cachestorage.model.CacheId cacheId, java.lang.String requestURL, java.util.List requestHeaders) {
java.util.Objects.requireNonNull(cacheId, "cacheId is required");
java.util.Objects.requireNonNull(requestURL, "requestURL is required");
java.util.Objects.requireNonNull(requestHeaders, "requestHeaders is required");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("cacheId", cacheId);
params.put("requestURL", requestURL);
params.put("requestHeaders", requestHeaders);
return new Command<>("CacheStorage.requestCachedResponse", params.build(), ConverterFunctions.map("response", org.openqa.selenium.devtools.v88.cachestorage.model.CachedResponse.class));
}
public static class RequestEntriesResponse {
private final java.util.List cacheDataEntries;
private final java.lang.Number returnCount;
public RequestEntriesResponse(java.util.List cacheDataEntries, java.lang.Number returnCount) {
this.cacheDataEntries = java.util.Objects.requireNonNull(cacheDataEntries, "cacheDataEntries is required");
this.returnCount = java.util.Objects.requireNonNull(returnCount, "returnCount is required");
}
/**
* Array of object store data entries.
*/
public java.util.List getCacheDataEntries() {
return cacheDataEntries;
}
/**
* Count of returned entries from this storage. If pathFilter is empty, it
* is the count of all entries from this storage.
*/
public java.lang.Number getReturnCount() {
return returnCount;
}
private static RequestEntriesResponse fromJson(JsonInput input) {
java.util.List cacheDataEntries = null;
java.lang.Number returnCount = 0;
input.beginObject();
while (input.hasNext()) {
switch(input.nextName()) {
case "cacheDataEntries":
cacheDataEntries = input.read(new com.google.common.reflect.TypeToken>() {
}.getType());
break;
case "returnCount":
returnCount = input.nextNumber();
break;
default:
input.skipValue();
break;
}
}
input.endObject();
return new RequestEntriesResponse(cacheDataEntries, returnCount);
}
}
/**
* Requests data from cache.
*/
public static Command requestEntries(org.openqa.selenium.devtools.v88.cachestorage.model.CacheId cacheId, java.util.Optional skipCount, java.util.Optional pageSize, java.util.Optional pathFilter) {
java.util.Objects.requireNonNull(cacheId, "cacheId is required");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("cacheId", cacheId);
skipCount.ifPresent(p -> params.put("skipCount", p));
pageSize.ifPresent(p -> params.put("pageSize", p));
pathFilter.ifPresent(p -> params.put("pathFilter", p));
return new Command<>("CacheStorage.requestEntries", params.build(), input -> input.read(org.openqa.selenium.devtools.v88.cachestorage.CacheStorage.RequestEntriesResponse.class));
}
}