Class AttributeContext (2.48.0)

public final class AttributeContext extends GeneratedMessageV3 implements AttributeContextOrBuilder

This message defines the standard attribute vocabulary for Google APIs.

An attribute is a piece of metadata that describes an activity on a network service. For example, the size of an HTTP request, or the status code of an HTTP response.

Each attribute has a type and a name, which is logically defined as a proto message field in AttributeContext. The field type becomes the attribute type, and the field path becomes the attribute name. For example, the attribute source.ip maps to field AttributeContext.source.ip.

This message definition is guaranteed not to have any wire breaking change. So you can use it directly for passing attributes across different systems.

NOTE: Different system may generate different subset of attributes. Please verify the system specification before relying on an attribute generated a system.

Protobuf type google.rpc.context.AttributeContext

Static Fields

API_FIELD_NUMBER

public static final int API_FIELD_NUMBER
Field Value
Type Description
int

DESTINATION_FIELD_NUMBER

public static final int DESTINATION_FIELD_NUMBER
Field Value
Type Description
int

EXTENSIONS_FIELD_NUMBER

public static final int EXTENSIONS_FIELD_NUMBER
Field Value
Type Description
int

ORIGIN_FIELD_NUMBER

public static final int ORIGIN_FIELD_NUMBER
Field Value
Type Description
int

REQUEST_FIELD_NUMBER

public static final int REQUEST_FIELD_NUMBER
Field Value
Type Description
int

RESOURCE_FIELD_NUMBER

public static final int RESOURCE_FIELD_NUMBER
Field Value
Type Description
int

RESPONSE_FIELD_NUMBER

public static final int RESPONSE_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_FIELD_NUMBER

public static final int SOURCE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static AttributeContext getDefaultInstance()
Returns
Type Description
AttributeContext

getDescriptor()

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

newBuilder()

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

