TransferInterface.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 Guzzle\Common\HasDispatcherInterface;
  18. use Guzzle\Service\Resource\Model;
  19. /**
  20. * Interface for transferring the contents of a data source to an AWS service via a multipart upload interface
  21. */
  22. interface TransferInterface extends HasDispatcherInterface
  23. {
  24. /**
  25. * Upload the source to using a multipart upload
  26. *
  27. * @return Model|null Result of the complete multipart upload command or null if uploading was stopped
  28. */
  29. public function upload();
  30. /**
  31. * Abort the upload
  32. *
  33. * @return Model Returns the result of the abort multipart upload command
  34. */
  35. public function abort();
  36. /**
  37. * Get the current state of the upload
  38. *
  39. * @return TransferStateInterface
  40. */
  41. public function getState();
  42. /**
  43. * Stop the transfer and retrieve the current state.
  44. *
  45. * This allows you to stop and later resume a long running transfer if needed.
  46. *
  47. * @return TransferStateInterface
  48. */
  49. public function stop();
  50. /**
  51. * Set an option on the transfer object
  52. *
  53. * @param string $option Option to set
  54. * @param mixed $value The value to set
  55. *
  56. * @return self
  57. */
  58. public function setOption($option, $value);
  59. }