Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2017 (original work) Open Assessment Technologies SA;
19 *
20 */
21
22namespace oat\taoDelivery\model\execution;
23
24use common_exception_NotFound;
25use oat\oatbox\user\User;
26
27/**
28 * Interface StateServiceInterface
29 *
30 * Service is used to handle changing of delivery execution state.
31 *
32 * @package oat\taoDelivery
33 */
34interface StateServiceInterface
35{
36    public const SERVICE_ID = 'taoDelivery/stateService';
37
38    public const STORAGE_SERVICE_ID = 'taoDelivery/execution_service';
39
40    /**
41     * Spawns a new delivery execution
42     *
43     * @param string $deliveryId
44     * @param User $user
45     * @param $label
46     */
47    public function createDeliveryExecution($deliveryId, User $user, $label);
48
49    public function run(DeliveryExecution $deliveryExecution);
50
51    public function pause(DeliveryExecution $deliveryExecution);
52
53    public function finish(DeliveryExecution $deliveryExecution);
54
55    /**
56     * Terminates a delivery execution
57     *
58     * @param DeliveryExecution $deliveryExecution
59     *
60     * @return bool
61     */
62    public function terminate(DeliveryExecution $deliveryExecution);
63
64    public function getDeliveriesStates();
65
66    /**
67     * @param DeliveryExecution $deliveryExecution
68     * @param string|array|null $reason
69     *
70     * @return bool
71     *
72     * @throws common_exception_NotFound
73     */
74    public function reactivateExecution(DeliveryExecution $deliveryExecution, $reason = null);
75}