newBuilder(AttributeContext prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getApi()

public AttributeContext.Api getApi()

Represents an API operation that is involved to a network activity.

.google.rpc.context.AttributeContext.Api api = 6;

Returns
Type Description
AttributeContext.Api

The api.

getApiOrBuilder()

public AttributeContext.ApiOrBuilder getApiOrBuilder()

Represents an API operation that is involved to a network activity.

.google.rpc.context.AttributeContext.Api api = 6;

Returns
Type Description
AttributeContext.ApiOrBuilder

getDefaultInstanceForType()

public AttributeContext getDefaultInstanceForType()
Returns
Type Description
AttributeContext

getDestination()

public AttributeContext.Peer getDestination()

The destination of a network activity, such as accepting a TCP connection. In a multi hop network activity, the destination represents the receiver of the last hop.

.google.rpc.context.AttributeContext.Peer destination = 2;

Returns
Type Description
AttributeContext.Peer

The destination.

getDestinationOrBuilder()

public AttributeContext.PeerOrBuilder getDestinationOrBuilder()

The destination of a network activity, such as accepting a TCP connection. In a multi hop network activity, the destination represents the receiver of the last hop.

.google.rpc.context.AttributeContext.Peer destination = 2;

Returns
Type Description
AttributeContext.PeerOrBuilder

getExtensions(int index)

public Any getExtensions(int index)

Supports extensions for advanced use cases, such as logs and metrics.

repeated .google.protobuf.Any extensions = 8;

Parameter
Name Description
index int
Returns
Type Description
Any

getExtensionsCount()

public int getExtensionsCount()

Supports extensions for advanced use cases, such as logs and metrics.

repeated .google.protobuf.Any extensions = 8;

Returns
Type Description
int

getExtensionsList()

public List<Any> getExtensionsList()

Supports extensions for advanced use cases, such as logs and metrics.

repeated .google.protobuf.Any extensions = 8;

Returns
Type Description
List<Any>

getExtensionsOrBuilder(int index)

public AnyOrBuilder getExtensionsOrBuilder(int index)

Supports extensions for advanced use cases, such as logs and metrics.

repeated .google.protobuf.Any extensions = 8;

Parameter
Name Description
index int
Returns
Type Description
AnyOrBuilder

getExtensionsOrBuilderList()

public List<? extends AnyOrBuilder> getExtensionsOrBuilderList()

Supports extensions for advanced use cases, such as logs and metrics.

repeated .google.protobuf.Any extensions = 8;

Returns
Type Description
List<? extends com.google.protobuf.AnyOrBuilder>

getOrigin()

public AttributeContext.Peer getOrigin()

The origin of a network activity. In a multi hop network activity, the origin represents the sender of the first hop. For the first hop, the source and the origin must have the same content.

.google.rpc.context.AttributeContext.Peer origin = 7;

Returns
Type Description
AttributeContext.Peer

The origin.

getOriginOrBuilder()

public AttributeContext.PeerOrBuilder getOriginOrBuilder()

The origin of a network activity. In a multi hop network activity, the origin represents the sender of the first hop. For the first hop, the source and the origin must have the same content.

.google.rpc.context.AttributeContext.Peer origin = 7;

Returns
Type Description
AttributeContext.PeerOrBuilder

getParserForType()

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

getRequest()

public AttributeContext.Request getRequest()

Represents a network request, such as an HTTP request.

.google.rpc.context.AttributeContext.Request request = 3;

Returns
Type Description
AttributeContext.Request

The request.

getRequestOrBuilder()

public AttributeContext.RequestOrBuilder getRequestOrBuilder()

Represents a network request, such as an HTTP request.

.google.rpc.context.AttributeContext.Request request = 3;

Returns
Type Description
AttributeContext.RequestOrBuilder

getResource()

public AttributeContext.Resource getResource()

Represents a target resource that is involved with a network activity. If multiple resources are involved with an activity, this must be the primary one.

.google.rpc.context.AttributeContext.Resource resource = 5;

Returns
Type Description
AttributeContext.Resource

The resource.

getResourceOrBuilder()

public AttributeContext.ResourceOrBuilder getResourceOrBuilder()

Represents a target resource that is involved with a network activity. If multiple resources are involved with an activity, this must be the primary one.

.google.rpc.context.AttributeContext.Resource resource = 5;

Returns
Type Description
AttributeContext.ResourceOrBuilder

getResponse()

public AttributeContext.Response getResponse()

Represents a network response, such as an HTTP response.

.google.rpc.context.AttributeContext.Response response = 4;

Returns
Type Description
AttributeContext.Response

The response.

getResponseOrBuilder()

public AttributeContext.ResponseOrBuilder getResponseOrBuilder()

Represents a network response, such as an HTTP response.

.google.rpc.context.AttributeContext.Response response = 4;

Returns
Type Description
AttributeContext.ResponseOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getSource()

public AttributeContext.Peer getSource()

The source of a network activity, such as starting a TCP connection. In a multi hop network activity, the source represents the sender of the last hop.

.google.rpc.context.AttributeContext.Peer source = 1;

Returns
Type Description
AttributeContext.Peer

The source.

getSourceOrBuilder()

public AttributeContext.PeerOrBuilder getSourceOrBuilder()

The source of a network activity, such as starting a TCP connection. In a multi hop network activity, the source represents the sender of the last hop.

.google.rpc.context.AttributeContext.Peer source = 1;

Returns
Type Description
AttributeContext.PeerOrBuilder

hasApi()

public boolean hasApi()

Represents an API operation that is involved to a network activity.

.google.rpc.context.AttributeContext.Api api = 6;

Returns
Type Description
boolean

Whether the api field is set.

hasDestination()

public boolean hasDestination()

The destination of a network activity, such as accepting a TCP connection. In a multi hop network activity, the destination represents the receiver of the last hop.

.google.rpc.context.AttributeContext.Peer destination = 2;

Returns
Type Description
boolean

Whether the destination field is set.

hasOrigin()

public boolean hasOrigin()

The origin of a network activity. In a multi hop network activity, the origin represents the sender of the first hop. For the first hop, the source and the origin must have the same content.

.google.rpc.context.AttributeContext.Peer origin = 7;

Returns
Type Description
boolean

Whether the origin field is set.

hasRequest()

public boolean hasRequest()

Represents a network request, such as an HTTP request.

.google.rpc.context.AttributeContext.Request request = 3;

Returns
Type Description
boolean

Whether the request field is set.

hasResource()

public boolean hasResource()

Represents a target resource that is involved with a network activity. If multiple resources are involved with an activity, this must be the primary one.

.google.rpc.context.AttributeContext.Resource resource = 5;

Returns
Type Description
boolean

Whether the resource field is set.

hasResponse()

public boolean hasResponse()

Represents a network response, such as an HTTP response.

.google.rpc.context.AttributeContext.Response response = 4;

Returns
Type Description
boolean

Whether the response field is set.

hasSource()

public boolean hasSource()

The source of a network activity, such as starting a TCP connection. In a multi hop network activity, the source represents the sender of the last hop.

.google.rpc.context.AttributeContext.Peer source = 1;

Returns
Type Description
boolean

Whether the source 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 AttributeContext.Builder newBuilderForType()
Returns
Type Description
AttributeContext.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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