ijob.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * @author Morris Jobke <hey@morrisjobke.de>
  4. * @author Robin Appelman <icewind@owncloud.com>
  5. * @author Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>
  6. *
  7. * @copyright Copyright (c) 2015, ownCloud, Inc.
  8. * @license AGPL-3.0
  9. *
  10. * This code is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License, version 3,
  12. * as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License, version 3,
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>
  21. *
  22. */
  23. namespace OCP\BackgroundJob;
  24. interface IJob {
  25. /**
  26. * Run the background job with the registered argument
  27. *
  28. * @param \OCP\BackgroundJob\IJobList $jobList The job list that manages the state of this job
  29. * @param \OC\Log $logger
  30. * @return void
  31. */
  32. public function execute($jobList, $logger = null);
  33. /**
  34. * Get the id of the background job
  35. * This id is determined by the job list when a job is added to the list
  36. *
  37. * @return int
  38. */
  39. public function getId();
  40. /**
  41. * Get the last time this job was run as unix timestamp
  42. *
  43. * @return int
  44. */
  45. public function getLastRun();
  46. /**
  47. * Get the argument associated with the background job
  48. * This is the argument that will be passed to the background job
  49. *
  50. * @return mixed
  51. */
  52. public function getArgument();
  53. }