13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Service_WindowsAzure |
16 * @package Zend_Service_WindowsAzure |
17 * @subpackage Storage |
17 * @subpackage Storage |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: BatchStorageAbstract.php 23167 2010-10-19 17:53:31Z mabe $ |
20 * @version $Id: BatchStorageAbstract.php 24593 2012-01-05 20:35:02Z matthew $ |
21 */ |
21 */ |
22 |
22 |
23 /** |
23 /** |
24 * @see Zend_Service_WindowsAzure_Storage |
24 * @see Zend_Service_WindowsAzure_Storage |
25 */ |
25 */ |
26 require_once 'Zend/Service/WindowsAzure/Storage.php'; |
26 require_once 'Zend/Service/WindowsAzure/Storage.php'; |
27 |
27 |
28 /** |
28 /** |
29 * @see Zend_Service_WindowsAzure_Credentials_CredentialsAbstract |
|
30 */ |
|
31 require_once 'Zend/Service/WindowsAzure/Credentials/CredentialsAbstract.php'; |
|
32 |
|
33 /** |
|
34 * @see Zend_Service_WindowsAzure_Exception |
|
35 */ |
|
36 require_once 'Zend/Service/WindowsAzure/Exception.php'; |
|
37 |
|
38 /** |
|
39 * @see Zend_Service_WindowsAzure_Storage_Batch |
|
40 */ |
|
41 require_once 'Zend/Service/WindowsAzure/Storage/Batch.php'; |
|
42 |
|
43 /** |
|
44 * @see Zend_Http_Client |
|
45 */ |
|
46 require_once 'Zend/Http/Client.php'; |
|
47 |
|
48 /** |
|
49 * @see Zend_Http_Response |
|
50 */ |
|
51 require_once 'Zend/Http/Response.php'; |
|
52 |
|
53 /** |
|
54 * @category Zend |
29 * @category Zend |
55 * @package Zend_Service_WindowsAzure |
30 * @package Zend_Service_WindowsAzure |
56 * @subpackage Storage |
31 * @subpackage Storage |
57 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
32 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
58 * @license http://framework.zend.com/license/new-bsd New BSD License |
33 * @license http://framework.zend.com/license/new-bsd New BSD License |
59 */ |
34 */ |
60 abstract class Zend_Service_WindowsAzure_Storage_BatchStorageAbstract |
35 abstract class Zend_Service_WindowsAzure_Storage_BatchStorageAbstract |
61 extends Zend_Service_WindowsAzure_Storage |
36 extends Zend_Service_WindowsAzure_Storage |
62 { |
37 { |
73 * @param Zend_Service_WindowsAzure_Storage_Batch $batch Current batch |
48 * @param Zend_Service_WindowsAzure_Storage_Batch $batch Current batch |
74 * @throws Zend_Service_WindowsAzure_Exception |
49 * @throws Zend_Service_WindowsAzure_Exception |
75 */ |
50 */ |
76 public function setCurrentBatch(Zend_Service_WindowsAzure_Storage_Batch $batch = null) |
51 public function setCurrentBatch(Zend_Service_WindowsAzure_Storage_Batch $batch = null) |
77 { |
52 { |
78 if ($batch !== null && $this->isInBatch()) { |
53 if (!is_null($batch) && $this->isInBatch()) { |
|
54 require_once 'Zend/Service/WindowsAzure/Exception.php'; |
79 throw new Zend_Service_WindowsAzure_Exception('Only one batch can be active at a time.'); |
55 throw new Zend_Service_WindowsAzure_Exception('Only one batch can be active at a time.'); |
80 } |
56 } |
81 $this->_currentBatch = $batch; |
57 $this->_currentBatch = $batch; |
82 } |
58 } |
83 |
59 |
96 * |
72 * |
97 * @return boolean |
73 * @return boolean |
98 */ |
74 */ |
99 public function isInBatch() |
75 public function isInBatch() |
100 { |
76 { |
101 return $this->_currentBatch !== null; |
77 return !is_null($this->_currentBatch); |
102 } |
78 } |
103 |
79 |
104 /** |
80 /** |
105 * Starts a new batch operation set |
81 * Starts a new batch operation set |
106 * |
82 * |
107 * @return Zend_Service_WindowsAzure_Storage_Batch |
83 * @return Zend_Service_WindowsAzure_Storage_Batch |
108 * @throws Zend_Service_WindowsAzure_Exception |
84 * @throws Zend_Service_WindowsAzure_Exception |
109 */ |
85 */ |
110 public function startBatch() |
86 public function startBatch() |
111 { |
87 { |
|
88 require_once 'Zend/Service/WindowsAzure/Storage/Batch.php'; |
112 return new Zend_Service_WindowsAzure_Storage_Batch($this, $this->getBaseUrl()); |
89 return new Zend_Service_WindowsAzure_Storage_Batch($this, $this->getBaseUrl()); |
113 } |
90 } |
114 |
91 |
115 /** |
92 /** |
116 * Perform batch using Zend_Http_Client channel, combining all batch operations into one request |
93 * Perform batch using Zend_Http_Client channel, combining all batch operations into one request |