org.jclouds.atmos.blobstore
Class AtmosBlobStore

java.lang.Object
  extended by org.jclouds.blobstore.internal.BaseBlobStore
      extended by org.jclouds.atmos.blobstore.AtmosBlobStore
All Implemented Interfaces:
BlobStore

@Singleton
public class AtmosBlobStore
extends BaseBlobStore

Author:
Adrian Cole

Field Summary
 
Fields inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobUtils, context, defaultLocation, locations
 
Method Summary
 boolean blobExists(String container, String key)
          This implementation invokes AtmosClient.pathExists(java.lang.String)
 BlobMetadata blobMetadata(String container, String key)
          This implementation invokes AtmosClient.headFile(java.lang.String)
 boolean containerExists(String container)
          This implementation invokes AtmosClient.pathExists(java.lang.String)
 boolean createContainerInLocation(Location location, String container)
          This implementation invokes AtmosClient.createDirectory(java.lang.String, org.jclouds.atmos.options.PutOptions...)
 boolean createContainerInLocation(Location location, String container, CreateContainerOptions options)
           
 void createDirectory(String container, String directory)
          This implementation invokes AtmosClient.createDirectory(java.lang.String, org.jclouds.atmos.options.PutOptions...)
protected  boolean deleteAndVerifyContainerGone(String container)
          This implementation invokes AtmosAsyncClient.deletePath(java.lang.String) followed by AtmosAsyncClient.pathExists(java.lang.String) until it is true.
 void deleteDirectory(String containerName, String directory)
          This implementation invokes removeBlob(java.lang.String, java.lang.String)
 boolean directoryExists(String container, String directory)
          This implementation invokes AtmosClient.pathExists(java.lang.String)
 Blob getBlob(String container, String key, GetOptions options)
          This implementation invokes AtmosClient.readFile(java.lang.String, org.jclouds.http.options.GetOptions...)
 PageSet<? extends StorageMetadata> list()
          This implementation invokes AtmosClient.listDirectories(org.jclouds.atmos.options.ListOptions...)
 PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options)
          This implementation invokes AtmosClient.listDirectory(java.lang.String, org.jclouds.atmos.options.ListOptions...)
 String putBlob(String container, Blob blob)
          This implementation invokes AtmosClient.createFile(java.lang.String, org.jclouds.atmos.domain.AtmosObject, org.jclouds.atmos.options.PutOptions...)

Since there is no etag support in atmos, we just return the path.

 String putBlob(String container, Blob blob, PutOptions options)
          This implementation invokes AtmosClient.createFile(java.lang.String, org.jclouds.atmos.domain.AtmosObject, org.jclouds.atmos.options.PutOptions...)

Since there is no etag support in atmos, we just return the path.

 void removeBlob(String container, String key)
          This implementation invokes AtmosClient.deletePath(java.lang.String)
 
Methods inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobBuilder, clearAndDeleteContainer, clearContainer, clearContainer, countBlobs, countBlobs, deleteContainer, getBlob, getContext, list, listAssignableLocations, newBlob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

blobMetadata

public BlobMetadata blobMetadata(String container,
                                 String key)
This implementation invokes AtmosClient.headFile(java.lang.String)

Parameters:
container - container where this exists.
key - fully qualified name relative to the container.
Returns:
null if name isn't present or the blob you intended to receive.

deleteAndVerifyContainerGone

protected boolean deleteAndVerifyContainerGone(String container)
This implementation invokes AtmosAsyncClient.deletePath(java.lang.String) followed by AtmosAsyncClient.pathExists(java.lang.String) until it is true.

Specified by:
deleteAndVerifyContainerGone in class BaseBlobStore

createContainerInLocation

public boolean createContainerInLocation(Location location,
                                         String container)
This implementation invokes AtmosClient.createDirectory(java.lang.String, org.jclouds.atmos.options.PutOptions...)

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

createDirectory

public void createDirectory(String container,
                            String directory)
This implementation invokes AtmosClient.createDirectory(java.lang.String, org.jclouds.atmos.options.PutOptions...)

Specified by:
createDirectory in interface BlobStore
Overrides:
createDirectory in class BaseBlobStore
Parameters:
container - directory name
directory - virtual path

deleteDirectory

public void deleteDirectory(String containerName,
                            String directory)
This implementation invokes removeBlob(java.lang.String, java.lang.String)

Specified by:
deleteDirectory in interface BlobStore
Overrides:
deleteDirectory in class BaseBlobStore

containerExists

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


directoryExists

public boolean directoryExists(String container,
                               String directory)
This implementation invokes AtmosClient.pathExists(java.lang.String)

Specified by:
directoryExists in interface BlobStore
Overrides:
directoryExists in class BaseBlobStore
Parameters:
container - container where the directory resides
directory - virtual path

blobExists

public boolean blobExists(String container,
                          String key)
This implementation invokes AtmosClient.pathExists(java.lang.String)

Parameters:
container - container
key - file name

getBlob

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

Parameters:
container - container where this exists.
key - fully qualified name relative to the container.
options - byte range or condition options
Returns:
the blob you intended to receive or null, if it doesn't exist.

list

public PageSet<? extends StorageMetadata> list()
This implementation invokes AtmosClient.listDirectories(org.jclouds.atmos.options.ListOptions...)


list

public PageSet<? extends StorageMetadata> list(String container,
                                               ListContainerOptions options)
This implementation invokes AtmosClient.listDirectory(java.lang.String, org.jclouds.atmos.options.ListOptions...)

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

putBlob

public String putBlob(String container,
                      Blob blob)
This implementation invokes AtmosClient.createFile(java.lang.String, org.jclouds.atmos.domain.AtmosObject, org.jclouds.atmos.options.PutOptions...)

Since there is no etag support in atmos, we just return the path.

Parameters:
container - container to place the blob.
blob - fully qualified name relative to the container.
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 AtmosClient.createFile(java.lang.String, org.jclouds.atmos.domain.AtmosObject, org.jclouds.atmos.options.PutOptions...)

Since there is no etag support in atmos, we just return the path.

Parameters:
container - container to place the blob.
blob - fully qualified name relative to the container.
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 AtmosClient.deletePath(java.lang.String)

Parameters:
container - container where this exists.
key - fully qualified name relative to the container.

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.