org.jclouds.blobstore.internal
Class BaseAsyncBlobStore

java.lang.Object
  extended by org.jclouds.blobstore.internal.BaseAsyncBlobStore
All Implemented Interfaces:
AsyncBlobStore
Direct Known Subclasses:
AtmosAsyncBlobStore, AzureAsyncBlobStore, FilesystemAsyncBlobStore, S3AsyncBlobStore, SwiftAsyncBlobStore, TransientAsyncBlobStore

public abstract class BaseAsyncBlobStore
extends Object
implements AsyncBlobStore

Author:
Adrian Cole

Field Summary
protected  BlobUtils blobUtils
           
protected  BlobStoreContext context
           
protected  com.google.common.base.Supplier<Location> defaultLocation
           
protected  com.google.common.base.Supplier<Set<? extends Location>> locations
           
protected  ExecutorService service
           
 
Constructor Summary
protected BaseAsyncBlobStore(BlobStoreContext context, BlobUtils blobUtils, ExecutorService service, com.google.common.base.Supplier<Location> defaultLocation, com.google.common.base.Supplier<Set<? extends Location>> locations)
           
 
Method Summary
 BlobBuilder blobBuilder(String name)
          invokes BlobUtilsImpl.blobBuilder()
 com.google.common.util.concurrent.ListenableFuture<Void> clearContainer(String container)
          This implementation invokes clearContainer(java.lang.String) with the ListContainerOptions.recursive option.
 com.google.common.util.concurrent.ListenableFuture<Void> clearContainer(String containerName, ListContainerOptions options)
          This implementation invokes BlobUtilsImpl.clearContainer(java.lang.String, org.jclouds.blobstore.options.ListContainerOptions)
 com.google.common.util.concurrent.ListenableFuture<Long> countBlobs(String container)
          This implementation invokes countBlobs(java.lang.String) with the ListContainerOptions.recursive option.
 com.google.common.util.concurrent.ListenableFuture<Long> countBlobs(String containerName, ListContainerOptions options)
          This implementation invokes BlobUtilsImpl.countBlobs(java.lang.String, org.jclouds.blobstore.options.ListContainerOptions)
 com.google.common.util.concurrent.ListenableFuture<Void> createDirectory(String containerName, String directory)
          This implementation invokes BlobUtilsImpl.createDirectory(java.lang.String, java.lang.String)
protected  void deleteAndEnsurePathGone(String container)
           
protected abstract  boolean deleteAndVerifyContainerGone(String container)
           
 com.google.common.util.concurrent.ListenableFuture<Void> deleteContainer(String container)
          This implementation invokes deleteAndEnsurePathGone(java.lang.String)
 com.google.common.util.concurrent.ListenableFuture<Void> deleteDirectory(String containerName, String directory)
          This implementation invokes BlobUtilsImpl.deleteDirectory(java.lang.String, java.lang.String).
 com.google.common.util.concurrent.ListenableFuture<Boolean> directoryExists(String containerName, String directory)
          This implementation invokes BlobUtilsImpl.directoryExists(java.lang.String, java.lang.String)
 com.google.common.util.concurrent.ListenableFuture<Blob> getBlob(String container, String key)
          This implementation invokes AsyncBlobStore.getBlob(String,String,org.jclouds.blobstore.options.GetOptions)
 BlobStoreContext getContext()
           
 com.google.common.util.concurrent.ListenableFuture<PageSet<? extends StorageMetadata>> list(String container)
          This implementation invokes AsyncBlobStore.list(String,org.jclouds.blobstore.options.ListContainerOptions)
 com.google.common.util.concurrent.ListenableFuture<Set<? extends Location>> listAssignableLocations()
           
 Blob newBlob(String name)
          invokes BlobUtilsImpl.newBlob(java.lang.String)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jclouds.blobstore.AsyncBlobStore
blobExists, blobMetadata, containerExists, createContainerInLocation, createContainerInLocation, getBlob, list, list, putBlob, putBlob, removeBlob
 

Field Detail

context

protected final BlobStoreContext context

blobUtils

protected final BlobUtils blobUtils

service

protected final ExecutorService service

defaultLocation

protected final com.google.common.base.Supplier<Location> defaultLocation

locations

protected final com.google.common.base.Supplier<Set<? extends Location>> locations
Constructor Detail

BaseAsyncBlobStore

@Inject
protected BaseAsyncBlobStore(BlobStoreContext context,
                                    BlobUtils blobUtils,
                                    @Named(value="jclouds.user-threads")
                                    ExecutorService service,
                                    com.google.common.base.Supplier<Location> defaultLocation,
                                    com.google.common.base.Supplier<Set<? extends Location>> locations)
Method Detail

getContext

public BlobStoreContext getContext()
Specified by:
getContext in interface AsyncBlobStore
See Also:
BlobStore.getContext()

newBlob

