Package com.github.ambry.messageformat
Class BlobProperties
- java.lang.Object
-
- com.github.ambry.messageformat.BlobProperties
-
public class BlobProperties extends java.lang.Object
The properties of a blob that the client can set at time of put. The blob size and serviceId are mandatory fields and must be set. The creation time is determined when this object is constructed.
-
-
Constructor Summary
Constructors Constructor Description BlobProperties(long blobSize, java.lang.String serviceId, short accountId, short containerId, boolean isEncrypted)
BlobProperties(long blobSize, java.lang.String serviceId, short accountId, short containerId, boolean isEncrypted, long creationTimeInMs)
BlobProperties(long blobSize, java.lang.String serviceId, java.lang.String ownerId, java.lang.String contentType, boolean isPrivate, long timeToLiveInSeconds, long creationTimeInMs, short accountId, short containerId, boolean isEncrypted, java.lang.String externalAssetTag, java.lang.String contentEncoding, java.lang.String filename)
BlobProperties(long blobSize, java.lang.String serviceId, java.lang.String ownerId, java.lang.String contentType, boolean isPrivate, long timeToLiveInSeconds, short accountId, short containerId, boolean isEncrypted, java.lang.String externalAssetTag, java.lang.String contentEncoding, java.lang.String filename)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description short
getAccountId()
long
getBlobSize()
short
getContainerId()
java.lang.String
getContentEncoding()
java.lang.String
getContentType()
long
getCreationTimeInMs()
java.lang.String
getExternalAssetTag()
java.lang.String
getFilename()
java.lang.String
getOwnerId()
java.lang.String
getServiceId()
ServiceId of the uploader of the bloblong
getTimeToLiveInSeconds()
boolean
isEncrypted()
boolean
isPrivate()
Deprecated.void
setBlobSize(long blobSize)
void
setTimeToLiveInSeconds(long timeToLiveInSeconds)
java.lang.String
toString()
-
-
-
Constructor Detail
-
BlobProperties
public BlobProperties(long blobSize, java.lang.String serviceId, short accountId, short containerId, boolean isEncrypted)
- Parameters:
blobSize
- The size of the blob in bytesserviceId
- The service id that is creating this blobaccountId
- accountId of the user who owns the blobcontainerId
- containerId of the blobisEncrypted
-true
if the blob is encrypted,false
otherwise
-
BlobProperties
public BlobProperties(long blobSize, java.lang.String serviceId, short accountId, short containerId, boolean isEncrypted, long creationTimeInMs)
- Parameters:
blobSize
- The size of the blob in bytesserviceId
- The service id that is creating this blobaccountId
- accountId of the user who owns the blobcontainerId
- containerId of the blobisEncrypted
-true
if the blob is encrypted,false
otherwisecreationTimeInMs
- The time at which the blob is created.
-
BlobProperties
public BlobProperties(long blobSize, java.lang.String serviceId, java.lang.String ownerId, java.lang.String contentType, boolean isPrivate, long timeToLiveInSeconds, short accountId, short containerId, boolean isEncrypted, java.lang.String externalAssetTag, java.lang.String contentEncoding, java.lang.String filename)
- Parameters:
blobSize
- The size of the blob in bytesserviceId
- The service id that is creating this blobownerId
- The owner of the blob (For example , memberId or groupId)contentType
- The content type of the blob (eg: mime). Can be NullisPrivate
- Is the blob securetimeToLiveInSeconds
- The time to live, in seconds, relative to blob creation time.accountId
- accountId of the user who owns the blobcontainerId
- containerId of the blobisEncrypted
- whether this blob is encrypted.externalAssetTag
- externalAssetTag for this blob. This is a non-persistent field.contentEncoding
- the field to identify if the blob is compressed.filename
- the name of the file.
-
BlobProperties
public BlobProperties(long blobSize, java.lang.String serviceId, java.lang.String ownerId, java.lang.String contentType, boolean isPrivate, long timeToLiveInSeconds, long creationTimeInMs, short accountId, short containerId, boolean isEncrypted, java.lang.String externalAssetTag, java.lang.String contentEncoding, java.lang.String filename)
- Parameters:
blobSize
- The size of the blob in bytesserviceId
- The service id that is creating this blobownerId
- The owner of the blob (For example , memberId or groupId)contentType
- The content type of the blob (eg: mime). Can be NullisPrivate
- Is the blob securetimeToLiveInSeconds
- The time to live, in seconds, relative to blob creation time.creationTimeInMs
- The time at which the blob is created.accountId
- accountId of the user who owns the blobcontainerId
- containerId of the blobisEncrypted
- whether this blob is encrypted.externalAssetTag
- externalAssetTag for this blob. This is a non-persistent field.contentEncoding
- the field to identify if the blob is compressed.filename
- the name of the file.
-
-
Method Detail
-
getTimeToLiveInSeconds
public long getTimeToLiveInSeconds()
-
getBlobSize
public long getBlobSize()
-
isPrivate
@Deprecated public boolean isPrivate()
Deprecated.This should only be used to determine the "virtual container" for blobs with V1 IDs.- Returns:
- whether the blob was private at creation time.
-
getOwnerId
public java.lang.String getOwnerId()
-
getContentType
public java.lang.String getContentType()
-
getContentEncoding
public java.lang.String getContentEncoding()
-
getFilename
public java.lang.String getFilename()
-
getServiceId
public java.lang.String getServiceId()
ServiceId of the uploader of the blob- Returns:
- the serviceId of the uploader of the blob
-
getCreationTimeInMs
public long getCreationTimeInMs()
-
getAccountId
public short getAccountId()
-
getContainerId
public short getContainerId()
-
isEncrypted
public boolean isEncrypted()
-
getExternalAssetTag
public java.lang.String getExternalAssetTag()
- Returns:
- the ExternalAssetTag of a uploaded blob. Can be null.
-
setTimeToLiveInSeconds
public void setTimeToLiveInSeconds(long timeToLiveInSeconds)
- Parameters:
timeToLiveInSeconds
- the new value of timeToLiveInSeconds
-
setBlobSize
public void setBlobSize(long blobSize)
- Parameters:
blobSize
- the new blob size in bytes
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-