1
0

IIndexService.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright 2018, Maxence Lange <maxence@artificial-owl.com>
  5. *
  6. * @author Maxence Lange <maxence@artificial-owl.com>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  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
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OCP\FullTextSearch\Service;
  25. use OCP\FullTextSearch\Model\IIndex;
  26. /**
  27. * Interface IIndexService
  28. *
  29. * @since 15.0.0
  30. *
  31. */
  32. interface IIndexService {
  33. /**
  34. * Create an Index
  35. *
  36. * @since 15.0.1
  37. *
  38. * @param string $providerId
  39. * @param string $documentId
  40. * @param string $userId
  41. * @param int $status
  42. * @return IIndex
  43. */
  44. public function createIndex(string $providerId, string $documentId, string $userId, int $status): IIndex;
  45. /**
  46. * Retrieve an Index from the database, based on the Id of the Provider
  47. * and the Id of the Document
  48. *
  49. * @since 15.0.0
  50. *
  51. * @param string $providerId
  52. * @param string $documentId
  53. *
  54. * @return IIndex
  55. */
  56. public function getIndex(string $providerId, string $documentId): IIndex;
  57. /**
  58. * Update the status of an Index. status is a bit flag, setting $reset to
  59. * true will reset the status to the value defined in the parameter.
  60. *
  61. * @since 15.0.0
  62. *
  63. * @param string $providerId
  64. * @param string $documentId
  65. * @param int $status
  66. * @param bool $reset
  67. */
  68. public function updateIndexStatus(string $providerId, string $documentId, int $status, bool $reset = false);
  69. /**
  70. * Update the status of an array of Index. status is a bit flag, setting $reset to
  71. * true will reset the status to the value defined in the parameter.
  72. *
  73. * @since 15.0.0
  74. *
  75. * @param string $providerId
  76. * @param array $documentIds
  77. * @param int $status
  78. * @param bool $reset
  79. */
  80. public function updateIndexesStatus(string $providerId, array $documentIds, int $status, bool $reset = false);
  81. /**
  82. * Update an array of Index.
  83. *
  84. * @since 15.0.0
  85. *
  86. * @param array $indexes
  87. */
  88. public function updateIndexes(array $indexes);
  89. }