Class SocketOption.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<SocketOption.Builder>
com.google.protobuf.GeneratedMessage.Builder<SocketOption.Builder>
io.envoyproxy.envoy.config.core.v3.SocketOption.Builder
- All Implemented Interfaces:
com.google.protobuf.Message.Builder
,com.google.protobuf.MessageLite.Builder
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,SocketOptionOrBuilder
,Cloneable
- Enclosing class:
SocketOption
public static final class SocketOption.Builder
extends com.google.protobuf.GeneratedMessage.Builder<SocketOption.Builder>
implements SocketOptionOrBuilder
Generic socket option message. This would be used to set socket options that might not exist in upstream kernels or precompiled Envoy binaries. For example: .. code-block:: json { "description": "support tcp keep alive", "state": 0, "level": 1, "name": 9, "int_value": 1, } 1 means SOL_SOCKET and 9 means SO_KEEPALIVE on Linux. With the above configuration, `TCP Keep-Alives <https://www.freesoft.org/CIE/RFC/1122/114.htm>`_ can be enabled in socket with Linux, which can be used in :ref:`listener's<envoy_v3_api_field_config.listener.v3.Listener.socket_options>` or :ref:`admin's <envoy_v3_api_field_config.bootstrap.v3.Admin.socket_options>` socket_options etc. It should be noted that the name or level may have different values on different platforms. [#next-free-field: 7]Protobuf type
envoy.config.core.v3.SocketOption
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
private void
buildPartial0
(SocketOption result) private void
buildPartialOneofs
(SocketOption result) clear()
Otherwise it's a byte buffer.An optional name to give this socket option for debugging, etc.Because many sockopts take an int value.Corresponding to the level value passed to setsockopt, such as IPPROTO_TCPThe numeric name as passed to setsockoptThe state in which the option will be applied.com.google.protobuf.ByteString
Otherwise it's a byte buffer.An optional name to give this socket option for debugging, etc.com.google.protobuf.ByteString
An optional name to give this socket option for debugging, etc.static final com.google.protobuf.Descriptors.Descriptor
com.google.protobuf.Descriptors.Descriptor
long
Because many sockopts take an int value.long
getLevel()
Corresponding to the level value passed to setsockopt, such as IPPROTO_TCPlong
getName()
The numeric name as passed to setsockoptgetState()
The state in which the option will be applied.int
The state in which the option will be applied.boolean
Otherwise it's a byte buffer.boolean
Because many sockopts take an int value.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
final boolean
mergeFrom
(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom
(com.google.protobuf.Message other) mergeFrom
(SocketOption other) setBufValue
(com.google.protobuf.ByteString value) Otherwise it's a byte buffer.setDescription
(String value) An optional name to give this socket option for debugging, etc.setDescriptionBytes
(com.google.protobuf.ByteString value) An optional name to give this socket option for debugging, etc.setIntValue
(long value) Because many sockopts take an int value.setLevel
(long value) Corresponding to the level value passed to setsockopt, such as IPPROTO_TCPsetName
(long value) The numeric name as passed to setsockoptsetState
(SocketOption.SocketState value) The state in which the option will be applied.setStateValue
(int value) The state in which the option will be applied.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFrom
Methods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFrom
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
valueCase_
private int valueCase_ -
value_
-
bitField0_
private int bitField0_ -
description_
-
level_
private long level_ -
name_
private long name_ -
state_
private int state_
-
-
Constructor Details
-
Builder
private Builder() -
Builder
private Builder(com.google.protobuf.AbstractMessage.BuilderParent parent)
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessage.Builder<SocketOption.Builder>
-
clear
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessage.Builder<SocketOption.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessage.Builder<SocketOption.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial0
-
buildPartialOneofs
-
mergeFrom
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<SocketOption.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessage.Builder<SocketOption.Builder>
-
mergeFrom
public SocketOption.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<SocketOption.Builder>
- Throws:
IOException
-
getValueCase
- Specified by:
getValueCase
in interfaceSocketOptionOrBuilder
-
clearValue
-
getDescription
An optional name to give this socket option for debugging, etc. Uniqueness is not required and no special meaning is assumed.
string description = 1;
- Specified by:
getDescription
in interfaceSocketOptionOrBuilder
- Returns:
- The description.
-
getDescriptionBytes
public com.google.protobuf.ByteString getDescriptionBytes()An optional name to give this socket option for debugging, etc. Uniqueness is not required and no special meaning is assumed.
string description = 1;
- Specified by:
getDescriptionBytes
in interfaceSocketOptionOrBuilder
- Returns:
- The bytes for description.
-
setDescription
An optional name to give this socket option for debugging, etc. Uniqueness is not required and no special meaning is assumed.
string description = 1;
- Parameters:
value
- The description to set.- Returns:
- This builder for chaining.
-
clearDescription
An optional name to give this socket option for debugging, etc. Uniqueness is not required and no special meaning is assumed.
string description = 1;
- Returns:
- This builder for chaining.
-
setDescriptionBytes
An optional name to give this socket option for debugging, etc. Uniqueness is not required and no special meaning is assumed.
string description = 1;
- Parameters:
value
- The bytes for description to set.- Returns:
- This builder for chaining.
-
getLevel
public long getLevel()Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP
int64 level = 2;
- Specified by:
getLevel
in interfaceSocketOptionOrBuilder
- Returns:
- The level.
-
setLevel
Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP
int64 level = 2;
- Parameters:
value
- The level to set.- Returns:
- This builder for chaining.
-
clearLevel
Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP
int64 level = 2;
- Returns:
- This builder for chaining.
-
getName
public long getName()The numeric name as passed to setsockopt
int64 name = 3;
- Specified by:
getName
in interfaceSocketOptionOrBuilder
- Returns:
- The name.
-
setName
The numeric name as passed to setsockopt
int64 name = 3;
- Parameters:
value
- The name to set.- Returns:
- This builder for chaining.
-
clearName
The numeric name as passed to setsockopt
int64 name = 3;
- Returns:
- This builder for chaining.
-
hasIntValue
public boolean hasIntValue()Because many sockopts take an int value.
int64 int_value = 4;
- Specified by:
hasIntValue
in interfaceSocketOptionOrBuilder
- Returns:
- Whether the intValue field is set.
-
getIntValue
public long getIntValue()Because many sockopts take an int value.
int64 int_value = 4;
- Specified by:
getIntValue
in interfaceSocketOptionOrBuilder
- Returns:
- The intValue.
-
setIntValue
Because many sockopts take an int value.
int64 int_value = 4;
- Parameters:
value
- The intValue to set.- Returns:
- This builder for chaining.
-
clearIntValue
Because many sockopts take an int value.
int64 int_value = 4;
- Returns:
- This builder for chaining.
-
hasBufValue
public boolean hasBufValue()Otherwise it's a byte buffer.
bytes buf_value = 5;
- Specified by:
hasBufValue
in interfaceSocketOptionOrBuilder
- Returns:
- Whether the bufValue field is set.
-
getBufValue
public com.google.protobuf.ByteString getBufValue()Otherwise it's a byte buffer.
bytes buf_value = 5;
- Specified by:
getBufValue
in interfaceSocketOptionOrBuilder
- Returns:
- The bufValue.
-
setBufValue
Otherwise it's a byte buffer.
bytes buf_value = 5;
- Parameters:
value
- The bufValue to set.- Returns:
- This builder for chaining.
-
clearBufValue
Otherwise it's a byte buffer.
bytes buf_value = 5;
- Returns:
- This builder for chaining.
-
getStateValue
public int getStateValue()The state in which the option will be applied. When used in BindConfig STATE_PREBIND is currently the only valid value.
.envoy.config.core.v3.SocketOption.SocketState state = 6 [(.validate.rules) = { ... }
- Specified by:
getStateValue
in interfaceSocketOptionOrBuilder
- Returns:
- The enum numeric value on the wire for state.
-
setStateValue
The state in which the option will be applied. When used in BindConfig STATE_PREBIND is currently the only valid value.
.envoy.config.core.v3.SocketOption.SocketState state = 6 [(.validate.rules) = { ... }
- Parameters:
value
- The enum numeric value on the wire for state to set.- Returns:
- This builder for chaining.
-
getState
The state in which the option will be applied. When used in BindConfig STATE_PREBIND is currently the only valid value.
.envoy.config.core.v3.SocketOption.SocketState state = 6 [(.validate.rules) = { ... }
- Specified by:
getState
in interfaceSocketOptionOrBuilder
- Returns:
- The state.
-
setState
The state in which the option will be applied. When used in BindConfig STATE_PREBIND is currently the only valid value.
.envoy.config.core.v3.SocketOption.SocketState state = 6 [(.validate.rules) = { ... }
- Parameters:
value
- The state to set.- Returns:
- This builder for chaining.
-
clearState
The state in which the option will be applied. When used in BindConfig STATE_PREBIND is currently the only valid value.
.envoy.config.core.v3.SocketOption.SocketState state = 6 [(.validate.rules) = { ... }
- Returns:
- This builder for chaining.
-