simplecloud.storage.interfaces
Interface IStorageAdapter

All Known Implementing Classes:
NirvanixAdapter, S3Adapter, StorageAdapter

public interface IStorageAdapter

Common interface to all Storage providers.


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.
 

Method Detail

fetchItem

IItem fetchItem(java.lang.String path,
                java.util.Map<java.lang.Object,java.lang.Object> options)
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

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.

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

void deleteItem(java.lang.String path,
                java.util.Map<java.lang.Object,java.lang.Object> options)
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

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.

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

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.

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

void renameItem(java.lang.String path,
                java.lang.String name,
                java.util.Map<java.lang.Object,java.lang.Object> options)
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

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.

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

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.

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

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.

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

void deleteMetadata(java.lang.String path,
                    java.util.Map<java.lang.Object,java.lang.Object> options)
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