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.

ijoblist.php 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace OCP\BackgroundJob;
  9. interface IJobList {
  10. /**
  11. * Add a job to the list
  12. *
  13. * @param \OCP\BackgroundJob\IJob |string $job
  14. * @param mixed $argument The argument to be passed to $job->run() when the job is exectured
  15. * @param string $job
  16. * @return void
  17. */
  18. public function add($job, $argument = null);
  19. /**
  20. * Remove a job from the list
  21. *
  22. * @param IJob $job
  23. * @param mixed $argument
  24. * @return void
  25. */
  26. public function remove($job, $argument = null);
  27. /**
  28. * check if a job is in the list
  29. *
  30. * @param $job
  31. * @param mixed $argument
  32. * @return bool
  33. */
  34. public function has($job, $argument);
  35. /**
  36. * get all jobs in the list
  37. *
  38. * @return \OCP\BackgroundJob\IJob[]
  39. */
  40. public function getAll();
  41. /**
  42. * get the next job in the list
  43. *
  44. * @return \OCP\BackgroundJob\IJob
  45. */
  46. public function getNext();
  47. /**
  48. * @param int $id
  49. * @return \OCP\BackgroundJob\IJob
  50. */
  51. public function getById($id);
  52. /**
  53. * set the job that was last ran to the current time
  54. *
  55. * @param \OCP\BackgroundJob\IJob $job
  56. * @return void
  57. */
  58. public function setLastJob($job);
  59. /**
  60. * get the id of the last ran job
  61. *
  62. * @return int
  63. */
  64. public function getLastJob();
  65. /**
  66. * set the lastRun of $job to now
  67. *
  68. * @param \OCP\BackgroundJob\IJob $job
  69. * @return void
  70. */
  71. public function setLastRun($job);
  72. }