Package org.jclouds.blobstore.util
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 Summary
Constructors Constructor Description ForwardingBlobStore(BlobStore blobStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabortMultipartUpload(MultipartUpload mpu)BlobBuilderblobBuilder(String name)booleanblobExists(String container, String name)Determines if a blob existsBlobMetadatablobMetadata(String container, String name)Retrieves the metadata of aBlobat locationcontainer/namevoidclearContainer(String container)This will delete the contents of a container at its root path without deleting the containervoidclearContainer(String container, ListContainerOptions options)LikeBlobStore.clearContainer(String)except you can use options to do things like recursive deletes, or clear at a different path than root.StringcompleteMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)booleancontainerExists(String container)determines if a service-level container existsStringcopyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options)Copy blob from one container to another.longcountBlobs(String container)longcountBlobs(String container, ListContainerOptions options)booleancreateContainerInLocation(Location location, String container)Creates a namespace for your blobsbooleancreateContainerInLocation(Location location, String container, CreateContainerOptions createContainerOptions)voidcreateDirectory(String container, String directory)Creates a folder or a directory marker depending on the serviceprotected BlobStoredelegate()voiddeleteContainer(String container)This will delete everything inside a container recursively.booleandeleteContainerIfEmpty(String container)Deletes a container if it is empty.voiddeleteDirectory(String container, String directory)Deletes a folder or a directory marker depending on the servicebooleandirectoryExists(String container, String directory)Determines if a directory existsvoiddownloadBlob(String container, String name, File destination)voiddownloadBlob(String container, String name, File destination, ExecutorService executor)BlobgetBlob(String containerName, String blobName)Retrieves aBlobrepresenting the data at locationcontainer/nameBlobgetBlob(String containerName, String blobName, GetOptions getOptions)Retrieves aBlobrepresenting the data at locationcontainer/nameBlobAccessgetBlobAccess(String container, String name)ContainerAccessgetContainerAccess(String container)BlobStoreContextgetContext()longgetMaximumMultipartPartSize()intgetMaximumNumberOfParts()longgetMinimumMultipartPartSize()MultipartUploadinitiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options)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)LikeBlobStore.list(String)except you can control the size, recursion, and context of the list usingoptionsSet<? extends Location>listAssignableLocations()The get locations command returns all the valid locations for containers.List<MultipartPart>listMultipartUpload(MultipartUpload mpu)List<MultipartUpload>listMultipartUploads(String container)StringputBlob(String containerName, Blob blob)Adds aBlobrepresenting the data at locationcontainer/blob.metadata.nameStringputBlob(String containerName, Blob blob, PutOptions putOptions)Adds aBlobrepresenting the data at locationcontainer/blob.metadata.nameoptions using multipart strategies.voidremoveBlob(String container, String name)Deletes aBlobrepresenting the data at locationcontainer/namevoidremoveBlobs(String container, Iterable<String> iterable)Deletes multipleBlobs representing the data at locationcontainer/namevoidsetBlobAccess(String container, String name, BlobAccess access)voidsetContainerAccess(String container, ContainerAccess containerAccess)InputStreamstreamBlob(String container, String name)InputStreamstreamBlob(String container, String name, ExecutorService executor)MultipartPartuploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
-
-
-
Constructor Detail
-
ForwardingBlobStore
public ForwardingBlobStore(BlobStore blobStore)
-
-
Method Detail
-
delegate
protected BlobStore delegate()
- Specified by:
delegatein classcom.google.common.collect.ForwardingObject
-
getContext
public BlobStoreContext getContext()
- Specified by:
getContextin interfaceBlobStore- Returns:
- a reference to the context that created this BlobStore.
-
blobBuilder
public BlobBuilder blobBuilder(String name)
- Specified by:
blobBuilderin interfaceBlobStore- Returns:
- builder for creating new
Blobs
-
listAssignableLocations
public Set<? extends Location> listAssignableLocations()
Description copied from interface:BlobStoreThe 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:
listAssignableLocationsin interfaceBlobStore
-
list
public PageSet<? extends StorageMetadata> list()
Description copied from interface:BlobStoreLists all root-level resources available to the identity.
-
containerExists
public boolean containerExists(String container)
Description copied from interface:BlobStoredetermines if a service-level container exists- Specified by:
containerExistsin interfaceBlobStore
-
createContainerInLocation
public boolean createContainerInLocation(Location location, String container)
Description copied from interface:BlobStoreCreates 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:
createContainerInLocationin interfaceBlobStore- 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 locationcontainer- 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:
createContainerInLocationin interfaceBlobStorecreateContainerOptions- controls default access control- See Also:
BlobStore.createContainerInLocation(Location,String)
-
getContainerAccess
public ContainerAccess getContainerAccess(String container)
- Specified by:
getContainerAccessin interfaceBlobStore
-
setContainerAccess
public void setContainerAccess(String container, ContainerAccess containerAccess)
- Specified by:
setContainerAccessin interfaceBlobStore
-
list
public PageSet<? extends StorageMetadata> list(String container)
Description copied from interface:BlobStoreLists all resources in a container non-recursive.
-
list
public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options)
Description copied from interface:BlobStoreLikeBlobStore.list(String)except you can control the size, recursion, and context of the list usingoptions
-
clearContainer
public void clearContainer(String container)
Description copied from interface:BlobStoreThis will delete the contents of a container at its root path without deleting the container- Specified by:
clearContainerin interfaceBlobStore- Parameters:
container- what to clear
-
clearContainer
public void clearContainer(String container, ListContainerOptions options)
Description copied from interface:BlobStoreLikeBlobStore.clearContainer(String)except you can use options to do things like recursive deletes, or clear at a different path than root.- Specified by:
clearContainerin interfaceBlobStore- Parameters:
container- what to clearoptions- recursion and path to clear
-
deleteContainer
public void deleteContainer(String container)
Description copied from interface:BlobStoreThis will delete everything inside a container recursively.- Specified by:
deleteContainerin interfaceBlobStore- Parameters:
container- what to delete
-
deleteContainerIfEmpty
public boolean deleteContainerIfEmpty(String container)
Description copied from interface:BlobStoreDeletes a container if it is empty.- Specified by:
deleteContainerIfEmptyin interfaceBlobStore- 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:BlobStoreDetermines if a directory exists- Specified by:
directoryExistsin interfaceBlobStore- Parameters:
container- container where the directory residesdirectory- full path to the directory
-
createDirectory
public void createDirectory(String container, String directory)
Description copied from interface:BlobStoreCreates a folder or a directory marker depending on the service- Specified by:
createDirectoryin interfaceBlobStore- Parameters:
container- container to create the directory indirectory- full path to the directory
-
deleteDirectory
public void deleteDirectory(String container, String directory)
Description copied from interface:BlobStoreDeletes a folder or a directory marker depending on the service- Specified by:
deleteDirectoryin interfaceBlobStore
-
blobExists
public boolean blobExists(String container, String name)
Description copied from interface:BlobStoreDetermines if a blob exists- Specified by:
blobExistsin interfaceBlobStore- Parameters:
container- container where the blob resides
-
putBlob
public String putBlob(String containerName, Blob blob)
Description copied from interface:BlobStoreAdds aBlobrepresenting the data at locationcontainer/blob.metadata.name
-
putBlob
public String putBlob(String containerName, Blob blob, PutOptions putOptions)
Description copied from interface:BlobStoreAdds aBlobrepresenting the data at locationcontainer/blob.metadata.nameoptions using multipart strategies.
-
copyBlob
public String copyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options)
Description copied from interface:BlobStoreCopy blob from one container to another. Some providers implement this more efficiently than corresponding getBlob and putBlob operations. Note: options are currently ignored
-
blobMetadata
public BlobMetadata blobMetadata(String container, String name)
Description copied from interface:BlobStoreRetrieves the metadata of aBlobat locationcontainer/name- Specified by:
blobMetadatain interfaceBlobStore- 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:BlobStoreRetrieves aBlobrepresenting the data at locationcontainer/name
-
getBlob
public Blob getBlob(String containerName, String blobName, GetOptions getOptions)
Description copied from interface:BlobStoreRetrieves aBlobrepresenting the data at locationcontainer/name
-
removeBlob
public void removeBlob(String container, String name)
Description copied from interface:BlobStoreDeletes aBlobrepresenting the data at locationcontainer/name- Specified by:
removeBlobin interfaceBlobStore- 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:BlobStoreDeletes multipleBlobs representing the data at locationcontainer/name- Specified by:
removeBlobsin interfaceBlobStore- Parameters:
container- container where this exists.iterable- fully qualified names relative to the container.
-
getBlobAccess
public BlobAccess getBlobAccess(String container, String name)
- Specified by:
getBlobAccessin interfaceBlobStore
-
setBlobAccess
public void setBlobAccess(String container, String name, BlobAccess access)
- Specified by:
setBlobAccessin interfaceBlobStore
-
countBlobs
public long countBlobs(String container)
- Specified by:
countBlobsin interfaceBlobStore- Returns:
- a count of all blobs in the container, excluding directory markers
-
countBlobs
public long countBlobs(String container, ListContainerOptions options)
- Specified by:
countBlobsin interfaceBlobStore- 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:
initiateMultipartUploadin interfaceBlobStore
-
abortMultipartUpload
public void abortMultipartUpload(MultipartUpload mpu)
- Specified by:
abortMultipartUploadin interfaceBlobStore
-
completeMultipartUpload
public String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)
- Specified by:
completeMultipartUploadin interfaceBlobStore
-
uploadMultipartPart
public MultipartPart uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
- Specified by:
uploadMultipartPartin interfaceBlobStore
-
listMultipartUpload
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu)
- Specified by:
listMultipartUploadin interfaceBlobStore
-
listMultipartUploads
public List<MultipartUpload> listMultipartUploads(String container)
- Specified by:
listMultipartUploadsin interfaceBlobStore
-
getMinimumMultipartPartSize
public long getMinimumMultipartPartSize()
- Specified by:
getMinimumMultipartPartSizein interfaceBlobStore
-
getMaximumMultipartPartSize
public long getMaximumMultipartPartSize()
- Specified by:
getMaximumMultipartPartSizein interfaceBlobStore
-
getMaximumNumberOfParts
public int getMaximumNumberOfParts()
- Specified by:
getMaximumNumberOfPartsin interfaceBlobStore
-
downloadBlob
public void downloadBlob(String container, String name, File destination)
- Specified by:
downloadBlobin interfaceBlobStore
-
downloadBlob
public void downloadBlob(String container, String name, File destination, ExecutorService executor)
- Specified by:
downloadBlobin interfaceBlobStore
-
streamBlob
public InputStream streamBlob(String container, String name)
- Specified by:
streamBlobin interfaceBlobStore
-
streamBlob
public InputStream streamBlob(String container, String name, ExecutorService executor)
- Specified by:
streamBlobin interfaceBlobStore
-
-