org.jclouds.blobstore
Interface BlobStore

All Known Subinterfaces:
FilesystemBlobStore
All Known Implementing Classes:
AtmosBlobStore, AWSS3BlobStore, AzureBlobStore, BaseBlobStore, CloudFilesBlobStore, S3BlobStore, SwiftBlobStore

public interface BlobStore

Synchronous access to a BlobStore such as Amazon S3

Author:
Adrian Cole
See Also:
AsyncBlobStore, BlobStoreContextFactory

Method Summary
 BlobBuilder blobBuilder(String name)
           
 boolean blobExists(String container, String name)
          Determines if a blob exists
 BlobMetadata blobMetadata(String container, String name)
          Retrieves the metadata of a Blob at location container/name
 void clearContainer(String container)
          This will delete the contents of a container at its root path without deleting the container
 void clearContainer(String container, ListContainerOptions options)
          Like clearContainer(String) except you can use options to do things like recursive deletes, or clear at a different path than root.
 boolean containerExists(String container)
          determines if a service-level container exists
 long countBlobs(String container)
           
 long countBlobs(String container, ListContainerOptions options)
           
 boolean createContainerInLocation(Location location, String container)
          Creates a namespace for your blobs

A container is a namespace for your objects.

 boolean createContainerInLocation(Location location, String container, CreateContainerOptions options)
           
 void createDirectory(String container, String directory)
          Creates a folder or a directory marker depending on the service
 void deleteContainer(String container)
          This will delete everything inside a container recursively.
 void deleteDirectory(String containerName, String name)
          Deletes a folder or a directory marker depending on the service
 boolean directoryExists(String container, String directory)
          Determines if a directory exists
 Blob getBlob(String container, String name)
          Retrieves a Blob representing the data at location container/name
 Blob getBlob(String container, String name, GetOptions options)
          Retrieves a Blob representing the data at location container/name
 BlobStoreContext getContext()
           
 PageSet<? extends StorageMetadata> list()
          Lists all root-level resources available to the identity.
 PageSet<? extends StorageMetadata> list(String container)
          Lists all resources in a container non-recursive.
 PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options)
          Like list(String) except you can control the size, recursion, and context of the list using options
 Set<? extends Location> listAssignableLocations()
          The get locations command returns all the valid locations for containers.
 Blob newBlob(String name)
          Deprecated. 
 String putBlob(String container, Blob blob)
          Adds a Blob representing the data at location container/blob.metadata.name
 String putBlob(String container, Blob blob, PutOptions options)
          Adds a Blob representing the data at location container/blob.metadata.name options using multipart strategies.
 void removeBlob(String container, String name)
          Deletes a Blob representing the data at location container/name
 

Method Detail

getContext

BlobStoreContext getContext()
Returns:
a reference to the context that created this BlobStore.

newBlob

@Deprecated
Blob newBlob(String name)
Deprecated. 

creates a new blob with the specified name.

See Also:
blobBuilder(java.lang.String)

blobBuilder

BlobBuilder blobBuilder(String name)
Returns:
builder for creating new Blobs

listAssignableLocations

Set<? extends Location> listAssignableLocations()
The get locations command returns all the valid locations for containers. A location has a scope, which is typically region or zone. A region is a general area, like eu-west, where a zone is similar to a datacenter. If a location has a parent, that implies it is within that location. For example a location can be a rack, whose parent is likely to be a zone.


list

PageSet<? extends StorageMetadata> list()
Lists all root-level resources available to the identity.


containerExists

boolean containerExists(String container)
determines if a service-level container exists


createContainerInLocation

boolean createContainerInLocation(@Nullable
                                  Location location,
                                  String container)
Creates a namespace for your blobs

A container is a namespace for your objects. Depending on the service, the scope can be global, identity, or sub-identity scoped. For example, in Amazon S3, containers are called buckets, and they must be uniquely named such that no-one else in the world conflicts. In other blobstores, the naming convention of the container is less strict. All blobstores allow you to list your containers and also the contents within them. These contents can either be blobs, folders, or virtual paths.

Parameters:
location - some blobstores allow you to specify a location, such as US-EAST, for where this container will exist. null will choose a default location
container - namespace. Typically constrained to lowercase alpha-numeric and hyphens.
Returns:
true if the container was created, false if it already existed.