public Blob newBlob(String name)
invokes BlobUtilsImpl.newBlob(java.lang.String)

Specified by:
newBlob in interface AsyncBlobStore
See Also:
BlobStore.newBlob(java.lang.String)

blobBuilder

public BlobBuilder blobBuilder(String name)
invokes BlobUtilsImpl.blobBuilder()

Specified by:
blobBuilder in interface AsyncBlobStore
See Also:
BlobStore.blobBuilder(java.lang.String)

list

public com.google.common.util.concurrent.ListenableFuture<PageSet<? extends StorageMetadata>> list(String container)
This implementation invokes AsyncBlobStore.list(String,org.jclouds.blobstore.options.ListContainerOptions)

Specified by:
list in interface AsyncBlobStore
Parameters:
container - container name
See Also:
BlobStore.list(String)

countBlobs

public com.google.common.util.concurrent.ListenableFuture<Long> countBlobs(String container)
This implementation invokes countBlobs(java.lang.String) with the ListContainerOptions.recursive option.

Specified by:
countBlobs in interface AsyncBlobStore
Parameters:
container - container name
See Also:
BlobStore.countBlobs(String)

countBlobs

public com.google.common.util.concurrent.ListenableFuture<Long> countBlobs(String containerName,
                                                                           ListContainerOptions options)
This implementation invokes BlobUtilsImpl.countBlobs(java.lang.String, org.jclouds.blobstore.options.ListContainerOptions)

Specified by:
countBlobs in interface AsyncBlobStore
Parameters:
container - container name
See Also:
BlobStore.countBlobs(String,ListContainerOptions)

clearContainer

public com.google.common.util.concurrent.ListenableFuture<Void> clearContainer(String container)
This implementation invokes clearContainer(java.lang.String) with the ListContainerOptions.recursive option.

Specified by:
clearContainer in interface AsyncBlobStore
Parameters:
container - container name
See Also:
BlobStore.clearContainer(String)

clearContainer

public com.google.common.util.concurrent.ListenableFuture<Void> clearContainer(String containerName,
                                                                               ListContainerOptions options)
This implementation invokes BlobUtilsImpl.clearContainer(java.lang.String, org.jclouds.blobstore.options.ListContainerOptions)

Specified by:
clearContainer in interface AsyncBlobStore
Parameters:
container - container name
See Also:
BlobStore.clearContainer(String, ListContainerOptions)

deleteDirectory

public com.google.common.util.concurrent.ListenableFuture<Void> deleteDirectory(String containerName,
                                                                                String directory)
This implementation invokes BlobUtilsImpl.deleteDirectory(java.lang.String, java.lang.String).

Specified by:
deleteDirectory in interface AsyncBlobStore
Parameters:
container - container name
See Also:
BlobStore.deleteDirectory(java.lang.String, java.lang.String)

directoryExists

public com.google.common.util.concurrent.ListenableFuture<Boolean> directoryExists(String containerName,
                                                                                   String directory)
This implementation invokes BlobUtilsImpl.directoryExists(java.lang.String, java.lang.String)

Specified by:
directoryExists in interface AsyncBlobStore
Parameters:
container - container name
directory - virtual path
See Also:
BlobStore.directoryExists(java.lang.String, java.lang.String)

createDirectory

public com.google.common.util.concurrent.ListenableFuture<Void> createDirectory(String containerName,
                                                                                String directory)
This implementation invokes BlobUtilsImpl.createDirectory(java.lang.String, java.lang.String)

Specified by:
createDirectory in interface AsyncBlobStore
Parameters:
container - container name
directory - virtual path
See Also:
BlobStore.createDirectory(java.lang.String, java.lang.String)

getBlob

public com.google.common.util.concurrent.ListenableFuture<Blob> getBlob(String container,
                                                                        String key)
This implementation invokes AsyncBlobStore.getBlob(String,String,org.jclouds.blobstore.options.GetOptions)

Specified by:
getBlob in interface AsyncBlobStore
Parameters:
container - container name
key - blob key
See Also:
BlobStore.getBlob(String, String)

deleteContainer

public com.google.common.util.concurrent.ListenableFuture<Void> deleteContainer(String container)
This implementation invokes deleteAndEnsurePathGone(java.lang.String)

Specified by:
deleteContainer in interface AsyncBlobStore
Parameters:
container - bucket name
See Also:
BlobStore.deleteContainer(java.lang.String)

deleteAndEnsurePathGone

protected void deleteAndEnsurePathGone(String container)

listAssignableLocations

public com.google.common.util.concurrent.ListenableFuture<Set<? extends Location>> listAssignableLocations()
Specified by:
listAssignableLocations in interface AsyncBlobStore
See Also:
BlobStore.listAssignableLocations()

deleteAndVerifyContainerGone

protected abstract boolean deleteAndVerifyContainerGone(String container)


Copyright © 2009-2011 jclouds. All Rights Reserved.