backgroundprocess.inc.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. // Copyright (C) 2010-2013 Combodo SARL
  3. //
  4. // This file is part of iTop.
  5. //
  6. // iTop is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU Affero General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // iTop is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU Affero General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Affero General Public License
  17. // along with iTop. If not, see <http://www.gnu.org/licenses/>
  18. /**
  19. * interface iProcess
  20. * Something that can be executed
  21. *
  22. * @copyright Copyright (C) 2010-2012 Combodo SARL
  23. * @license http://opensource.org/licenses/AGPL-3.0
  24. */
  25. interface iProcess
  26. {
  27. public function Process($iUnixTimeLimit);
  28. }
  29. /**
  30. * interface iBackgroundProcess
  31. * Any extension that must be called regularly to be executed in the background
  32. *
  33. * @copyright Copyright (C) 2010-2012 Combodo SARL
  34. * @license http://opensource.org/licenses/AGPL-3.0
  35. */
  36. interface iBackgroundProcess extends iProcess
  37. {
  38. /*
  39. Gives the repetition rate in seconds
  40. @returns integer
  41. */
  42. public function GetPeriodicity();
  43. }
  44. /**
  45. * interface iScheduledProcess
  46. * A variant of process that must be called at specific times
  47. *
  48. * @copyright Copyright (C) 2013 Combodo SARL
  49. * @license http://opensource.org/licenses/AGPL-3.0
  50. */
  51. interface iScheduledProcess extends iProcess
  52. {
  53. /*
  54. Gives the exact time at which the process must be run next time
  55. @returns DateTime
  56. */
  57. public function GetNextOccurrence();
  58. }
  59. ?>