PageRenderTime 50ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/w3-total-cache/lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobOptions.php

https://bitbucket.org/vaderdeveloper/autovidas
PHP | 520 lines | 173 code | 55 blank | 292 comment | 0 complexity | 300e37076d1221fc1250bfa2620a4a9c MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, Apache-2.0, BSD-3-Clause, MIT
  1. <?php
  2. /**
  3. * LICENSE: The MIT License (the "License")
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. * https://github.com/azure/azure-storage-php/LICENSE
  7. *
  8. * Unless required by applicable law or agreed to in writing, software
  9. * distributed under the License is distributed on an "AS IS" BASIS,
  10. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. * See the License for the specific language governing permissions and
  12. * limitations under the License.
  13. *
  14. * PHP version 5
  15. *
  16. * @category Microsoft
  17. * @package MicrosoftAzure\Storage\Blob\Models
  18. * @author Azure Storage PHP SDK <dmsh@microsoft.com>
  19. * @copyright 2016 Microsoft Corporation
  20. * @license https://github.com/azure/azure-storage-php/LICENSE
  21. * @link https://github.com/azure/azure-storage-php
  22. */
  23. namespace MicrosoftAzure\Storage\Blob\Models;
  24. use MicrosoftAzure\Storage\Common\Internal\Validate;
  25. use MicrosoftAzure\Storage\Blob\Models\CreateBlobBlockOptions;
  26. /**
  27. * optional parameters for createXXXBlob wrapper
  28. *
  29. * @category Microsoft
  30. * @package MicrosoftAzure\Storage\Blob\Models
  31. * @author Azure Storage PHP SDK <dmsh@microsoft.com>
  32. * @copyright 2016 Microsoft Corporation
  33. * @license https://github.com/azure/azure-storage-php/LICENSE
  34. * @version Release: 0.11.0
  35. * @link https://github.com/azure/azure-storage-php
  36. */
  37. class CreateBlobOptions extends BlobServiceOptions
  38. {
  39. /**
  40. * @var string
  41. */
  42. private $_contentType;
  43. /**
  44. * @var string
  45. */
  46. private $_contentEncoding;
  47. /**
  48. * @var string
  49. */
  50. private $_contentLanguage;
  51. /**
  52. * @var string
  53. */
  54. private $_contentMD5;
  55. /**
  56. * @var string
  57. */
  58. private $_cacheControl;
  59. /**
  60. * @var string
  61. */
  62. private $_blobContentType;
  63. /**
  64. * @var string
  65. */
  66. private $_blobContentEncoding;
  67. /**
  68. * @var string
  69. */
  70. private $_blobContentLanguage;
  71. /**
  72. * @var integer
  73. */
  74. private $_blobContentLength;
  75. /**
  76. * @var string
  77. */
  78. private $_blobContentMD5;
  79. /**
  80. * @var string
  81. */
  82. private $_blobCacheControl;
  83. /**
  84. * @var array
  85. */
  86. private $_metadata;
  87. /**
  88. * @var string
  89. */
  90. private $_leaseId;
  91. /**
  92. * @var integer
  93. */
  94. private $_sequenceNumber;
  95. /**
  96. * @var string
  97. */
  98. private $_sequenceNumberAction;
  99. /**
  100. * @var AccessCondition
  101. */
  102. private $_accessCondition;
  103. /**
  104. * @var int
  105. */
  106. private $_numberOfConcurrency;
  107. /**
  108. * Gets blob ContentType.
  109. *
  110. * @return string.
  111. */
  112. public function getBlobContentType()
  113. {
  114. return $this->_blobContentType;
  115. }
  116. /**
  117. * Sets blob ContentType.
  118. *
  119. * @param string $blobContentType value.
  120. *
  121. * @return none.
  122. */
  123. public function setBlobContentType($blobContentType)
  124. {
  125. $this->_blobContentType = $blobContentType;
  126. }
  127. /**
  128. * Gets blob ContentEncoding.
  129. *
  130. * @return string.
  131. */
  132. public function getBlobContentEncoding()
  133. {
  134. return $this->_blobContentEncoding;
  135. }
  136. /**
  137. * Sets blob ContentEncoding.
  138. *
  139. * @param string $blobContentEncoding value.
  140. *
  141. * @return none.
  142. */
  143. public function setBlobContentEncoding($blobContentEncoding)
  144. {
  145. $this->_blobContentEncoding = $blobContentEncoding;
  146. }
  147. /**
  148. * Gets blob ContentLanguage.
  149. *
  150. * @return string.
  151. */
  152. public function getBlobContentLanguage()
  153. {
  154. return $this->_blobContentLanguage;
  155. }
  156. /**
  157. * Sets blob ContentLanguage.
  158. *
  159. * @param string $blobContentLanguage value.
  160. *
  161. * @return none.
  162. */
  163. public function setBlobContentLanguage($blobContentLanguage)
  164. {
  165. $this->_blobContentLanguage = $blobContentLanguage;
  166. }
  167. /**
  168. * Gets blob ContentLength.
  169. *
  170. * @return integer.
  171. */
  172. public function getBlobContentLength()
  173. {
  174. return $this->_blobContentLength;
  175. }
  176. /**
  177. * Sets blob ContentLength.
  178. *
  179. * @param integer $blobContentLength value.
  180. *
  181. * @return none.
  182. */
  183. public function setBlobContentLength($blobContentLength)
  184. {
  185. Validate::isInteger($blobContentLength, 'blobContentLength');
  186. $this->_blobContentLength = $blobContentLength;
  187. }
  188. /**
  189. * Gets blob ContentMD5.
  190. *
  191. * @return string.
  192. */
  193. public function getBlobContentMD5()
  194. {
  195. return $this->_blobContentMD5;
  196. }
  197. /**
  198. * Sets blob ContentMD5.
  199. *
  200. * @param string $blobContentMD5 value.
  201. *
  202. * @return none.
  203. */
  204. public function setBlobContentMD5($blobContentMD5)
  205. {
  206. $this->_blobContentMD5 = $blobContentMD5;
  207. }
  208. /**
  209. * Gets blob cache control.
  210. *
  211. * @return string.
  212. */
  213. public function getBlobCacheControl()
  214. {
  215. return $this->_blobCacheControl;
  216. }
  217. /**
  218. * Sets blob cacheControl.
  219. *
  220. * @param string $blobCacheControl value to use.
  221. *
  222. * @return none.
  223. */
  224. public function setBlobCacheControl($blobCacheControl)
  225. {
  226. $this->_blobCacheControl = $blobCacheControl;
  227. }
  228. /**
  229. * Gets blob contentType.
  230. *
  231. * @return string.
  232. */
  233. public function getContentType()
  234. {
  235. return $this->_contentType;
  236. }
  237. /**
  238. * Sets blob contentType.
  239. *
  240. * @param string $contentType value.
  241. *
  242. * @return none.
  243. */
  244. public function setContentType($contentType)
  245. {
  246. $this->_contentType = $contentType;
  247. }
  248. /**
  249. * Gets contentEncoding.
  250. *
  251. * @return string.
  252. */
  253. public function getContentEncoding()
  254. {
  255. return $this->_contentEncoding;
  256. }
  257. /**
  258. * Sets contentEncoding.
  259. *
  260. * @param string $contentEncoding value.
  261. *
  262. * @return none.
  263. */
  264. public function setContentEncoding($contentEncoding)
  265. {
  266. $this->_contentEncoding = $contentEncoding;
  267. }
  268. /**
  269. * Gets contentLanguage.
  270. *
  271. * @return string.
  272. */
  273. public function getContentLanguage()
  274. {
  275. return $this->_contentLanguage;
  276. }
  277. /**
  278. * Sets contentLanguage.
  279. *
  280. * @param string $contentLanguage value.
  281. *
  282. * @return none.
  283. */
  284. public function setContentLanguage($contentLanguage)
  285. {
  286. $this->_contentLanguage = $contentLanguage;
  287. }
  288. /**
  289. * Gets contentMD5.
  290. *
  291. * @return string.
  292. */
  293. public function getContentMD5()
  294. {
  295. return $this->_contentMD5;
  296. }
  297. /**
  298. * Sets contentMD5.
  299. *
  300. * @param string $contentMD5 value.
  301. *
  302. * @return none.
  303. */
  304. public function setContentMD5($contentMD5)
  305. {
  306. $this->_contentMD5 = $contentMD5;
  307. }
  308. /**
  309. * Gets cacheControl.
  310. *
  311. * @return string.
  312. */
  313. public function getCacheControl()
  314. {
  315. return $this->_cacheControl;
  316. }
  317. /**
  318. * Sets cacheControl.
  319. *
  320. * @param string $cacheControl value to use.
  321. *
  322. * @return none.
  323. */
  324. public function setCacheControl($cacheControl)
  325. {
  326. $this->_cacheControl = $cacheControl;
  327. }
  328. /**
  329. * Gets access condition
  330. *
  331. * @return AccessCondition
  332. */
  333. public function getAccessCondition()
  334. {
  335. return $this->_accessCondition;
  336. }
  337. /**
  338. * Sets access condition
  339. *
  340. * @param AccessCondition $accessCondition value to use.
  341. *
  342. * @return none.
  343. */
  344. public function setAccessCondition($accessCondition)
  345. {
  346. $this->_accessCondition = $accessCondition;
  347. }
  348. /**
  349. * Gets blob metadata.
  350. *
  351. * @return array.
  352. */
  353. public function getMetadata()
  354. {
  355. return $this->_metadata;
  356. }
  357. /**
  358. * Sets blob metadata.
  359. *
  360. * @param array $metadata value.
  361. *
  362. * @return none.
  363. */
  364. public function setMetadata($metadata)
  365. {
  366. $this->_metadata = $metadata;
  367. }
  368. /**
  369. * Gets blob sequenceNumber.
  370. *
  371. * @return int.
  372. */
  373. public function getSequenceNumber()
  374. {
  375. return $this->_sequenceNumber;
  376. }
  377. /**
  378. * Sets blob sequenceNumber.
  379. *
  380. * @param int $sequenceNumber value.
  381. *
  382. * @return none.
  383. */
  384. public function setSequenceNumber($sequenceNumber)
  385. {
  386. Validate::isInteger($sequenceNumber, 'sequenceNumber');
  387. $this->_sequenceNumber = $sequenceNumber;
  388. }
  389. /**
  390. * Gets blob sequenceNumberAction.
  391. *
  392. * @return string.
  393. */
  394. public function getSequenceNumberAction()
  395. {
  396. return $this->_sequenceNumberAction;
  397. }
  398. /**
  399. * Sets blob sequenceNumberAction.
  400. *
  401. * @param string $sequenceNumberAction value.
  402. *
  403. * @return none.
  404. */
  405. public function setSequenceNumberAction($sequenceNumberAction)
  406. {
  407. $this->_sequenceNumberAction = $sequenceNumberAction;
  408. }
  409. /**
  410. * Gets lease Id for the blob
  411. *
  412. * @return string
  413. */
  414. public function getLeaseId()
  415. {
  416. return $this->_leaseId;
  417. }
  418. /**
  419. * Sets lease Id for the blob
  420. *
  421. * @param string $leaseId the blob lease id.
  422. *
  423. * @return none
  424. */
  425. public function setLeaseId($leaseId)
  426. {
  427. $this->_leaseId = $leaseId;
  428. }
  429. /**
  430. * Gets number of concurrency for sending a blob.
  431. *
  432. * @return int
  433. */
  434. public function getNumberOfConcurrency()
  435. {
  436. return $this->_numberOfConcurrency;
  437. }
  438. /**
  439. * Sets number of concurrency for sending a blob.
  440. *
  441. * @param int $numberOfConcurrency the number of concurrent requests.
  442. */
  443. public function setNumberOfConcurrency($numberOfConcurrency)
  444. {
  445. $this->_numberOfConcurrency = $numberOfConcurrency;
  446. }
  447. /**
  448. * Construct a CreateBlobOptions object from a createBlockBlobOptions.
  449. *
  450. * @param CreateBlobBlockOptions $createBlobBlockOptions
  451. *
  452. * @return CreateBlobOptions
  453. */
  454. public static function create($createBlobBlockOptions)
  455. {
  456. $result = new CreateBlobOptions();
  457. $result->setTimeout($createBlobBlockOptions->getTimeout());
  458. $result->setContentMD5($createBlobBlockOptions->getContentMD5());
  459. $result->setLeaseId($createBlobBlockOptions->getLeaseId());
  460. $result->setNumberOfConcurrency(
  461. $createBlobBlockOptions->getNumberOfConcurrency()
  462. );
  463. return $result;
  464. }
  465. }