org.jclouds.filesystem
Class FilesystemAsyncBlobStore

java.lang.Object
  extended by org.jclouds.blobstore.internal.BaseAsyncBlobStore
      extended by org.jclouds.filesystem.FilesystemAsyncBlobStore
All Implemented Interfaces:
AsyncBlobStore

public class FilesystemAsyncBlobStore
extends BaseAsyncBlobStore

Preconditions: Blob name cannot start with / char (or \ under windows)

Author:
Alfredo "Rainbowbreeze" Morresi

Nested Class Summary
protected static class FilesystemAsyncBlobStore.CommonPrefixes
           
protected static class FilesystemAsyncBlobStore.DelimiterFilter
           
 
Field Summary
protected  Blob.Factory blobFactory
           
protected  Crypto crypto
           
protected  DateService dateService
           
protected  HttpGetOptionsListToGetOptions httpGetOptionsConverter
           
protected  IfDirectoryReturnNameStrategy ifDirectoryReturnName
           
protected  Logger logger
           
protected  FilesystemStorageStrategy storageStrategy
           
 
Fields inherited from class org.jclouds.blobstore.internal.BaseAsyncBlobStore
blobUtils, context, defaultLocation, locations, service
 
Constructor Summary
protected FilesystemAsyncBlobStore(BlobStoreContext context, DateService dateService, Crypto crypto, HttpGetOptionsListToGetOptions httpGetOptionsConverter, IfDirectoryReturnNameStrategy ifDirectoryReturnName, Blob.Factory blobFactory, BlobUtils blobUtils, ExecutorService service, com.google.common.base.Supplier<Location> defaultLocation, com.google.common.base.Supplier<Set<? extends Location>> locations, FilesystemStorageStrategy storageStrategy)
           
 
Method Summary
 com.google.common.util.concurrent.ListenableFuture<Boolean> blobExists(String containerName, String key)
          
 com.google.common.util.concurrent.ListenableFuture<BlobMetadata> blobMetadata(String container, String key)
          
 com.google.common.util.concurrent.ListenableFuture<Boolean> containerExists(String containerName)
          
static MutableBlobMetadata copy(MutableBlobMetadata in)
           
static MutableBlobMetadata copy(MutableBlobMetadata in, String newKey)
           
protected  MutableStorageMetadata create()
           
 com.google.common.util.concurrent.ListenableFuture<Boolean> createContainerInLocation(Location location, String name)
          
protected  boolean deleteAndVerifyContainerGone(String container)
           
 com.google.common.util.concurrent.ListenableFuture<Void> deleteContainer(String container)
          Override parent method because it uses strange futures and listenables that creates problem in the test if more than one test that deletes the container is executed
static
<T extends Comparable<?>>
SortedSet<T>
firstSliceOfSize(Iterable<T> elements, int size)
           
 com.google.common.util.concurrent.ListenableFuture<Blob> getBlob(String containerName, String key, GetOptions options)
          
 String getFirstQueryOrNull(String string, HttpRequestOptions options)
           
 com.google.common.util.concurrent.ListenableFuture<PageSet<? extends StorageMetadata>> list()
          
 com.google.common.util.concurrent.ListenableFuture<PageSet<? extends StorageMetadata>> list(String container, ListContainerOptions options)
          default maxResults is 1000
 com.google.common.util.concurrent.ListenableFuture<String> putBlob(String containerName, Blob object)
          
 com.google.common.util.concurrent.ListenableFuture<Void> removeBlob(String container, String key)
          
static HttpResponseException returnResponseException(int code)
           
 
Methods inherited from class org.jclouds.blobstore.internal.BaseAsyncBlobStore
clearContainer, clearContainer, countBlobs, countBlobs, createDirectory, deleteAndEnsurePathGone, deleteDirectory, directoryExists, getBlob, getContext, list, listAssignableLocations, newBlob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger

dateService

protected final DateService dateService

crypto

protected final Crypto crypto

httpGetOptionsConverter

protected final HttpGetOptionsListToGetOptions httpGetOptionsConverter

ifDirectoryReturnName

protected final IfDirectoryReturnNameStrategy ifDirectoryReturnName

blobFactory

protected final Blob.Factory blobFactory

storageStrategy

protected final FilesystemStorageStrategy storageStrategy
Constructor Detail

FilesystemAsyncBlobStore

@Inject
protected FilesystemAsyncBlobStore(BlobStoreContext context,
                                          DateService dateService,
                                          Crypto crypto,
                                          HttpGetOptionsListToGetOptions httpGetOptionsConverter,
                                          IfDirectoryReturnNameStrategy ifDirectoryReturnName,
                                          Blob.Factory blobFactory,
                                          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,
                                          FilesystemStorageStrategy storageStrategy)
Method Detail

list

public com.google.common.util.concurrent.ListenableFuture<PageSet<? extends StorageMetadata>> list(String container,
                                                                                                   ListContainerOptions options)
default maxResults is 1000


copy

public static MutableBlobMetadata copy(MutableBlobMetadata in)

copy

public static MutableBlobMetadata copy(MutableBlobMetadata in,
                                       String newKey)

removeBlob

public com.google.common.util.concurrent.ListenableFuture<Void> removeBlob(String container,
                                                                           String key)


containerExists

public com.google.common.util.concurrent.ListenableFuture<Boolean> containerExists(String containerName)


list

public com.google.common.util.concurrent.ListenableFuture<PageSet<? extends StorageMetadata>> list()


create

protected MutableStorageMetadata create()

createContainerInLocation

public com.google.common.util.concurrent.ListenableFuture<Boolean> createContainerInLocation(Location location,
                                                                                             String name)


getFirstQueryOrNull

public String getFirstQueryOrNull(String string,
                                  @Nullable
                                  HttpRequestOptions options)

firstSliceOfSize

public static <T extends Comparable<?>> SortedSet<T> firstSliceOfSize(Iterable<T> elements,
                                                                      int size)

returnResponseException

public static HttpResponseException returnResponseException(int code)

putBlob

public com.google.common.util.concurrent.ListenableFuture<String> putBlob(String containerName,
                                                                          Blob object)


blobExists

public com.google.common.util.concurrent.ListenableFuture<Boolean> blobExists(String containerName,
                                                                              String key)


getBlob

public com.google.common.util.concurrent.ListenableFuture<Blob> getBlob(String containerName,
                                                                        String key,
                                                                        GetOptions options)


blobMetadata

public com.google.common.util.concurrent.ListenableFuture<BlobMetadata> blobMetadata(String container,
                                                                                     String key)


deleteAndVerifyContainerGone

protected boolean deleteAndVerifyContainerGone(String container)
Specified by:
deleteAndVerifyContainerGone in class BaseAsyncBlobStore

deleteContainer

public com.google.common.util.concurrent.ListenableFuture<Void> deleteContainer(String container)
Override parent method because it uses strange futures and listenables that creates problem in the test if more than one test that deletes the container is executed

Specified by:
deleteContainer in interface AsyncBlobStore
Overrides:
deleteContainer in class BaseAsyncBlobStore
Parameters:
container -
Returns:


Copyright © 2009-2012 jclouds. All Rights Reserved.