選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ijoblist.php 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. /**
  3. * @author Joas Schilling <nickvergessen@owncloud.com>
  4. * @author Morris Jobke <hey@morrisjobke.de>
  5. * @author Robin Appelman <icewind@owncloud.com>
  6. * @author Robin McCorkell <robin@mccorkell.me.uk>
  7. *
  8. * @copyright Copyright (c) 2016, ownCloud, Inc.
  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\BackgroundJob;
  25. /**
  26. * Interface IJobList
  27. *
  28. * @package OCP\BackgroundJob
  29. * @since 7.0.0
  30. */
  31. interface IJobList {
  32. /**
  33. * Add a job to the list
  34. *
  35. * @param \OCP\BackgroundJob\IJob|string $job
  36. * @param mixed $argument The argument to be passed to $job->run() when the job is exectured
  37. * @since 7.0.0
  38. */
  39. public function add($job, $argument = null);
  40. /**
  41. * Remove a job from the list
  42. *
  43. * @param \OCP\BackgroundJob\IJob|string $job
  44. * @param mixed $argument
  45. * @since 7.0.0
  46. */
  47. public function remove($job, $argument = null);
  48. /**
  49. * check if a job is in the list
  50. *
  51. * @param \OCP\BackgroundJob\IJob|string $job
  52. * @param mixed $argument
  53. * @return bool
  54. * @since 7.0.0
  55. */
  56. public function has($job, $argument);
  57. /**
  58. * get all jobs in the list
  59. *
  60. * @return \OCP\BackgroundJob\IJob[]
  61. * @since 7.0.0
  62. * @deprecated 9.0.0 - This method is dangerous since it can cause load and
  63. * memory problems when creating too many instances.
  64. */
  65. public function getAll();
  66. /**
  67. * get the next job in the list
  68. *
  69. * @return \OCP\BackgroundJob\IJob|null
  70. * @since 7.0.0
  71. */
  72. public function getNext();
  73. /**
  74. * @param int $id
  75. * @return \OCP\BackgroundJob\IJob|null
  76. * @since 7.0.0
  77. */
  78. public function getById($id);
  79. /**
  80. * set the job that was last ran to the current time
  81. *
  82. * @param \OCP\BackgroundJob\IJob $job
  83. * @since 7.0.0
  84. */
  85. public function setLastJob($job);
  86. /**
  87. * get the id of the last ran job
  88. *
  89. * @return int
  90. * @since 7.0.0
  91. */
  92. public function getLastJob();
  93. /**
  94. * set the lastRun of $job to now
  95. *
  96. * @param \OCP\BackgroundJob\IJob $job
  97. * @since 7.0.0
  98. */
  99. public function setLastRun($job);
  100. }