2014-02-11 13:00:24 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2014-02-12 12:25:50 +00:00
|
|
|
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
|
2014-02-11 13:00:24 +00: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 12:32:16 +00: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 13:00:24 +00:00
|
|
|
* @param \OC\Log $logger
|
2014-02-19 08:31:54 +00:00
|
|
|
* @return void
|
2014-02-11 13:00:24 +00:00
|
|
|
*/
|
|
|
|
public function execute($jobList, $logger = null);
|
|
|
|
|
2014-02-12 12:32:16 +00: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 13:00:24 +00:00
|
|
|
public function getId();
|
|
|
|
|
2014-02-12 12:32:16 +00:00
|
|
|
/**
|
|
|
|
* Get the last time this job was run as unix timestamp
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
2014-02-11 13:00:24 +00:00
|
|
|
public function getLastRun();
|
|
|
|
|
2014-02-12 12:32:16 +00: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 13:00:24 +00:00
|
|
|
public function getArgument();
|
|
|
|
}
|