public class Container
extends java.lang.Object
A representation of a container. A container virtually groups a number of blobs under the same Account
,
so that an operation on a container can be applied to all the blobs of the container. When posting a blob, a
container needs to be specified. There can be multiple containers under the the same Account
, but containers
cannot be nested.
Container name is provided by a user as an external reference to that container. Container id is an internal
identifier of the container, and is one-to-one mapped to a container name. Container name/id has to be distinct
within the same Account
, but can be the same across different Account
s.
Container is serialized into JSONObject
in the currentJsonVersion
, which is version 1
for now. Below lists all the metadata versions and their formats:
{
"containerName": "MyPrivateContainer",
"description": "This is my private container",
"isPrivate": "true",
"containerId": 0,
"version": 1,
"status": "active"
"parentAccountId": "101"
}
A container object is immutable. To update a container, refer to ContainerBuilder
and
AccountBuilder
.
Modifier and Type | Class and Description |
---|---|
static class |
Container.ContainerStatus
Status of the container.
|
Modifier and Type | Field and Description |
---|---|
static Container |
DEFAULT_PRIVATE_CONTAINER
Deprecated.
|
static boolean |
DEFAULT_PRIVATE_CONTAINER_CACHEABLE_SETTING
The cache setting of
DEFAULT_PRIVATE_CONTAINER . |
static java.lang.String |
DEFAULT_PRIVATE_CONTAINER_DESCRIPTION
The description for the containers to be associated with the blobs that are put without specifying a target
container, but are specified private.
|
static boolean |
DEFAULT_PRIVATE_CONTAINER_ENCRYPTED_SETTING
The encryption setting of
DEFAULT_PRIVATE_CONTAINER . |
static short |
DEFAULT_PRIVATE_CONTAINER_ID
The id for the containers to be associated with the blobs that are put without specifying a target container,
but are specified private.
|
static boolean |
DEFAULT_PRIVATE_CONTAINER_MEDIA_SCAN_DISABLED_SETTING
The media scan disabled setting for
DEFAULT_PRIVATE_CONTAINER . |
static java.lang.String |
DEFAULT_PRIVATE_CONTAINER_NAME
The name for the containers to be associated with the blobs that are put without specifying a target container,
but are specified private.
|
static short |
DEFAULT_PRIVATE_CONTAINER_PARENT_ACCOUNT_ID
The parent account id of
DEFAULT_PRIVATE_CONTAINER . |
static boolean |
DEFAULT_PRIVATE_CONTAINER_PREVIOUSLY_ENCRYPTED_SETTING
The previously encrypted flag for
DEFAULT_PRIVATE_CONTAINER . |
static Container.ContainerStatus |
DEFAULT_PRIVATE_CONTAINER_STATUS
The status for the containers to be associated with the blobs that are put without specifying a target container,
but are specified private.
|
static boolean |
DEFAULT_PRIVATE_CONTAINER_TTL_REQUIRED_SETTING
The ttl required setting for
DEFAULT_PRIVATE_CONTAINER . |
static Container |
DEFAULT_PUBLIC_CONTAINER
Deprecated.
|
static boolean |
DEFAULT_PUBLIC_CONTAINER_CACHEABLE_SETTING
The cache setting of
DEFAULT_PUBLIC_CONTAINER . |
static java.lang.String |
DEFAULT_PUBLIC_CONTAINER_DESCRIPTION
The description for the containers to be associated with the blobs that are put without specifying a target
container, but are specified public.
|
static boolean |
DEFAULT_PUBLIC_CONTAINER_ENCRYPTED_SETTING
The encryption setting of
DEFAULT_PUBLIC_CONTAINER . |
static short |
DEFAULT_PUBLIC_CONTAINER_ID
The id for the containers to be associated with the blobs that are put without specifying a target container,
but are specified public.
|
static boolean |
DEFAULT_PUBLIC_CONTAINER_MEDIA_SCAN_DISABLED_SETTING
The media scan disabled setting for
DEFAULT_PUBLIC_CONTAINER . |
static java.lang.String |
DEFAULT_PUBLIC_CONTAINER_NAME
The name for the containers to be associated with the blobs that are put without specifying a target container,
but are specified public.
|
static short |
DEFAULT_PUBLIC_CONTAINER_PARENT_ACCOUNT_ID
The parent account id of
DEFAULT_PUBLIC_CONTAINER . |
static boolean |
DEFAULT_PUBLIC_CONTAINER_PREVIOUSLY_ENCRYPTED_SETTING
The previously encrypted flag for
DEFAULT_PUBLIC_CONTAINER . |
static Container.ContainerStatus |
DEFAULT_PUBLIC_CONTAINER_STATUS
The status for the containers to be associated with the blobs that are put without specifying a target container,
but are specified public.
|
static boolean |
DEFAULT_PUBLIC_CONTAINER_TTL_REQUIRED_SETTING
The ttl required setting for
DEFAULT_PUBLIC_CONTAINER . |
static short |
HELIX_ACCOUNT_SERVICE_CONTAINER_ID
The id for HelixAccountService to store
Account metadata. |
static short |
JSON_VERSION_1 |
static short |
JSON_VERSION_2 |
static Container |
UNKNOWN_CONTAINER
Deprecated.
|
static boolean |
UNKNOWN_CONTAINER_CACHEABLE_SETTING
The cache setting of
UNKNOWN_CONTAINER . |
static java.lang.String |
UNKNOWN_CONTAINER_DESCRIPTION
The description of
UNKNOWN_CONTAINER . |
static boolean |
UNKNOWN_CONTAINER_ENCRYPTED_SETTING
The encryption setting of
UNKNOWN_CONTAINER . |
static short |
UNKNOWN_CONTAINER_ID
The id of
UNKNOWN_CONTAINER . |
static boolean |
UNKNOWN_CONTAINER_MEDIA_SCAN_DISABLED_SETTING
The media scan disabled setting for
UNKNOWN_CONTAINER . |
static java.lang.String |
UNKNOWN_CONTAINER_NAME
The name of
UNKNOWN_CONTAINER . |
static short |
UNKNOWN_CONTAINER_PARENT_ACCOUNT_ID
The parent account id of
UNKNOWN_CONTAINER . |
static boolean |
UNKNOWN_CONTAINER_PREVIOUSLY_ENCRYPTED_SETTING
The previously encrypted flag for
UNKNOWN_CONTAINER . |
static Container.ContainerStatus |
UNKNOWN_CONTAINER_STATUS
The status of
UNKNOWN_CONTAINER . |
static boolean |
UNKNOWN_CONTAINER_TTL_REQUIRED_SETTING
The ttl required setting for
UNKNOWN_CONTAINER . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.Set<java.lang.String> |
getContentTypeWhitelistForFilenamesOnDownload() |
static short |
getCurrentJsonVersion() |
java.lang.String |
getDescription()
Gets the description of the container.
|
short |
getId()
Gets the id of the container.
|
java.lang.String |
getName()
Gets the name of the container.
|
short |
getParentAccountId()
Gets the if of the
Account that owns this container. |
java.lang.String |
getReplicationPolicy() |
Container.ContainerStatus |
getStatus()
Gets the status of the container.
|
int |
hashCode() |
boolean |
isBackupEnabled() |
boolean |
isCacheable() |
boolean |
isEncrypted() |
boolean |
isMediaScanDisabled() |
boolean |
isSecurePathRequired() |
boolean |
isTtlRequired() |
static void |
setCurrentJsonVersion(short currentJsonVersion)
Set the JSON version to serialize in.
|
java.lang.String |
toString()
Generates a String representation that uniquely identifies this container.
|
boolean |
wasPreviouslyEncrypted() |
public static final short JSON_VERSION_1
public static final short JSON_VERSION_2
public static final short UNKNOWN_CONTAINER_ID
UNKNOWN_CONTAINER
.public static final short HELIX_ACCOUNT_SERVICE_CONTAINER_ID
Account
metadata.public static final short DEFAULT_PUBLIC_CONTAINER_ID
DEFAULT_PUBLIC_CONTAINER
is one of the containers that use it.public static final short DEFAULT_PRIVATE_CONTAINER_ID
DEFAULT_PRIVATE_CONTAINER
is one of the containers that use it.public static final java.lang.String UNKNOWN_CONTAINER_NAME
UNKNOWN_CONTAINER
.public static final java.lang.String DEFAULT_PUBLIC_CONTAINER_NAME
DEFAULT_PUBLIC_CONTAINER
is one of the containers that use it.public static final java.lang.String DEFAULT_PRIVATE_CONTAINER_NAME
DEFAULT_PRIVATE_CONTAINER
is one of the containers that use it.public static final Container.ContainerStatus UNKNOWN_CONTAINER_STATUS
UNKNOWN_CONTAINER
.public static final Container.ContainerStatus DEFAULT_PUBLIC_CONTAINER_STATUS
DEFAULT_PUBLIC_CONTAINER
is one of the containers that use it.public static final Container.ContainerStatus DEFAULT_PRIVATE_CONTAINER_STATUS
DEFAULT_PRIVATE_CONTAINER
is one of the containers that use it.public static final java.lang.String UNKNOWN_CONTAINER_DESCRIPTION
UNKNOWN_CONTAINER
.public static final java.lang.String DEFAULT_PUBLIC_CONTAINER_DESCRIPTION
DEFAULT_PUBLIC_CONTAINER
is one of the containers that use it.public static final java.lang.String DEFAULT_PRIVATE_CONTAINER_DESCRIPTION
DEFAULT_PRIVATE_CONTAINER
is one of the containers that use it.public static final boolean UNKNOWN_CONTAINER_ENCRYPTED_SETTING
UNKNOWN_CONTAINER
.public static final boolean DEFAULT_PUBLIC_CONTAINER_ENCRYPTED_SETTING
DEFAULT_PUBLIC_CONTAINER
.public static final boolean DEFAULT_PRIVATE_CONTAINER_ENCRYPTED_SETTING
DEFAULT_PRIVATE_CONTAINER
.public static final boolean UNKNOWN_CONTAINER_PREVIOUSLY_ENCRYPTED_SETTING
UNKNOWN_CONTAINER
.public static final boolean DEFAULT_PUBLIC_CONTAINER_PREVIOUSLY_ENCRYPTED_SETTING
DEFAULT_PUBLIC_CONTAINER
.public static final boolean DEFAULT_PRIVATE_CONTAINER_PREVIOUSLY_ENCRYPTED_SETTING
DEFAULT_PRIVATE_CONTAINER
.public static final boolean UNKNOWN_CONTAINER_CACHEABLE_SETTING
UNKNOWN_CONTAINER
.public static final boolean DEFAULT_PUBLIC_CONTAINER_CACHEABLE_SETTING
DEFAULT_PUBLIC_CONTAINER
.public static final boolean DEFAULT_PRIVATE_CONTAINER_CACHEABLE_SETTING
DEFAULT_PRIVATE_CONTAINER
.public static final boolean UNKNOWN_CONTAINER_MEDIA_SCAN_DISABLED_SETTING
UNKNOWN_CONTAINER
.public static final boolean DEFAULT_PUBLIC_CONTAINER_MEDIA_SCAN_DISABLED_SETTING
DEFAULT_PUBLIC_CONTAINER
.public static final boolean DEFAULT_PRIVATE_CONTAINER_MEDIA_SCAN_DISABLED_SETTING
DEFAULT_PRIVATE_CONTAINER
.public static final boolean UNKNOWN_CONTAINER_TTL_REQUIRED_SETTING
UNKNOWN_CONTAINER
.public static final boolean DEFAULT_PUBLIC_CONTAINER_TTL_REQUIRED_SETTING
DEFAULT_PUBLIC_CONTAINER
.public static final boolean DEFAULT_PRIVATE_CONTAINER_TTL_REQUIRED_SETTING
DEFAULT_PRIVATE_CONTAINER
.public static final short UNKNOWN_CONTAINER_PARENT_ACCOUNT_ID
UNKNOWN_CONTAINER
.public static final short DEFAULT_PUBLIC_CONTAINER_PARENT_ACCOUNT_ID
DEFAULT_PUBLIC_CONTAINER
.public static final short DEFAULT_PRIVATE_CONTAINER_PARENT_ACCOUNT_ID
DEFAULT_PRIVATE_CONTAINER
.@Deprecated public static final Container UNKNOWN_CONTAINER
@Deprecated public static final Container DEFAULT_PUBLIC_CONTAINER
false
.
DO NOT USE IN PRODUCTION CODE.@Deprecated public static final Container DEFAULT_PRIVATE_CONTAINER
true
.
DO NOT USE IN PRODUCTION CODE.public static short getCurrentJsonVersion()
public static void setCurrentJsonVersion(short currentJsonVersion)
Container
serialization.currentJsonVersion
- the JSON version to serialize in.public short getId()
public java.lang.String getName()
public Container.ContainerStatus getStatus()
public java.lang.String getDescription()
public boolean isEncrypted()
true
if blobs in the Container
should be encrypted, false
otherwise.public boolean isBackupEnabled()
true
if blobs in the Container
should be backed up, false
otherwise.public boolean wasPreviouslyEncrypted()
true
if this Container
was encrypted in the past, and a subset of blobs in it could still
be encrypted.public boolean isCacheable()
true
if cache control headers should be set to allow CDNs and browsers to cache blobs in this
container.public boolean isMediaScanDisabled()
true
if media scans should be disabled on content created in this container.public java.lang.String getReplicationPolicy()
null
if the container has no preference.public boolean isTtlRequired()
true
if ttl is required on content created in this container.public java.util.Set<java.lang.String> getContentTypeWhitelistForFilenamesOnDownload()
public boolean isSecurePathRequired()
true
if secure path validation is required for url to access blobs in this container.public short getParentAccountId()
Account
that owns this container.Account
of this container.public java.lang.String toString()
Container[accountId:containerId]
.toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object