Class ForwardingBlobStore

java.lang.Object
com.google.common.collect.ForwardingObject
org.jclouds.blobstore.util.ForwardingBlobStore
All Implemented Interfaces:
BlobStore
Direct Known Subclasses:
ReadOnlyBlobStore

public abstract class ForwardingBlobStore extends com.google.common.collect.ForwardingObject implements BlobStore
  • Constructor Details

    • ForwardingBlobStore

      public ForwardingBlobStore(BlobStore blobStore)
  • Method Details

    • delegate

      protected BlobStore delegate()
      Specified by:
      delegate in class com.google.common.collect.ForwardingObject
    • getContext

      public BlobStoreContext getContext()
      Specified by:
      getContext in interface BlobStore
      Returns:
      a reference to the context that created this BlobStore.
    • blobBuilder

      public BlobBuilder blobBuilder(String name)
      Specified by:
      blobBuilder in interface BlobStore
      Returns:
      builder for creating new Blobs
    • listAssignableLocations

      public Set<? extends Location> listAssignableLocations()
      Description copied from interface: BlobStore
      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.
      Specified by:
      listAssignableLocations in interface BlobStore
    • list

      public PageSet<? extends StorageMetadata> list()
      Description copied from interface: BlobStore
      Lists all root-level resources available to the identity.
      Specified by:
      list in interface BlobStore
    • containerExists

      public boolean containerExists(String container)
      Description copied from interface: BlobStore
      determines if a service-level container exists
      Specified by:
      containerExists in interface BlobStore
    • createContainerInLocation

      public boolean createContainerInLocation(Location location, String container)
      Description copied from interface: BlobStore
      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.

      Specified by:
      createContainerInLocation in interface BlobStore
      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

      public boolean createContainerInLocation(Location location, String container, CreateContainerOptions createContainerOptions)
      Specified by:
      createContainerInLocation in interface BlobStore
      Parameters:
      createContainerOptions - controls default access control
      See Also:
    • getContainerAccess

      public ContainerAccess getContainerAccess(String container)
      Specified by:
      getContainerAccess in interface BlobStore
    • setContainerAccess

      public void setContainerAccess(String container, ContainerAccess containerAccess)
      Specified by:
      setContainerAccess in interface BlobStore
    • list

      public PageSet<? extends StorageMetadata> list(String container)
      Description copied from interface: BlobStore
      Lists all resources in a container non-recursive.
      Specified by:
      list in interface BlobStore
      Parameters:
      container - what to list
      Returns:
      a list that may be incomplete, depending on whether PageSet#getNextMarker is set
    • list

      public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options)
      Description copied from interface: BlobStore
      Like BlobStore.list(String) except you can control the size, recursion, and context of the list using options
      Specified by:
      list in interface BlobStore
      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

      public void clearContainer(String container)
      Description copied from interface: BlobStore
      This will delete the contents of a container at its root path without deleting the container
      Specified by:
      clearContainer in interface BlobStore
      Parameters:
      container - what to clear
    • clearContainer

      public void clearContainer(String container, ListContainerOptions options)
      Description copied from interface: BlobStore
      Like BlobStore.clearContainer(String) except you can use options to do things like recursive deletes, or clear at a different path than root.
      Specified by:
      clearContainer in interface BlobStore
      Parameters:
      container - what to clear
      options - recursion and path to clear
    • deleteContainer

      public void deleteContainer(String container)
      Description copied from interface: BlobStore
      This will delete everything inside a container recursively.
      Specified by:
      deleteContainer in interface BlobStore
      Parameters:
      container - what to delete
    • deleteContainerIfEmpty

      public boolean deleteContainerIfEmpty(String container)
      Description copied from interface: BlobStore
      Deletes a container if it is empty.
      Specified by:
      deleteContainerIfEmpty in interface BlobStore
      Parameters:
      container - name of the container to delete
      Returns:
      true if the container was deleted or does not exist
    • directoryExists

      public boolean directoryExists(String container, String directory)
      Description copied from interface: BlobStore
      Determines if a directory exists
      Specified by:
      directoryExists in interface BlobStore
      Parameters:
      container - container where the directory resides
      directory - full path to the directory
    • createDirectory

      public void createDirectory(String container, String directory)
      Description copied from interface: BlobStore
      Creates a folder or a directory marker depending on the service
      Specified by:
      createDirectory in interface BlobStore
      Parameters:
      container - container to create the directory in
      directory - full path to the directory
    • deleteDirectory

      public void deleteDirectory(String container, String directory)
      Description copied from interface: BlobStore
      Deletes a folder or a directory marker depending on the service
      Specified by:
      deleteDirectory in interface BlobStore
    • blobExists

      public boolean blobExists(String container, String name)
      Description copied from interface: BlobStore
      Determines if a blob exists
      Specified by:
      blobExists in interface BlobStore
      Parameters:
      container - container where the blob resides
    • putBlob

      public String putBlob(String containerName, Blob blob)
      Description copied from interface: BlobStore
      Adds a Blob representing the data at location container/blob.metadata.name
      Specified by:
      putBlob in interface BlobStore
      Parameters:
      containerName - container to place the blob.
      blob - fully qualified name relative to the container.
      Returns:
      etag of the blob you uploaded, possibly null where etags are unsupported
    • putBlob

      public String putBlob(String containerName, Blob blob, PutOptions putOptions)
      Description copied from interface: BlobStore
      Adds a Blob representing the data at location container/blob.metadata.name options using multipart strategies.
      Specified by:
      putBlob in interface BlobStore
      Parameters:
      containerName - container to place the blob.
      blob - fully qualified name relative to the container.
      putOptions - byte range options
      Returns:
      etag of the blob you uploaded, possibly null where etags are unsupported
    • copyBlob

      public String copyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options)
      Description copied from interface: BlobStore
      Copy blob from one container to another. Some providers implement this more efficiently than corresponding getBlob and putBlob operations. Note: options are currently ignored
      Specified by:
      copyBlob in interface BlobStore
      Returns:
      ETag of new blob
    • blobMetadata

      public BlobMetadata blobMetadata(String container, String name)
      Description copied from interface: BlobStore
      Retrieves the metadata of a Blob at location container/name
      Specified by:
      blobMetadata in interface BlobStore
      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.
    • getBlob

      public Blob getBlob(String containerName, String blobName)
      Description copied from interface: BlobStore
      Retrieves a Blob representing the data at location container/name
      Specified by:
      getBlob in interface BlobStore
      Parameters:
      containerName - container where this exists.
      blobName - fully qualified name relative to the container.
      Returns:
      the blob you intended to receive or null, if it doesn't exist.
    • getBlob

      public Blob getBlob(String containerName, String blobName, GetOptions getOptions)
      Description copied from interface: BlobStore
      Retrieves a Blob representing the data at location container/name
      Specified by:
      getBlob in interface BlobStore
      Parameters:
      containerName - container where this exists.
      blobName - fully qualified name relative to the container.
      getOptions - byte range or condition options
      Returns:
      the blob you intended to receive or null, if it doesn't exist.
    • removeBlob

      public void removeBlob(String container, String name)
      Description copied from interface: BlobStore
      Deletes a Blob representing the data at location container/name
      Specified by:
      removeBlob in interface BlobStore
      Parameters:
      container - container where this exists.
      name - fully qualified name relative to the container.
    • removeBlobs

      public void removeBlobs(String container, Iterable<String> iterable)
      Description copied from interface: BlobStore
      Deletes multiple Blobs representing the data at location container/name
      Specified by:
      removeBlobs in interface BlobStore
      Parameters:
      container - container where this exists.
      iterable - fully qualified names relative to the container.
    • getBlobAccess

      public BlobAccess getBlobAccess(String container, String name)
      Specified by:
      getBlobAccess in interface BlobStore
    • setBlobAccess

      public void setBlobAccess(String container, String name, BlobAccess access)
      Specified by:
      setBlobAccess in interface BlobStore
    • countBlobs

      public long countBlobs(String container)
      Specified by:
      countBlobs in interface BlobStore
      Returns:
      a count of all blobs in the container, excluding directory markers
    • countBlobs

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

      public MultipartUpload initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options)
      Specified by:
      initiateMultipartUpload in interface BlobStore
    • abortMultipartUpload

      public void abortMultipartUpload(MultipartUpload mpu)
      Specified by:
      abortMultipartUpload in interface BlobStore
    • completeMultipartUpload

      public String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)
      Specified by:
      completeMultipartUpload in interface BlobStore
    • uploadMultipartPart

      public MultipartPart uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
      Specified by:
      uploadMultipartPart in interface BlobStore
    • listMultipartUpload

      public List<MultipartPart> listMultipartUpload(MultipartUpload mpu)
      Specified by:
      listMultipartUpload in interface BlobStore
    • listMultipartUploads

      public List<MultipartUpload> listMultipartUploads(String container)
      Specified by:
      listMultipartUploads in interface BlobStore
    • getMinimumMultipartPartSize

      public long getMinimumMultipartPartSize()
      Specified by:
      getMinimumMultipartPartSize in interface BlobStore
    • getMaximumMultipartPartSize

      public long getMaximumMultipartPartSize()
      Specified by:
      getMaximumMultipartPartSize in interface BlobStore
    • getMaximumNumberOfParts

      public int getMaximumNumberOfParts()
      Specified by:
      getMaximumNumberOfParts in interface BlobStore
    • downloadBlob

      public void downloadBlob(String container, String name, File destination)
      Specified by:
      downloadBlob in interface BlobStore
    • downloadBlob

      public void downloadBlob(String container, String name, File destination, ExecutorService executor)
      Specified by:
      downloadBlob in interface BlobStore
    • streamBlob

      public InputStream streamBlob(String container, String name)
      Specified by:
      streamBlob in interface BlobStore
    • streamBlob

      public InputStream streamBlob(String container, String name, ExecutorService executor)
      Specified by:
      streamBlob in interface BlobStore