web/lib/Zend/Cloud/StorageService/Adapter.php
changeset 64 162c1de6545a
parent 19 1c2f13fd785c
child 68 ecaf28ffe26e
equal deleted inserted replaced
63:5b37998e522e 64:162c1de6545a
       
     1 <?php
       
     2 /**
       
     3  * LICENSE
       
     4  *
       
     5  * This source file is subject to the new BSD license that is bundled
       
     6  * with this package in the file LICENSE.txt.
       
     7  * It is also available through the world-wide-web at this URL:
       
     8  * http://framework.zend.com/license/new-bsd
       
     9  * If you did not receive a copy of the license and are unable to
       
    10  * obtain it through the world-wide-web, please send an email
       
    11  * to license@zend.com so we can send you a copy immediately.
       
    12  *
       
    13  * @category   Zend
       
    14  * @package    Zend_Cloud
       
    15  * @subpackage StorageService
       
    16  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    17  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    18  */
       
    19 
       
    20 /**
       
    21  * Common interface for unstructured cloud storage.
       
    22  *
       
    23  * @category   Zend
       
    24  * @package    Zend_Cloud
       
    25  * @subpackage StorageService
       
    26  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    27  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    28  */
       
    29 interface Zend_Cloud_StorageService_Adapter
       
    30 {
       
    31     // HTTP adapter to use for connections
       
    32     const HTTP_ADAPTER = 'http_adapter';
       
    33 
       
    34     /**
       
    35      * Get an item from the storage service.
       
    36      *
       
    37      * @param  string $path
       
    38      * @param  array $options
       
    39      * @return mixed
       
    40      */
       
    41     public function fetchItem($path, $options = null);
       
    42     
       
    43     /**
       
    44      * Store an item in the storage service.
       
    45      * WARNING: This operation overwrites any item that is located at 
       
    46      * $destinationPath.
       
    47      * @param string $destinationPath
       
    48      * @param mixed  $data
       
    49      * @param  array $options
       
    50      * @return boolean
       
    51      */
       
    52     public function storeItem($destinationPath,
       
    53                               $data,
       
    54                               $options = null);
       
    55     
       
    56     /**
       
    57      * Delete an item in the storage service.
       
    58      *
       
    59      * @param  string $path
       
    60      * @param  array $options
       
    61      * @return void
       
    62      */
       
    63     public function deleteItem($path, $options = null);
       
    64     
       
    65     /**
       
    66      * Copy an item in the storage service to a given path.
       
    67      * 
       
    68      * The $destinationPath must be a directory.
       
    69      *
       
    70      * @param  string $sourcePath
       
    71      * @param  string $destination path
       
    72      * @param  array $options
       
    73      * @return void
       
    74      */
       
    75     public function copyItem($sourcePath, $destinationPath, $options = null);
       
    76     
       
    77     /**
       
    78      * Move an item in the storage service to a given path.
       
    79      * 
       
    80      * The $destinationPath must be a directory.
       
    81      *
       
    82      * @param  string $sourcePath
       
    83      * @param  string $destination path
       
    84      * @param  array $options
       
    85      * @return void
       
    86      */
       
    87     public function moveItem($sourcePath, $destinationPath, $options = null);
       
    88     
       
    89     /**
       
    90      * Rename an item in the storage service to a given name.
       
    91      *
       
    92      *
       
    93      * @param  string $path
       
    94      * @param  string $name
       
    95      * @param  array $options
       
    96      * @return void
       
    97      */
       
    98     public function renameItem($path, $name, $options = null);
       
    99     
       
   100     /**
       
   101      * List items in the given directory in the storage service
       
   102      * 
       
   103      * The $path must be a directory
       
   104      *
       
   105      *
       
   106      * @param  string $path Must be a directory
       
   107      * @param  array $options
       
   108      * @return array A list of item names
       
   109      */
       
   110     public function listItems($path, $options = null);
       
   111     
       
   112     /**
       
   113      * Get a key/value array of metadata for the given path.
       
   114      *
       
   115      * @param  string $path
       
   116      * @param  array $options
       
   117      * @return array
       
   118      */
       
   119     public function fetchMetadata($path, $options = null);
       
   120     
       
   121     /**
       
   122      * Store a key/value array of metadata at the given path.
       
   123      * WARNING: This operation overwrites any metadata that is located at 
       
   124      * $destinationPath.
       
   125      *
       
   126      * @param  string $destinationPath
       
   127      * @param  array $options
       
   128      * @return void
       
   129      */
       
   130     public function storeMetadata($destinationPath, $metadata, $options = null);
       
   131     
       
   132     /**
       
   133      * Delete a key/value array of metadata at the given path.
       
   134      *
       
   135      * @param  string $path
       
   136      * @param  array $options
       
   137      * @return void
       
   138      */
       
   139     public function deleteMetadata($path);
       
   140 
       
   141     /**
       
   142      * Get the concrete client.
       
   143      */
       
   144     public function getClient();
       
   145 }