2014-02-11 17:00:24 +04:00
|
|
|
<?php
|
|
|
|
/**
|
2014-02-12 16:25:50 +04:00
|
|
|
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
|
2014-02-11 17:00:24 +04:00
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCP\BackgroundJob;
|
|
|
|
|
|
|
|
interface IJob {
|
|
|
|
/**
|
2014-02-12 16:32:16 +04:00
|
|
|
* Run the background job with the registered argument
|
|
|
|
*
|
|
|
|
* @param \OCP\BackgroundJob\IJobList $jobList The job list that manages the state of this job
|
2014-02-11 17:00:24 +04:00
|
|
|
* @param \OC\Log $logger
|
2014-02-19 12:31:54 +04:00
|
|
|
* @return void
|
2014-02-11 17:00:24 +04:00
|
|
|
*/
|
|
|
|
public function execute($jobList, $logger = null);
|
|
|
|
|
2014-02-12 16:32:16 +04:00
|
|
|
/**
|
|
|
|
* Get the id of the background job
|
|
|
|
* This id is determined by the job list when a job is added to the list
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
2014-02-11 17:00:24 +04:00
|
|
|
public function getId();
|
|
|
|
|
2014-02-12 16:32:16 +04:00
|
|
|
/**
|
|
|
|
* Get the last time this job was run as unix timestamp
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
2014-02-11 17:00:24 +04:00
|
|
|
public function getLastRun();
|
|
|
|
|
2014-02-12 16:32:16 +04:00
|
|
|
/**
|
|
|
|
* Get the argument associated with the background job
|
|
|
|
* This is the argument that will be passed to the background job
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-02-11 17:00:24 +04:00
|
|
|
public function getArgument();
|
|
|
|
}
|