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) 2016 (original work) Open Assessment Technologies SA ; |
| 19 | */ |
| 20 | |
| 21 | /** |
| 22 | * @author Jean-Sébastien Conan <jean-sebastien.conan@vesperiagroup.com> |
| 23 | */ |
| 24 | |
| 25 | namespace oat\taoQtiTest\models\runner\communicator; |
| 26 | |
| 27 | use oat\taoQtiTest\models\runner\QtiRunnerServiceContext; |
| 28 | |
| 29 | /** |
| 30 | * Interface CommunicationService |
| 31 | * |
| 32 | * Describes the API needed to manage bidirectional communication between client and server |
| 33 | * |
| 34 | * @package oat\taoQtiTest\models\runner\communicator |
| 35 | */ |
| 36 | interface CommunicationService |
| 37 | { |
| 38 | /** |
| 39 | * Channels to process input messages |
| 40 | */ |
| 41 | public const CHANNEL_TYPE_INPUT = 'input'; |
| 42 | |
| 43 | /** |
| 44 | * Channels to process output messages |
| 45 | */ |
| 46 | public const CHANNEL_TYPE_OUTPUT = 'output'; |
| 47 | |
| 48 | /** |
| 49 | * Processes the input messages |
| 50 | * @param QtiRunnerServiceContext $context - Needs the current runner context |
| 51 | * @param array $input - Accept a list of input, each one is represented by a channel's name that is a string and |
| 52 | * a message that can be any type |
| 53 | * @return array - Returns a list of responses in the same order as the input list |
| 54 | * @throws \common_Exception |
| 55 | */ |
| 56 | public function processInput(QtiRunnerServiceContext $context, array $input); |
| 57 | |
| 58 | /** |
| 59 | * Builds the list of output messages |
| 60 | * @param QtiRunnerServiceContext $context - Needs the current runner context |
| 61 | * @return array - Returns a list of output, each one is represented by a channel's name that is a string and a |
| 62 | * message that can be any type |
| 63 | * @throws \common_Exception |
| 64 | */ |
| 65 | public function processOutput(QtiRunnerServiceContext $context); |
| 66 | |
| 67 | /** |
| 68 | * Register channel |
| 69 | * @param CommunicationChannel $channel |
| 70 | * @param integer $channelType |
| 71 | */ |
| 72 | public function attachChannel(CommunicationChannel $channel, $channelType); |
| 73 | |
| 74 | /** |
| 75 | * Register channel |
| 76 | * @param CommunicationChannel $channel |
| 77 | * @param integer $channelType |
| 78 | */ |
| 79 | public function detachChannel(CommunicationChannel $channel, $channelType); |
| 80 | } |