public class CloudBlobMetadata
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CloudBlobMetadata.EncryptionOrigin
Possible values of encryption origin for cloud stored blobs.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FIELD_ACCOUNT_ID |
static java.lang.String |
FIELD_CLOUD_BLOB_NAME |
static java.lang.String |
FIELD_CONTAINER_ID |
static java.lang.String |
FIELD_CREATION_TIME |
static java.lang.String |
FIELD_CRYPTO_AGENT_FACTORY |
static java.lang.String |
FIELD_DELETION_TIME |
static java.lang.String |
FIELD_ENCRYPTION_ORIGIN |
static java.lang.String |
FIELD_EXPIRATION_TIME |
static java.lang.String |
FIELD_UPLOAD_TIME |
static java.lang.String |
FIELD_VCR_KMS_CONTEXT |
Constructor and Description |
---|
CloudBlobMetadata()
Default constructor (for JSONSerializer).
|
CloudBlobMetadata(com.github.ambry.commons.BlobId blobId,
long creationTime,
long expirationTime,
long size,
CloudBlobMetadata.EncryptionOrigin encryptionOrigin)
Constructor from
BlobId . |
CloudBlobMetadata(com.github.ambry.commons.BlobId blobId,
long creationTime,
long expirationTime,
long size,
CloudBlobMetadata.EncryptionOrigin encryptionOrigin,
java.lang.String vcrKmsContext,
java.lang.String cryptoAgentFactory,
long encryptedSize)
Constructor from
BlobId . |
Modifier and Type | Method and Description |
---|---|
static java.util.List<CloudBlobMetadata> |
capMetadataListBySize(java.util.List<CloudBlobMetadata> originalList,
long size)
Utility to cap specified
CloudBlobMetadata list by specified size of its blobs. |
boolean |
equals(java.lang.Object o) |
int |
getAccountId() |
java.lang.String |
getCloudBlobName() |
int |
getContainerId() |
long |
getCreationTime() |
java.lang.String |
getCryptoAgentFactory() |
long |
getDeletionTime() |
long |
getEncryptedSize() |
CloudBlobMetadata.EncryptionOrigin |
getEncryptionOrigin() |
long |
getExpirationTime() |
java.lang.String |
getId() |
long |
getLastUpdateTime() |
java.lang.String |
getPartitionId() |
long |
getSize() |
long |
getUploadTime() |
java.lang.String |
getVcrKmsContext() |
CloudBlobMetadata |
setAccountId(int accountId)
Set the account Id.
|
CloudBlobMetadata |
setCloudBlobName(java.lang.String cloudBlobName)
Sets blob's name in cloud.
|
CloudBlobMetadata |
setContainerId(int containerId)
Set the container Id.
|
CloudBlobMetadata |
setCreationTime(long creationTime)
Set the creation time.
|
CloudBlobMetadata |
setCryptoAgentFactory(java.lang.String cryptoAgentFactory)
Sets the VCR crypto agent factory class name.
|
CloudBlobMetadata |
setDeletionTime(long deletionTime)
Set the blob deletion time.
|
CloudBlobMetadata |
setEncryptedSize(long encryptedSize)
Sets the encrypted size of the blob
|
CloudBlobMetadata |
setEncryptionOrigin(CloudBlobMetadata.EncryptionOrigin encryptionOrigin)
Sets the encryption origin.
|
CloudBlobMetadata |
setExpirationTime(long expirationTime)
Set the blob expiration time.
|
CloudBlobMetadata |
setId(java.lang.String id) |
void |
setLastUpdateTime(long lastUpdateTime)
Sets the last update time of the blob.
|
CloudBlobMetadata |
setPartitionId(java.lang.String partitionId)
Set the partition Id.
|
CloudBlobMetadata |
setSize(long size)
Set the size.
|
CloudBlobMetadata |
setUploadTime(long uploadTime)
Set the upload time.
|
CloudBlobMetadata |
setVcrKmsContext(java.lang.String vcrKmsContext)
Sets the VCR KMS context.
|
public static final java.lang.String FIELD_CREATION_TIME
public static final java.lang.String FIELD_UPLOAD_TIME
public static final java.lang.String FIELD_DELETION_TIME
public static final java.lang.String FIELD_EXPIRATION_TIME
public static final java.lang.String FIELD_ACCOUNT_ID
public static final java.lang.String FIELD_CONTAINER_ID
public static final java.lang.String FIELD_ENCRYPTION_ORIGIN
public static final java.lang.String FIELD_VCR_KMS_CONTEXT
public static final java.lang.String FIELD_CRYPTO_AGENT_FACTORY
public static final java.lang.String FIELD_CLOUD_BLOB_NAME
public CloudBlobMetadata()
public CloudBlobMetadata(com.github.ambry.commons.BlobId blobId, long creationTime, long expirationTime, long size, CloudBlobMetadata.EncryptionOrigin encryptionOrigin)
BlobId
.blobId
- The BlobId for metadata record.creationTime
- The blob creation time.expirationTime
- The blob expiration time.size
- The blob size.encryptionOrigin
- The blob's encryption origin.public CloudBlobMetadata(com.github.ambry.commons.BlobId blobId, long creationTime, long expirationTime, long size, CloudBlobMetadata.EncryptionOrigin encryptionOrigin, java.lang.String vcrKmsContext, java.lang.String cryptoAgentFactory, long encryptedSize)
BlobId
.blobId
- The BlobId for metadata record.creationTime
- The blob creation time.expirationTime
- The blob expiration time.size
- The blob size.encryptionOrigin
- The blob's encryption origin.vcrKmsContext
- The KMS context used to encrypt the blob. Only used when encryptionOrigin = VCR.cryptoAgentFactory
- The class name of the CloudBlobCryptoAgentFactory
used to encrypt the blob.
Only used when encryptionOrigin = VCR.encryptedSize
- The size of the uploaded blob if it was encrypted and then uploaded.
Only used when encryptionOrigin = VCR.public java.lang.String getId()
public CloudBlobMetadata setId(java.lang.String id)
public java.lang.String getPartitionId()
public CloudBlobMetadata setPartitionId(java.lang.String partitionId)
partitionId
- the partition Id of the blob.public long getCreationTime()
public CloudBlobMetadata setCreationTime(long creationTime)
creationTime
- the creation time of the blob.public long getUploadTime()
public CloudBlobMetadata setUploadTime(long uploadTime)
uploadTime
- the upload time of the blob.public long getExpirationTime()
public CloudBlobMetadata setExpirationTime(long expirationTime)
expirationTime
- the expiration time of the blob.public long getDeletionTime()
public CloudBlobMetadata setDeletionTime(long deletionTime)
deletionTime
- the deletion time of the blob.public long getSize()
public CloudBlobMetadata setSize(long size)
size
- the size of the blob in bytes.public int getAccountId()
public CloudBlobMetadata setAccountId(int accountId)
accountId
- the account Id of the blob.public int getContainerId()
public CloudBlobMetadata setContainerId(int containerId)
containerId
- the container Id of the blob.public CloudBlobMetadata.EncryptionOrigin getEncryptionOrigin()
CloudBlobMetadata.EncryptionOrigin
.public CloudBlobMetadata setEncryptionOrigin(CloudBlobMetadata.EncryptionOrigin encryptionOrigin)
encryptionOrigin
- the CloudBlobMetadata.EncryptionOrigin
.public java.lang.String getVcrKmsContext()
public CloudBlobMetadata setVcrKmsContext(java.lang.String vcrKmsContext)
vcrKmsContext
- the KMS context used for encryption.public java.lang.String getCloudBlobName()
public CloudBlobMetadata setCloudBlobName(java.lang.String cloudBlobName)
cloudBlobName
- the blob's name in cloud.public java.lang.String getCryptoAgentFactory()
public CloudBlobMetadata setCryptoAgentFactory(java.lang.String cryptoAgentFactory)
cryptoAgentFactory
- the class name of the CloudBlobCryptoAgentFactory
used for encryption.public long getEncryptedSize()
public CloudBlobMetadata setEncryptedSize(long encryptedSize)
encryptedSize
- public long getLastUpdateTime()
public void setLastUpdateTime(long lastUpdateTime)
lastUpdateTime
- last update time.public static java.util.List<CloudBlobMetadata> capMetadataListBySize(java.util.List<CloudBlobMetadata> originalList, long size)
CloudBlobMetadata
list by specified size of its blobs.
Always returns at least one metadata object irrespective of size.originalList
- List of CloudBlobMetadata
.size
- total size of metadata's blobs.List
of CloudBlobMetadata
capped by size.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object