Package io.envoyproxy.envoy.api.v2.route
Class RouteAction.HashPolicy.Cookie.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
io.envoyproxy.envoy.api.v2.route.RouteAction.HashPolicy.Cookie.Builder
- All Implemented Interfaces:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,RouteAction.HashPolicy.CookieOrBuilder,Cloneable
- Enclosing class:
- RouteAction.HashPolicy.Cookie
public static final class RouteAction.HashPolicy.Cookie.Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
implements RouteAction.HashPolicy.CookieOrBuilder
Envoy supports two types of cookie affinity:
1. Passive. Envoy takes a cookie that's present in the cookies header and
hashes on its value.
2. Generated. Envoy generates and sets a cookie with an expiration (TTL)
on the first request from the client in its response to the client,
based on the endpoint the request gets sent to. The client then
presents this on the next and all subsequent requests. The hash of
this is sufficient to ensure these requests get sent to the same
endpoint. The cookie is generated by hashing the source and
destination ports and addresses so that multiple independent HTTP2
streams on the same connection will independently receive the same
cookie, even if they arrive at the Envoy simultaneously.
Protobuf type envoy.api.v2.route.RouteAction.HashPolicy.Cookie-
Method Summary
Modifier and TypeMethodDescriptionaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()clearField(com.google.protobuf.Descriptors.FieldDescriptor field) The name of the cookie that will be used to obtain the hash key.clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) The name of the path for the cookie.clearTtl()If specified, a cookie with the TTL will be generated if the cookie is not present.clone()static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorgetName()The name of the cookie that will be used to obtain the hash key.com.google.protobuf.ByteStringThe name of the cookie that will be used to obtain the hash key.getPath()The name of the path for the cookie.com.google.protobuf.ByteStringThe name of the path for the cookie.com.google.protobuf.DurationgetTtl()If specified, a cookie with the TTL will be generated if the cookie is not present.com.google.protobuf.Duration.BuilderIf specified, a cookie with the TTL will be generated if the cookie is not present.com.google.protobuf.DurationOrBuilderIf specified, a cookie with the TTL will be generated if the cookie is not present.booleanhasTtl()If specified, a cookie with the TTL will be generated if the cookie is not present.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeTtl(com.google.protobuf.Duration value) If specified, a cookie with the TTL will be generated if the cookie is not present.mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) The name of the cookie that will be used to obtain the hash key.setNameBytes(com.google.protobuf.ByteString value) The name of the cookie that will be used to obtain the hash key.The name of the path for the cookie.setPathBytes(com.google.protobuf.ByteString value) The name of the path for the cookie.setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) setTtl(com.google.protobuf.Duration value) If specified, a cookie with the TTL will be generated if the cookie is not present.setTtl(com.google.protobuf.Duration.Builder builderForValue) If specified, a cookie with the TTL will be generated if the cookie is not present.setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
setField
public RouteAction.HashPolicy.Cookie.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
clearField
public RouteAction.HashPolicy.Cookie.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) - Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
clearOneof
public RouteAction.HashPolicy.Cookie.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) - Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
setRepeatedField
public RouteAction.HashPolicy.Cookie.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
addRepeatedField
public RouteAction.HashPolicy.Cookie.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
mergeFrom
public RouteAction.HashPolicy.Cookie.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<RouteAction.HashPolicy.Cookie.Builder>- Throws:
IOException
-
getName
The name of the cookie that will be used to obtain the hash key. If the cookie is not present and ttl below is not set, no hash will be produced.
string name = 1 [(.validate.rules) = { ... }- Specified by:
getNamein interfaceRouteAction.HashPolicy.CookieOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()The name of the cookie that will be used to obtain the hash key. If the cookie is not present and ttl below is not set, no hash will be produced.
string name = 1 [(.validate.rules) = { ... }- Specified by:
getNameBytesin interfaceRouteAction.HashPolicy.CookieOrBuilder- Returns:
- The bytes for name.
-
setName
The name of the cookie that will be used to obtain the hash key. If the cookie is not present and ttl below is not set, no hash will be produced.
string name = 1 [(.validate.rules) = { ... }- Parameters:
value- The name to set.- Returns:
- This builder for chaining.
-
clearName
The name of the cookie that will be used to obtain the hash key. If the cookie is not present and ttl below is not set, no hash will be produced.
string name = 1 [(.validate.rules) = { ... }- Returns:
- This builder for chaining.
-
setNameBytes
The name of the cookie that will be used to obtain the hash key. If the cookie is not present and ttl below is not set, no hash will be produced.
string name = 1 [(.validate.rules) = { ... }- Parameters:
value- The bytes for name to set.- Returns:
- This builder for chaining.
-
hasTtl
public boolean hasTtl()If specified, a cookie with the TTL will be generated if the cookie is not present. If the TTL is present and zero, the generated cookie will be a session cookie.
.google.protobuf.Duration ttl = 2;- Specified by:
hasTtlin interfaceRouteAction.HashPolicy.CookieOrBuilder- Returns:
- Whether the ttl field is set.
-
getTtl
public com.google.protobuf.Duration getTtl()If specified, a cookie with the TTL will be generated if the cookie is not present. If the TTL is present and zero, the generated cookie will be a session cookie.
.google.protobuf.Duration ttl = 2;- Specified by:
getTtlin interfaceRouteAction.HashPolicy.CookieOrBuilder- Returns:
- The ttl.
-
setTtl
If specified, a cookie with the TTL will be generated if the cookie is not present. If the TTL is present and zero, the generated cookie will be a session cookie.
.google.protobuf.Duration ttl = 2; -
setTtl
public RouteAction.HashPolicy.Cookie.Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) If specified, a cookie with the TTL will be generated if the cookie is not present. If the TTL is present and zero, the generated cookie will be a session cookie.
.google.protobuf.Duration ttl = 2; -
mergeTtl
If specified, a cookie with the TTL will be generated if the cookie is not present. If the TTL is present and zero, the generated cookie will be a session cookie.
.google.protobuf.Duration ttl = 2; -
clearTtl
If specified, a cookie with the TTL will be generated if the cookie is not present. If the TTL is present and zero, the generated cookie will be a session cookie.
.google.protobuf.Duration ttl = 2; -
getTtlBuilder
public com.google.protobuf.Duration.Builder getTtlBuilder()If specified, a cookie with the TTL will be generated if the cookie is not present. If the TTL is present and zero, the generated cookie will be a session cookie.
.google.protobuf.Duration ttl = 2; -
getTtlOrBuilder
public com.google.protobuf.DurationOrBuilder getTtlOrBuilder()If specified, a cookie with the TTL will be generated if the cookie is not present. If the TTL is present and zero, the generated cookie will be a session cookie.
.google.protobuf.Duration ttl = 2;- Specified by:
getTtlOrBuilderin interfaceRouteAction.HashPolicy.CookieOrBuilder
-
getPath
The name of the path for the cookie. If no path is specified here, no path will be set for the cookie.
string path = 3;- Specified by:
getPathin interfaceRouteAction.HashPolicy.CookieOrBuilder- Returns:
- The path.
-
getPathBytes
public com.google.protobuf.ByteString getPathBytes()The name of the path for the cookie. If no path is specified here, no path will be set for the cookie.
string path = 3;- Specified by:
getPathBytesin interfaceRouteAction.HashPolicy.CookieOrBuilder- Returns:
- The bytes for path.
-
setPath
The name of the path for the cookie. If no path is specified here, no path will be set for the cookie.
string path = 3;- Parameters:
value- The path to set.- Returns:
- This builder for chaining.
-
clearPath
The name of the path for the cookie. If no path is specified here, no path will be set for the cookie.
string path = 3;- Returns:
- This builder for chaining.
-
setPathBytes
The name of the path for the cookie. If no path is specified here, no path will be set for the cookie.
string path = 3;- Parameters:
value- The bytes for path to set.- Returns:
- This builder for chaining.
-
setUnknownFields
public final RouteAction.HashPolicy.Cookie.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-
mergeUnknownFields
public final RouteAction.HashPolicy.Cookie.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<RouteAction.HashPolicy.Cookie.Builder>
-