web/lib/Zend/Cloud/StorageService/Adapter.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    11  * to license@zend.com so we can send you a copy immediately.
    11  * to license@zend.com so we can send you a copy immediately.
    12  *
    12  *
    13  * @category   Zend
    13  * @category   Zend
    14  * @package    Zend_Cloud
    14  * @package    Zend_Cloud
    15  * @subpackage StorageService
    15  * @subpackage StorageService
    16  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    16  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    17  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    18  */
    18  */
    19 
    19 
    20 /**
    20 /**
    21  * Common interface for unstructured cloud storage.
    21  * Common interface for unstructured cloud storage.
    22  *
    22  *
    23  * @category   Zend
    23  * @category   Zend
    24  * @package    Zend_Cloud
    24  * @package    Zend_Cloud
    25  * @subpackage StorageService
    25  * @subpackage StorageService
    26  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    26  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    27  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    27  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    28  */
    28  */
    29 interface Zend_Cloud_StorageService_Adapter
    29 interface Zend_Cloud_StorageService_Adapter
    30 {
    30 {
    31     // HTTP adapter to use for connections
    31     // HTTP adapter to use for connections
    37      * @param  string $path
    37      * @param  string $path
    38      * @param  array $options
    38      * @param  array $options
    39      * @return mixed
    39      * @return mixed
    40      */
    40      */
    41     public function fetchItem($path, $options = null);
    41     public function fetchItem($path, $options = null);
    42     
    42 
    43     /**
    43     /**
    44      * Store an item in the storage service.
    44      * Store an item in the storage service.
    45      * WARNING: This operation overwrites any item that is located at 
    45      * WARNING: This operation overwrites any item that is located at
    46      * $destinationPath.
    46      * $destinationPath.
    47      * @param string $destinationPath
    47      * @param string $destinationPath
    48      * @param mixed  $data
    48      * @param mixed  $data
    49      * @param  array $options
    49      * @param  array $options
    50      * @return boolean
    50      * @return boolean
    51      */
    51      */
    52     public function storeItem($destinationPath,
    52     public function storeItem($destinationPath,
    53                               $data,
    53                               $data,
    54                               $options = null);
    54                               $options = null);
    55     
    55 
    56     /**
    56     /**
    57      * Delete an item in the storage service.
    57      * Delete an item in the storage service.
    58      *
    58      *
    59      * @param  string $path
    59      * @param  string $path
    60      * @param  array $options
    60      * @param  array $options
    61      * @return void
    61      * @return void
    62      */
    62      */
    63     public function deleteItem($path, $options = null);
    63     public function deleteItem($path, $options = null);
    64     
    64 
    65     /**
    65     /**
    66      * Copy an item in the storage service to a given path.
    66      * Copy an item in the storage service to a given path.
    67      * 
    67      *
    68      * The $destinationPath must be a directory.
    68      * The $destinationPath must be a directory.
    69      *
    69      *
    70      * @param  string $sourcePath
    70      * @param  string $sourcePath
    71      * @param  string $destination path
    71      * @param  string $destination path
    72      * @param  array $options
    72      * @param  array $options
    73      * @return void
    73      * @return void
    74      */
    74      */
    75     public function copyItem($sourcePath, $destinationPath, $options = null);
    75     public function copyItem($sourcePath, $destinationPath, $options = null);
    76     
    76 
    77     /**
    77     /**
    78      * Move an item in the storage service to a given path.
    78      * Move an item in the storage service to a given path.
    79      * 
    79      *
    80      * The $destinationPath must be a directory.
    80      * The $destinationPath must be a directory.
    81      *
    81      *
    82      * @param  string $sourcePath
    82      * @param  string $sourcePath
    83      * @param  string $destination path
    83      * @param  string $destination path
    84      * @param  array $options
    84      * @param  array $options
    85      * @return void
    85      * @return void
    86      */
    86      */
    87     public function moveItem($sourcePath, $destinationPath, $options = null);
    87     public function moveItem($sourcePath, $destinationPath, $options = null);
    88     
    88 
    89     /**
    89     /**
    90      * Rename an item in the storage service to a given name.
    90      * Rename an item in the storage service to a given name.
    91      *
    91      *
    92      *
    92      *
    93      * @param  string $path
    93      * @param  string $path
    94      * @param  string $name
    94      * @param  string $name
    95      * @param  array $options
    95      * @param  array $options
    96      * @return void
    96      * @return void
    97      */
    97      */
    98     public function renameItem($path, $name, $options = null);
    98     public function renameItem($path, $name, $options = null);
    99     
    99 
   100     /**
   100     /**
   101      * List items in the given directory in the storage service
   101      * List items in the given directory in the storage service
   102      * 
   102      *
   103      * The $path must be a directory
   103      * The $path must be a directory
   104      *
   104      *
   105      *
   105      *
   106      * @param  string $path Must be a directory
   106      * @param  string $path Must be a directory
   107      * @param  array $options
   107      * @param  array $options
   108      * @return array A list of item names
   108      * @return array A list of item names
   109      */
   109      */
   110     public function listItems($path, $options = null);
   110     public function listItems($path, $options = null);
   111     
   111 
   112     /**
   112     /**
   113      * Get a key/value array of metadata for the given path.
   113      * Get a key/value array of metadata for the given path.
   114      *
   114      *
   115      * @param  string $path
   115      * @param  string $path
   116      * @param  array $options
   116      * @param  array $options
   117      * @return array
   117      * @return array
   118      */
   118      */
   119     public function fetchMetadata($path, $options = null);
   119     public function fetchMetadata($path, $options = null);
   120     
   120 
   121     /**
   121     /**
   122      * Store a key/value array of metadata at the given path.
   122      * Store a key/value array of metadata at the given path.
   123      * WARNING: This operation overwrites any metadata that is located at 
   123      * WARNING: This operation overwrites any metadata that is located at
   124      * $destinationPath.
   124      * $destinationPath.
   125      *
   125      *
   126      * @param  string $destinationPath
   126      * @param  string $destinationPath
   127      * @param  array $options
   127      * @param  array $options
   128      * @return void
   128      * @return void
   129      */
   129      */
   130     public function storeMetadata($destinationPath, $metadata, $options = null);
   130     public function storeMetadata($destinationPath, $metadata, $options = null);
   131     
   131 
   132     /**
   132     /**
   133      * Delete a key/value array of metadata at the given path.
   133      * Delete a key/value array of metadata at the given path.
   134      *
   134      *
   135      * @param  string $path
   135      * @param  string $path
   136      * @param  array $options
   136      * @param  array $options