TransferStateInterface.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. /**
  3. * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License").
  6. * You may not use this file except in compliance with the License.
  7. * A copy of the License is located at
  8. *
  9. * http://aws.amazon.com/apache2.0
  10. *
  11. * or in the "license" file accompanying this file. This file is distributed
  12. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  13. * express or implied. See the License for the specific language governing
  14. * permissions and limitations under the License.
  15. */
  16. namespace Aws\Common\Model\MultipartUpload;
  17. use Aws\Common\Client\AwsClientInterface;
  18. /**
  19. * State of a multipart upload
  20. */
  21. interface TransferStateInterface extends \Countable, \IteratorAggregate, \Serializable
  22. {
  23. /**
  24. * Create the transfer state from the results of list parts request
  25. *
  26. * @param AwsClientInterface $client Client used to send the request
  27. * @param UploadIdInterface $uploadId Params needed to identify the upload and form the request
  28. *
  29. * @return self
  30. */
  31. public static function fromUploadId(AwsClientInterface $client, UploadIdInterface $uploadId);
  32. /**
  33. * Get the params used to identify an upload part
  34. *
  35. * @return UploadIdInterface
  36. */
  37. public function getUploadId();
  38. /**
  39. * Get the part information of a specific part
  40. *
  41. * @param int $partNumber Part to retrieve
  42. *
  43. * @return UploadPartInterface
  44. */
  45. public function getPart($partNumber);
  46. /**
  47. * Add a part to the transfer state
  48. *
  49. * @param UploadPartInterface $part The part to add
  50. *
  51. * @return self
  52. */
  53. public function addPart(UploadPartInterface $part);
  54. /**
  55. * Check if a specific part has been uploaded
  56. *
  57. * @param int $partNumber Part to check
  58. *
  59. * @return bool
  60. */
  61. public function hasPart($partNumber);
  62. /**
  63. * Get a list of all of the uploaded part numbers
  64. *
  65. * @return array
  66. */
  67. public function getPartNumbers();
  68. /**
  69. * Set whether or not the transfer has been aborted
  70. *
  71. * @param bool $aborted Set to true to mark the transfer as aborted
  72. *
  73. * @return self
  74. */
  75. public function setAborted($aborted);
  76. /**
  77. * Check if the transfer has been marked as aborted
  78. *
  79. * @return bool
  80. */
  81. public function isAborted();
  82. }