IUserMountCache.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Robin Appelman <robin@icewind.nl>
  6. *
  7. * @license AGPL-3.0
  8. *
  9. * This code is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License, version 3,
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>
  20. *
  21. */
  22. namespace OCP\Files\Config;
  23. use OCP\Files\Mount\IMountPoint;
  24. use OCP\IUser;
  25. /**
  26. * Cache mounts points per user in the cache so we can easily look them up
  27. *
  28. * @since 9.0.0
  29. */
  30. interface IUserMountCache {
  31. /**
  32. * Register mounts for a user to the cache
  33. *
  34. * @param IUser $user
  35. * @param IMountPoint[] $mounts
  36. * @since 9.0.0
  37. */
  38. public function registerMounts(IUser $user, array $mounts);
  39. /**
  40. * Get all cached mounts for a user
  41. *
  42. * @param IUser $user
  43. * @return ICachedMountInfo[]
  44. * @since 9.0.0
  45. */
  46. public function getMountsForUser(IUser $user);
  47. /**
  48. * Get all cached mounts by storage
  49. *
  50. * @param int $numericStorageId
  51. * @return ICachedMountInfo[]
  52. * @since 9.0.0
  53. */
  54. public function getMountsForStorageId($numericStorageId);
  55. /**
  56. * Get all cached mounts by root
  57. *
  58. * @param int $rootFileId
  59. * @return ICachedMountInfo[]
  60. * @since 9.0.0
  61. */
  62. public function getMountsForRootId($rootFileId);
  63. /**
  64. * Get all cached mounts that contain a file
  65. *
  66. * @param int $fileId
  67. * @return ICachedMountInfo[]
  68. * @since 9.0.0
  69. */
  70. public function getMountsForFileId($fileId);
  71. /**
  72. * Remove all cached mounts for a user
  73. *
  74. * @param IUser $user
  75. * @since 9.0.0
  76. */
  77. public function removeUserMounts(IUser $user);
  78. /**
  79. * Remove all mounts for a user and storage
  80. *
  81. * @param $storageId
  82. * @param string $userId
  83. * @return mixed
  84. * @since 9.0.0
  85. */
  86. public function removeUserStorageMount($storageId, $userId);
  87. /**
  88. * Remove all cached mounts for a storage
  89. *
  90. * @param $storageId
  91. * @return mixed
  92. * @since 9.0.0
  93. */
  94. public function remoteStorageMounts($storageId);
  95. }