org.jclouds.blobstore.internal
Class BlobStoreContextImpl<S,A>

java.lang.Object
  extended by org.jclouds.blobstore.internal.BlobStoreContextImpl<S,A>
All Implemented Interfaces:
BlobStoreContext

@Singleton
public class BlobStoreContextImpl<S,A>
extends Object
implements BlobStoreContext

Author:
Adrian Cole

Constructor Summary
BlobStoreContextImpl(BlobMap.Factory blobMapFactory, Utils utils, ConsistencyModel consistencyModel, InputStreamMap.Factory inputStreamMapFactory, AsyncBlobStore ablobStore, BlobStore blobStore, RestContext providerSpecificContext, BlobRequestSigner blobRequestSigner)
           
 
Method Summary
 void close()
          closes threads and resources related to this connection.
 BlobMap createBlobMap(String container)
          Creates a Map view of the specified container.
 BlobMap createBlobMap(String container, ListContainerOptions options)
          Creates a Map view of the specified container.
 InputStreamMap createInputStreamMap(String container)
          Creates a Map view of the specified container.
 InputStreamMap createInputStreamMap(String container, ListContainerOptions options)
          Creates a Map view of the specified container.
 boolean equals(Object obj)
           
 AsyncBlobStore getAsyncBlobStore()
           
 BlobStore getBlobStore()
           
 ConsistencyModel getConsistencyModel()
           
 RestContext<S,A> getProviderSpecificContext()
           
 BlobRequestSigner getSigner()
          Generates signed requests for blobs.
 Utils getUtils()
           
 int hashCode()
           
 String toString()
           
 Utils utils()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlobStoreContextImpl

@Inject
public BlobStoreContextImpl(BlobMap.Factory blobMapFactory,
                                   Utils utils,
                                   ConsistencyModel consistencyModel,
                                   InputStreamMap.Factory inputStreamMapFactory,
                                   AsyncBlobStore ablobStore,
                                   BlobStore blobStore,
                                   RestContext providerSpecificContext,
                                   BlobRequestSigner blobRequestSigner)
Method Detail

getConsistencyModel

public ConsistencyModel getConsistencyModel()
Specified by:
getConsistencyModel in interface BlobStoreContext
Returns:
best guess at the consistency model used in this BlobStore.

createBlobMap

public BlobMap createBlobMap(String container,
                             ListContainerOptions options)
Description copied from interface: BlobStoreContext
Creates a Map view of the specified container. Use this when you wan to control the content type, or manually specify length or size of blobs.

Specified by:
createBlobMap in interface BlobStoreContext
Parameters:
container - existing container you wish to read or modify
options - allow you to specify a directory within the container, or whether to list recursively.

createBlobMap

public BlobMap createBlobMap(String container)
Description copied from interface: BlobStoreContext
Creates a Map view of the specified container. Use this when you wan to control the content type, or manually specify length or size of blobs. Only root-level blobs will be visible.

Specified by:
createBlobMap in interface BlobStoreContext
Parameters:
container - existing container you wish to read or modify

createInputStreamMap

public InputStreamMap createInputStreamMap(String container,
                                           ListContainerOptions options)
Description copied from interface: BlobStoreContext
Creates a Map view of the specified container. Use this for simplest access to blobstore, knowing that MD5s will be calculated for every object.

Specified by:
createInputStreamMap in interface BlobStoreContext
Parameters:
container - existing container you wish to read or modify
options - allow you to specify a directory within the container, or whether to list recursively.

createInputStreamMap

public InputStreamMap createInputStreamMap(String container)
Description copied from interface: BlobStoreContext
Creates a Map view of the specified container. Use this for simplest access to blobstore, knowing that MD5s will be calculated for every object. Only root-level blobs will be visible.

Specified by:
createInputStreamMap in interface BlobStoreContext
Parameters:
container - existing container you wish to read or modify

getBlobStore

public BlobStore getBlobStore()
Specified by:
getBlobStore in interface BlobStoreContext
Returns:
a portable interface for the BlobStore.

getAsyncBlobStore

public AsyncBlobStore getAsyncBlobStore()
Specified by:
getAsyncBlobStore in interface BlobStoreContext
Returns:
a portable asynchronous interface for the BlobStore, which returns Futures for each call.

getProviderSpecificContext

public RestContext<S,A> getProviderSpecificContext()
Specified by:
getProviderSpecificContext in interface BlobStoreContext
Returns:
a context you can use to the access provider or vendor specific api underlying this context.

close

public void close()
Description copied from interface: BlobStoreContext
closes threads and resources related to this connection.

Specified by:
close in interface BlobStoreContext

getUtils

public Utils getUtils()
Specified by:
getUtils in interface BlobStoreContext

utils

public Utils utils()
Specified by:
utils in interface BlobStoreContext
See Also:
BlobStoreContext.getUtils()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getSigner

public BlobRequestSigner getSigner()
Description copied from interface: BlobStoreContext
Generates signed requests for blobs. useful in other tools such as backup utilities.

Specified by:
getSigner in interface BlobStoreContext


Copyright © 2009-2011 jclouds. All Rights Reserved.