Class Database (2.45.0)

public final class Database extends GeneratedMessageV3 implements DatabaseOrBuilder

Represents database access information, such as queries. A database may be a sub-resource of an instance (as in the case of Cloud SQL instances or Cloud Spanner instances), or the database instance itself. Some database resources might not have the full resource name populated because these resource types, such as Cloud SQL databases, are not yet supported by Cloud Asset Inventory. In these cases only the display name is provided.

Protobuf type google.cloud.securitycenter.v2.Database

Implements

DatabaseOrBuilder

Static Fields

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
TypeDescription
int

GRANTEES_FIELD_NUMBER

public static final int GRANTEES_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

QUERY_FIELD_NUMBER

public static final int QUERY_FIELD_NUMBER
Field Value
TypeDescription
int

USER_NAME_FIELD_NUMBER

public static final int USER_NAME_FIELD_NUMBER
Field Value
TypeDescription
int

VERSION_FIELD_NUMBER

public static final int VERSION_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Database getDefaultInstance()
Returns
TypeDescription
Database

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Database.Builder newBuilder()
Returns
TypeDescription
Database.Builder

newBuilder(Database prototype)

public static Database.Builder newBuilder(Database prototype)
Parameter
NameDescription
prototypeDatabase
Returns
TypeDescription
Database.Builder

parseDelimitedFrom(InputStream input)

public static Database parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Database
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Database parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Database
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Database parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Database
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Database parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Database
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Database parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Database
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Database parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Database
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Database parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Database
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Database parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Database
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Database parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Database
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Database parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Database
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Database parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Database
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Database parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Database
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Database> parser()
Returns
TypeDescription
Parser<Database>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Database getDefaultInstanceForType()
Returns
TypeDescription
Database

getDisplayName()

public String getDisplayName()

The human-readable name of the database that the user connected to.

string display_name = 2;

Returns
TypeDescription
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

The human-readable name of the database that the user connected to.

string display_name = 2;

Returns
TypeDescription
ByteString

The bytes for displayName.

getGrantees(int index)

public String getGrantees(int index)

The target usernames, roles, or groups of an SQL privilege grant, which is not an IAM policy change.

repeated string grantees = 5;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The grantees at the given index.

getGranteesBytes(int index)

public ByteString getGranteesBytes(int index)

The target usernames, roles, or groups of an SQL privilege grant, which is not an IAM policy change.

repeated string grantees = 5;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the grantees at the given index.

getGranteesCount()

public int getGranteesCount()

The target usernames, roles, or groups of an SQL privilege grant, which is not an IAM policy change.

repeated string grantees = 5;

Returns
TypeDescription
int

The count of grantees.

getGranteesList()

public ProtocolStringList getGranteesList()

The target usernames, roles, or groups of an SQL privilege grant, which is not an IAM policy change.

repeated string grantees = 5;

Returns
TypeDescription
ProtocolStringList

A list containing the grantees.

getName()

public String getName()

Some database resources may not have the full resource name populated because these resource types are not yet supported by Cloud Asset Inventory (e.g. Cloud SQL databases). In these cases only the display name will be provided. The full resource name of the database that the user connected to, if it is supported by Cloud Asset Inventory.

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Some database resources may not have the full resource name populated because these resource types are not yet supported by Cloud Asset Inventory (e.g. Cloud SQL databases). In these cases only the display name will be provided. The full resource name of the database that the user connected to, if it is supported by Cloud Asset Inventory.

string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getParserForType()

public Parser<Database> getParserForType()
Returns
TypeDescription
Parser<Database>
Overrides

getQuery()

public String getQuery()

The SQL statement that is associated with the database access.

string query = 4;

Returns
TypeDescription
String

The query.

getQueryBytes()

public ByteString getQueryBytes()

The SQL statement that is associated with the database access.

string query = 4;

Returns
TypeDescription
ByteString

The bytes for query.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUserName()

public String getUserName()

The username used to connect to the database. The username might not be an IAM principal and does not have a set format.

string user_name = 3;

Returns
TypeDescription
String

The userName.

getUserNameBytes()

public ByteString getUserNameBytes()

The username used to connect to the database. The username might not be an IAM principal and does not have a set format.

string user_name = 3;

Returns
TypeDescription
ByteString

The bytes for userName.

getVersion()

public String getVersion()

The version of the database, for example, POSTGRES_14. See the complete list.

string version = 6;

Returns
TypeDescription
String

The version.

getVersionBytes()

public ByteString getVersionBytes()

The version of the database, for example, POSTGRES_14. See the complete list.

string version = 6;

Returns
TypeDescription
ByteString

The bytes for version.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Database.Builder newBuilderForType()
Returns
TypeDescription
Database.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Database.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Database.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Database.Builder toBuilder()
Returns
TypeDescription
Database.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException