You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.5 KiB

3 years ago
  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. }