File indexing completed on 2025-01-26 05:24:52

0001 <?php
0002 /**
0003  * LICENSE
0004  *
0005  * This source file is subject to the new BSD license that is bundled
0006  * with this package in the file LICENSE.txt.
0007  * It is also available through the world-wide-web at this URL:
0008  * http://framework.zend.com/license/new-bsd
0009  * If you did not receive a copy of the license and are unable to
0010  * obtain it through the world-wide-web, please send an email
0011  * to license@zend.com so we can send you a copy immediately.
0012  *
0013  * @category   Zend
0014  * @package    Zend_Cloud
0015  * @subpackage StorageService
0016  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0017  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0018  */
0019 
0020 /**
0021  * Common interface for unstructured cloud storage.
0022  *
0023  * @category   Zend
0024  * @package    Zend_Cloud
0025  * @subpackage StorageService
0026  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0027  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0028  */
0029 interface Zend_Cloud_StorageService_Adapter
0030 {
0031     // HTTP adapter to use for connections
0032     const HTTP_ADAPTER = 'http_adapter';
0033 
0034     /**
0035      * Get an item from the storage service.
0036      *
0037      * @param  string $path
0038      * @param  array $options
0039      * @return mixed
0040      */
0041     public function fetchItem($path, $options = null);
0042 
0043     /**
0044      * Store an item in the storage service.
0045      * WARNING: This operation overwrites any item that is located at
0046      * $destinationPath.
0047      * @param string $destinationPath
0048      * @param mixed  $data
0049      * @param  array $options
0050      * @return boolean
0051      */
0052     public function storeItem($destinationPath,
0053                               $data,
0054                               $options = null);
0055 
0056     /**
0057      * Delete an item in the storage service.
0058      *
0059      * @param  string $path
0060      * @param  array $options
0061      * @return void
0062      */
0063     public function deleteItem($path, $options = null);
0064 
0065     /**
0066      * Copy an item in the storage service to a given path.
0067      *
0068      * The $destinationPath must be a directory.
0069      *
0070      * @param  string $sourcePath
0071      * @param  string $destination path
0072      * @param  array $options
0073      * @return void
0074      */
0075     public function copyItem($sourcePath, $destinationPath, $options = null);
0076 
0077     /**
0078      * Move an item in the storage service to a given path.
0079      *
0080      * The $destinationPath must be a directory.
0081      *
0082      * @param  string $sourcePath
0083      * @param  string $destination path
0084      * @param  array $options
0085      * @return void
0086      */
0087     public function moveItem($sourcePath, $destinationPath, $options = null);
0088 
0089     /**
0090      * Rename an item in the storage service to a given name.
0091      *
0092      *
0093      * @param  string $path
0094      * @param  string $name
0095      * @param  array $options
0096      * @return void
0097      */
0098     public function renameItem($path, $name, $options = null);
0099 
0100     /**
0101      * List items in the given directory in the storage service
0102      *
0103      * The $path must be a directory
0104      *
0105      *
0106      * @param  string $path Must be a directory
0107      * @param  array $options
0108      * @return array A list of item names
0109      */
0110     public function listItems($path, $options = null);
0111 
0112     /**
0113      * Get a key/value array of metadata for the given path.
0114      *
0115      * @param  string $path
0116      * @param  array $options
0117      * @return array
0118      */
0119     public function fetchMetadata($path, $options = null);
0120 
0121     /**
0122      * Store a key/value array of metadata at the given path.
0123      * WARNING: This operation overwrites any metadata that is located at
0124      * $destinationPath.
0125      *
0126      * @param  string $destinationPath
0127      * @param  array $options
0128      * @return void
0129      */
0130     public function storeMetadata($destinationPath, $metadata, $options = null);
0131 
0132     /**
0133      * Delete a key/value array of metadata at the given path.
0134      *
0135      * @param  string $path
0136      * @param  array $options
0137      * @return void
0138      */
0139     public function deleteMetadata($path);
0140 
0141     /**
0142      * Get the concrete client.
0143      */
0144     public function getClient();
0145 }