createContainerInLocation

boolean createContainerInLocation(@Nullable
                                  Location location,
                                  String container,
                                  CreateContainerOptions options)
Parameters:
options - controls default access control
See Also:
createContainerInLocation(Location,String)

list

PageSet<? extends StorageMetadata> list(String container)
Lists all resources in a container non-recursive.

Parameters:
container - what to list
Returns:
a list that may be incomplete, depending on whether PageSet#getNextMarker is set

list

PageSet<? extends StorageMetadata> list(String container,
                                        ListContainerOptions options)
Like list(String) except you can control the size, recursion, and context of the list using options

Parameters:
container - what to list
options - size, recursion, and context of the list
Returns:
a list that may be incomplete, depending on whether PageSet#getNextMarker is set

clearContainer

void clearContainer(String container)
This will delete the contents of a container at its root path without deleting the container

Parameters:
container - what to clear

clearContainer

void clearContainer(String container,
                    ListContainerOptions options)
Like clearContainer(String) except you can use options to do things like recursive deletes, or clear at a different path than root.

Parameters:
container - what to clear
options - recursion and path to clear

deleteContainer

void deleteContainer(String container)
This will delete everything inside a container recursively.

Parameters:
container - what to delete

directoryExists

boolean directoryExists(String container,
                        String directory)
Determines if a directory exists

Parameters:
container - container where the directory resides
directory - full path to the directory

createDirectory

void createDirectory(String container,
                     String directory)
Creates a folder or a directory marker depending on the service

Parameters:
container - container to create the directory in
directory - full path to the directory

deleteDirectory

void deleteDirectory(String containerName,
                     String name)
Deletes a folder or a directory marker depending on the service

Parameters:
container - container to delete the directory from
directory - full path to the directory to delete

blobExists

boolean blobExists(String container,
                   String name)
Determines if a blob exists

Parameters:
container - container where the blob resides
directory - full path to the blob

putBlob

String putBlob(String container,
               Blob blob)
Adds a Blob representing the data at location container/blob.metadata.name

Parameters:
container - container to place the blob.
blob - fully qualified name relative to the container.
options - byte range or condition options
Returns:
etag of the blob you uploaded, possibly null where etags are unsupported
Throws:
ContainerNotFoundException - if the container doesn't exist

putBlob

String putBlob(String container,
               Blob blob,
               PutOptions options)
Adds a Blob representing the data at location container/blob.metadata.name options using multipart strategies.

Parameters:
container - container to place the blob.
blob - fully qualified name relative to the container.
options - byte range options
Returns:
etag of the blob you uploaded, possibly null where etags are unsupported
Throws:
ContainerNotFoundException - if the container doesn't exist

blobMetadata

BlobMetadata blobMetadata(String container,
                          String name)
Retrieves the metadata of a Blob at location container/name

Parameters:
container - container where this exists.
name - fully qualified name relative to the container.
Returns:
null if name isn't present or the blob you intended to receive.
Throws:
ContainerNotFoundException - if the container doesn't exist

getBlob

Blob getBlob(String container,
             String name)
Retrieves a Blob representing the data at location container/name

Parameters:
container - container where this exists.
name - fully qualified name relative to the container.
Returns:
the blob you intended to receive or null, if it doesn't exist.
Throws:
ContainerNotFoundException - if the container doesn't exist

getBlob

Blob getBlob(String container,
             String name,
             GetOptions options)
Retrieves a Blob representing the data at location container/name

Parameters:
container - container where this exists.
name - fully qualified name relative to the container.
options - byte range or condition options
Returns:
the blob you intended to receive or null, if it doesn't exist.
Throws:
ContainerNotFoundException - if the container doesn't exist

removeBlob

void removeBlob(String container,
                String name)
Deletes a Blob representing the data at location container/name

Parameters:
container - container where this exists.
name - fully qualified name relative to the container.
Throws:
ContainerNotFoundException - if the container doesn't exist

countBlobs

long countBlobs(String container)
Returns:
a count of all blobs in the container, excluding directory markers

countBlobs

long countBlobs(String container,
                ListContainerOptions options)
Returns:
a count of all blobs that are in a listing constrained by the options specified, excluding directory markers


Copyright © 2009-2011 jclouds. All Rights Reserved.