org.jclouds.openstack.swift.blobstore
Class SwiftBlobStore

java.lang.Object
  extended by org.jclouds.blobstore.internal.BaseBlobStore
      extended by org.jclouds.openstack.swift.blobstore.SwiftBlobStore
All Implemented Interfaces:
BlobStore
Direct Known Subclasses:
CloudFilesBlobStore

@Singleton
public class SwiftBlobStore
extends BaseBlobStore

Author:
Adrian Cole

Field Summary
 
Fields inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobUtils, context, defaultLocation, locations
 
Constructor Summary
protected SwiftBlobStore(BlobStoreContext context, BlobUtils blobUtils, com.google.common.base.Supplier<Location> defaultLocation, com.google.common.base.Supplier<Set<? extends Location>> locations, CommonSwiftClient sync, ContainerToResourceMetadata container2ResourceMd, BlobStoreListContainerOptionsToListContainerOptions container2ContainerListOptions, ContainerToResourceList container2ResourceList, ObjectToBlob object2Blob, BlobToObject blob2Object, ObjectToBlobMetadata object2BlobMd, BlobToHttpGetOptions blob2ObjectGetOptions, javax.inject.Provider<FetchBlobMetadata> fetchBlobMetadataProvider)
           
 
Method Summary
 boolean blobExists(String container, String key)
          This implementation invokes CommonSwiftClient#blobExists
 BlobMetadata blobMetadata(String container, String key)
          This implementation invokes CommonSwiftClient.getObjectInfo(java.lang.String, java.lang.String)
 boolean containerExists(String container)
          This implementation invokes CommonSwiftClient.containerExists(java.lang.String)
 boolean createContainerInLocation(Location location, String container)
          This implementation invokes CommonSwiftClient#putBucketInRegion
 boolean createContainerInLocation(Location location, String container, CreateContainerOptions options)
           
protected  boolean deleteAndVerifyContainerGone(String container)
           
 Blob getBlob(String container, String key, GetOptions optionsList)
          This implementation invokes CommonSwiftClient.getObject(java.lang.String, java.lang.String, org.jclouds.http.options.GetOptions...)
 PageSet<? extends StorageMetadata> list()
          This implementation invokes CommonSwiftClient.listContainers(org.jclouds.openstack.swift.options.ListContainerOptions...)
 PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options)
          This implementation invokes CommonSwiftClient.listObjects(java.lang.String, org.jclouds.openstack.swift.options.ListContainerOptions...)
 String putBlob(String container, Blob blob)
          This implementation invokes CommonSwiftClient.putObject(java.lang.String, org.jclouds.openstack.swift.domain.SwiftObject)
 String putBlob(String container, Blob blob, PutOptions options)
          This implementation invokes CommonSwiftClient.putObject(java.lang.String, org.jclouds.openstack.swift.domain.SwiftObject)
 void removeBlob(String container, String key)
          This implementation invokes CommonSwiftClient.removeObject(java.lang.String, java.lang.String)
 
Methods inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobBuilder, clearAndDeleteContainer, clearContainer, clearContainer, countBlobs, countBlobs, createDirectory, deleteContainer, 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
 

Constructor Detail

SwiftBlobStore

@Inject
protected SwiftBlobStore(BlobStoreContext context,
                                BlobUtils blobUtils,
                                com.google.common.base.Supplier<Location> defaultLocation,
                                com.google.common.base.Supplier<Set<? extends Location>> locations,
                                CommonSwiftClient sync,
                                ContainerToResourceMetadata container2ResourceMd,
                                BlobStoreListContainerOptionsToListContainerOptions container2ContainerListOptions,
                                ContainerToResourceList container2ResourceList,
                                ObjectToBlob object2Blob,
                                BlobToObject blob2Object,
                                ObjectToBlobMetadata object2BlobMd,
                                BlobToHttpGetOptions blob2ObjectGetOptions,
                                javax.inject.Provider<FetchBlobMetadata> fetchBlobMetadataProvider)
Method Detail

list

public PageSet<? extends StorageMetadata> list()
This implementation invokes CommonSwiftClient.listContainers(org.jclouds.openstack.swift.options.ListContainerOptions...)


containerExists

public boolean containerExists(String container)
This implementation invokes CommonSwiftClient.containerExists(java.lang.String)

Parameters:
container - container name

createContainerInLocation

public boolean createContainerInLocation(Location location,
                                         String container)
This implementation invokes CommonSwiftClient#putBucketInRegion

Parameters:
location - currently ignored
container - container name
Returns:
true if the container was created, false if it already existed.

list

public PageSet<? extends StorageMetadata> list(String container,
                                               ListContainerOptions options)
This implementation invokes CommonSwiftClient.listObjects(java.lang.String, org.jclouds.openstack.swift.options.ListContainerOptions...)

Parameters:
container - container name
options - size, recursion, and context of the list
Returns:
a list that may be incomplete, depending on whether PageSet#getNextMarker is set

blobExists

public boolean blobExists(String container,
                          String key)
This implementation invokes CommonSwiftClient#blobExists

Parameters:
container - container name
key - file name

blobMetadata

public BlobMetadata blobMetadata(String container,
                                 String key)
This implementation invokes CommonSwiftClient.getObjectInfo(java.lang.String, java.lang.String)

Parameters:
container - container name
key - file name
Returns:
null if name isn't present or the blob you intended to receive.

getBlob

public Blob getBlob(String container,
                    String key,
                    GetOptions optionsList)
This implementation invokes CommonSwiftClient.getObject(java.lang.String, java.lang.String, org.jclouds.http.options.GetOptions...)

Parameters:
container - container name
key - file name
optionsList - byte range or condition options
Returns:
the blob you intended to receive or null, if it doesn't exist.

putBlob

public String putBlob(String container,
                      Blob blob)
This implementation invokes CommonSwiftClient.putObject(java.lang.String, org.jclouds.openstack.swift.domain.SwiftObject)

Parameters:
container - container name
blob - object
Returns:
etag of the blob you uploaded, possibly null where etags are unsupported

putBlob

public String putBlob(String container,
                      Blob blob,
                      PutOptions options)
This implementation invokes CommonSwiftClient.putObject(java.lang.String, org.jclouds.openstack.swift.domain.SwiftObject)

Parameters:
container - container name
blob - object
options - byte range options
Returns:
etag of the blob you uploaded, possibly null where etags are unsupported

removeBlob

public void removeBlob(String container,
                       String key)
This implementation invokes CommonSwiftClient.removeObject(java.lang.String, java.lang.String)

Parameters:
container - container name
key - file name

deleteAndVerifyContainerGone

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

createContainerInLocation

public boolean createContainerInLocation(Location location,
                                         String container,
                                         CreateContainerOptions options)
options - controls default access control
See Also:
BlobStore.createContainerInLocation(Location,String)


Copyright © 2009-2011 jclouds. All Rights Reserved.