simplecloud.storage.providers.amazon
Class S3Adapter

java.lang.Object
  extended by base.Driver
      extended by simplecloud.storage.StorageAdapter
          extended by simplecloud.storage.providers.amazon.S3Adapter
All Implemented Interfaces:
IStorageAdapter

public class S3Adapter
extends StorageAdapter


Nested Class Summary
static class S3Adapter.Type
           
 
Field Summary
 
Fields inherited from class base.Driver
connection
 
Constructor Summary
S3Adapter(java.lang.String accessId, java.lang.String accessKey, java.lang.String host)
           
 
Method Summary
 void copyItem(java.lang.String sourcePath, java.lang.String destinationPath, java.util.Map<java.lang.Object,java.lang.Object> options)
          Copies an item from one location to another location.
 void deleteItem(java.lang.String path, java.util.Map<java.lang.Object,java.lang.Object> options)
          Deletes an item from the storage provider.
 void deleteMetadata(java.lang.String path, java.util.Map<java.lang.Object,java.lang.Object> options)
          Deletes metadata associated with an item.
 IItem fetchItem(java.lang.String path, java.util.Map<java.lang.Object,java.lang.Object> options)
          Fetches an item from the storage provider.
 java.util.Map<java.lang.String,java.lang.String> fetchMetadata(java.lang.String path, java.util.Map<java.lang.Object,java.lang.Object> options)
          Fetches the metadata of an item.
 java.util.List<java.lang.String> listItems(java.lang.String path, java.util.Map<java.lang.Object,java.lang.Object> options)
          Lists the items at the given path.
 void moveItem(java.lang.String sourcePath, java.lang.String destinationPath, java.util.Map<java.lang.Object,java.lang.Object> options)
          Moves an item from one location to another location.
 void renameItem(java.lang.String path, java.lang.String name, java.util.Map<java.lang.Object,java.lang.Object> options)
          Renames an item.
 boolean storeItem(java.lang.String destinationPath, IItem item, java.util.Map<java.lang.String,java.lang.String> metadata, java.util.Map<java.lang.Object,java.lang.Object> options)
          Stores an item with the storage provider.
 void storeMetadata(java.lang.String destinationPath, java.util.Map<java.lang.String,java.lang.String> metadata, java.util.Map<java.lang.Object,java.lang.Object> options)
          Stores metadata for an item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

S3Adapter

public S3Adapter(java.lang.String accessId,
                 java.lang.String accessKey,
                 java.lang.String host)
Method Detail

fetchItem

public IItem fetchItem(java.lang.String path,
                       java.util.Map<java.lang.Object,java.lang.Object> options)
Description copied from interface: IStorageAdapter
Fetches an item from the storage provider.

Parameters:
path - is the path to the item to fetch
options - are provider-specific options for fetching the item
Returns:
IItem is the item fetched from the server

storeItem

public boolean storeItem(java.lang.String destinationPath,
                         IItem item,
                         java.util.Map<java.lang.String,java.lang.String> metadata,
                         java.util.Map<java.lang.Object,java.lang.Object> options)
Description copied from interface: IStorageAdapter
Stores an item with the storage provider.

Parameters:
destinationPath - is the path to store the item at
item - is the content to store on the provider
metadata - is metadata to associate with the item
options - are provider-specific options for storing the item
Returns:
true if the item was stored successfully, false otherwise

deleteItem

public void deleteItem(java.lang.String path,
                       java.util.Map<java.lang.Object,java.lang.Object> options)
Description copied from interface: IStorageAdapter
Deletes an item from the storage provider.

Parameters:
path - is the path to the item to delete
options - are provider-specific options for deleting the item

copyItem

public void copyItem(java.lang.String sourcePath,
                     java.lang.String destinationPath,
                     java.util.Map<java.lang.Object,java.lang.Object> options)
Description copied from interface: IStorageAdapter
Copies an item from one location to another location.

Parameters:
sourcePath - is the path to the item to copy
destinationPath - is the destination path for the item's copy
options - are provider-specific options for copying the item

moveItem

public void moveItem(java.lang.String sourcePath,
                     java.lang.String destinationPath,
                     java.util.Map<java.lang.Object,java.lang.Object> options)
Description copied from interface: IStorageAdapter
Moves an item from one location to another location.

Parameters:
sourcePath - is the path to the item to move
destinationPath - is the item's new destination
options - are provider specific-options for moving the item

renameItem

public void renameItem(java.lang.String path,
                       java.lang.String name,
                       java.util.Map<java.lang.Object,java.lang.Object> options)
Description copied from interface: IStorageAdapter
Renames an item.

Parameters:
path - is the path to the item to rename
name - is the new name of the item
options - are provider-specific options for renaming the item

listItems

public java.util.List<java.lang.String> listItems(java.lang.String path,
                                                  java.util.Map<java.lang.Object,java.lang.Object> options)
Description copied from interface: IStorageAdapter
Lists the items at the given path.

Parameters:
path - identifies the directory to list the contents of
options - are provider-specific options for listing the contents
Returns:
List is a list of the items at the given path

fetchMetadata

public java.util.Map<java.lang.String,java.lang.String> fetchMetadata(java.lang.String path,
                                                                      java.util.Map<java.lang.Object,java.lang.Object> options)
Description copied from interface: IStorageAdapter
Fetches the metadata of an item.

Parameters:
path - identifies the item to fetch the metadata for
options - are provider-specific options for fetching the metadata
Returns:
Map are key/value pairs composing the item's metadata

storeMetadata

public void storeMetadata(java.lang.String destinationPath,
                          java.util.Map<java.lang.String,java.lang.String> metadata,
                          java.util.Map<java.lang.Object,java.lang.Object> options)
Description copied from interface: IStorageAdapter
Stores metadata for an item.

Parameters:
destinationPath - identifies the item to associate with the metadata
metadata - are the key/value pairs composing the item's metadata
options - are provider-specific options for storing the metadata

deleteMetadata

public void deleteMetadata(java.lang.String path,
                           java.util.Map<java.lang.Object,java.lang.Object> options)
Description copied from interface: IStorageAdapter
Deletes metadata associated with an item.

Parameters:
path - identifies the item to delete the metadata from
options - are provider-specific options for deleting the metadata