IObjectStore.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. *
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. namespace OCP\Files\ObjectStore;
  25. /**
  26. * Interface IObjectStore
  27. *
  28. * @package OCP\Files\ObjectStore
  29. * @since 7.0.0
  30. */
  31. interface IObjectStore {
  32. /**
  33. * @return string the container or bucket name where objects are stored
  34. * @since 7.0.0
  35. */
  36. public function getStorageId();
  37. /**
  38. * @param string $urn the unified resource name used to identify the object
  39. * @return resource stream with the read data
  40. * @throws \Exception when something goes wrong, message will be logged
  41. * @since 7.0.0
  42. */
  43. public function readObject($urn);
  44. /**
  45. * @param string $urn the unified resource name used to identify the object
  46. * @param resource $stream stream with the data to write
  47. * @throws \Exception when something goes wrong, message will be logged
  48. * @since 7.0.0
  49. */
  50. public function writeObject($urn, $stream);
  51. /**
  52. * @param string $urn the unified resource name used to identify the object
  53. * @return void
  54. * @throws \Exception when something goes wrong, message will be logged
  55. * @since 7.0.0
  56. */
  57. public function deleteObject($urn);
  58. }