Class CacheKeyPolicy (1.65.0)

public final class CacheKeyPolicy extends GeneratedMessageV3 implements CacheKeyPolicyOrBuilder

Message containing what to include in the cache key for a request for Cloud CDN.

Protobuf type google.cloud.compute.v1.CacheKeyPolicy

Static Fields

INCLUDE_HOST_FIELD_NUMBER

public static final int INCLUDE_HOST_FIELD_NUMBER
Field Value
Type Description
int

INCLUDE_HTTP_HEADERS_FIELD_NUMBER

public static final int INCLUDE_HTTP_HEADERS_FIELD_NUMBER
Field Value
Type Description
int

INCLUDE_NAMED_COOKIES_FIELD_NUMBER

public static final int INCLUDE_NAMED_COOKIES_FIELD_NUMBER
Field Value
Type Description
int

INCLUDE_PROTOCOL_FIELD_NUMBER

public static final int INCLUDE_PROTOCOL_FIELD_NUMBER
Field Value
Type Description
int

INCLUDE_QUERY_STRING_FIELD_NUMBER

public static final int INCLUDE_QUERY_STRING_FIELD_NUMBER
Field Value
Type Description
int

QUERY_STRING_BLACKLIST_FIELD_NUMBER

public static final int QUERY_STRING_BLACKLIST_FIELD_NUMBER
Field Value
Type Description
int

QUERY_STRING_WHITELIST_FIELD_NUMBER

public static final int QUERY_STRING_WHITELIST_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CacheKeyPolicy getDefaultInstance()
Returns
Type Description
CacheKeyPolicy

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static CacheKeyPolicy.Builder newBuilder()
Returns
Type Description
CacheKeyPolicy.Builder

newBuilder(CacheKeyPolicy prototype)

public static CacheKeyPolicy.Builder newBuilder(CacheKeyPolicy prototype)
Parameter
Name Description
prototype CacheKeyPolicy
Returns
Type Description
CacheKeyPolicy.Builder

parseDelimitedFrom(InputStream input)

public static CacheKeyPolicy parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CacheKeyPolicy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static CacheKeyPolicy parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CacheKeyPolicy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CacheKeyPolicy parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CacheKeyPolicy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CacheKeyPolicy parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CacheKeyPolicy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static CacheKeyPolicy parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CacheKeyPolicy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static CacheKeyPolicy parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CacheKeyPolicy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CacheKeyPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<CacheKeyPolicy> parser()
Returns
Type Description
Parser<CacheKeyPolicy>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public CacheKeyPolicy getDefaultInstanceForType()
Returns
Type Description
CacheKeyPolicy

getIncludeHost()

public boolean getIncludeHost()

If true, requests to different hosts will be cached separately.

optional bool include_host = 486867679;

Returns
Type Description
boolean

The includeHost.

getIncludeHttpHeaders(int index)

public String getIncludeHttpHeaders(int index)

Allows HTTP request headers (by name) to be used in the cache key.

repeated string include_http_headers = 2489606;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The includeHttpHeaders at the given index.

getIncludeHttpHeadersBytes(int index)

public ByteString getIncludeHttpHeadersBytes(int index)

Allows HTTP request headers (by name) to be used in the cache key.

repeated string include_http_headers = 2489606;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the includeHttpHeaders at the given index.

getIncludeHttpHeadersCount()

public int getIncludeHttpHeadersCount()

Allows HTTP request headers (by name) to be used in the cache key.

repeated string include_http_headers = 2489606;

Returns
Type Description
int

The count of includeHttpHeaders.

getIncludeHttpHeadersList()

public ProtocolStringList getIncludeHttpHeadersList()

Allows HTTP request headers (by name) to be used in the cache key.

repeated string include_http_headers = 2489606;

Returns
Type Description
ProtocolStringList

A list containing the includeHttpHeaders.

getIncludeNamedCookies(int index)

public String getIncludeNamedCookies(int index)

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

repeated string include_named_cookies = 87316530;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The includeNamedCookies at the given index.

getIncludeNamedCookiesBytes(int index)

public ByteString getIncludeNamedCookiesBytes(int index)

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

repeated string include_named_cookies = 87316530;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the includeNamedCookies at the given index.

getIncludeNamedCookiesCount()

public int getIncludeNamedCookiesCount()

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

repeated string include_named_cookies = 87316530;

Returns
Type Description
int

The count of includeNamedCookies.

getIncludeNamedCookiesList()

public ProtocolStringList getIncludeNamedCookiesList()

Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.

repeated string include_named_cookies = 87316530;

Returns
Type Description
ProtocolStringList

A list containing the includeNamedCookies.

getIncludeProtocol()

public boolean getIncludeProtocol()

If true, http and https requests will be cached separately.

optional bool include_protocol = 303507535;

Returns
Type Description
boolean

The includeProtocol.

getIncludeQueryString()

public boolean getIncludeQueryString()

If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely.

optional bool include_query_string = 474036639;

Returns
Type Description
boolean

The includeQueryString.

getParserForType()

public Parser<CacheKeyPolicy> getParserForType()
Returns
Type Description
Parser<CacheKeyPolicy>
Overrides

getQueryStringBlacklist(int index)

public String getQueryStringBlacklist(int index)

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string query_string_blacklist = 354964742;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The queryStringBlacklist at the given index.

getQueryStringBlacklistBytes(int index)

public ByteString getQueryStringBlacklistBytes(int index)

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string query_string_blacklist = 354964742;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the queryStringBlacklist at the given index.

getQueryStringBlacklistCount()

public int getQueryStringBlacklistCount()

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string query_string_blacklist = 354964742;

Returns
Type Description
int

The count of queryStringBlacklist.

getQueryStringBlacklistList()

public ProtocolStringList getQueryStringBlacklistList()

Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string query_string_blacklist = 354964742;

Returns
Type Description
ProtocolStringList

A list containing the queryStringBlacklist.

getQueryStringWhitelist(int index)

public String getQueryStringWhitelist(int index)

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string query_string_whitelist = 52456496;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The queryStringWhitelist at the given index.

getQueryStringWhitelistBytes(int index)

public ByteString getQueryStringWhitelistBytes(int index)

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string query_string_whitelist = 52456496;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the queryStringWhitelist at the given index.

getQueryStringWhitelistCount()

public int getQueryStringWhitelistCount()

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string query_string_whitelist = 52456496;

Returns
Type Description
int

The count of queryStringWhitelist.

getQueryStringWhitelistList()

public ProtocolStringList getQueryStringWhitelistList()

Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters.

repeated string query_string_whitelist = 52456496;

Returns
Type Description
ProtocolStringList

A list containing the queryStringWhitelist.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasIncludeHost()

public boolean hasIncludeHost()

If true, requests to different hosts will be cached separately.

optional bool include_host = 486867679;

Returns
Type Description
boolean

Whether the includeHost field is set.

hasIncludeProtocol()

public boolean hasIncludeProtocol()

If true, http and https requests will be cached separately.

optional bool include_protocol = 303507535;

Returns
Type Description
boolean

Whether the includeProtocol field is set.

hasIncludeQueryString()

public boolean hasIncludeQueryString()

If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely.

optional bool include_query_string = 474036639;

Returns
Type Description
boolean

Whether the includeQueryString field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public CacheKeyPolicy.Builder newBuilderForType()
Returns
Type Description
CacheKeyPolicy.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CacheKeyPolicy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CacheKeyPolicy.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public CacheKeyPolicy.Builder toBuilder()
Returns
Type Description
CacheKeyPolicy.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException