ArchiveTransferInterface.php 1.84 KB
Newer Older
Alexis Ragot's avatar
Alexis Ragot committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/*
 * Copyright (C) 2018 Maarch
 *
 * This file is part of bundle medona.
 *
 * Bundle medona is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Bundle medona is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with bundle medona.  If not, see <http://www.gnu.org/licenses/>.
 */
namespace ext\thirdPartyArchiving\bundle\medona\Controller;

/**
Alexis Ragot's avatar
Alexis Ragot committed
23
 * Archive transfer interface
Alexis Ragot's avatar
Alexis Ragot committed
24
25
26
27
 *
 * @package Medona
 * @author  Alexis Ragot <alexis.ragot@maarch.org>
 */
Alexis Ragot's avatar
Alexis Ragot committed
28
interface ArchiveTransferInterface
Alexis Ragot's avatar
Alexis Ragot committed
29
30
{
    /**
Alexis Ragot's avatar
Alexis Ragot committed
31
32
33
     * Receive message with all contents embedded
     * @param string $messageFile The message binary contents OR a filename
     * @param array  $attachments An array of attachment binary data
Alexandre Morin's avatar
Alexandre Morin committed
34
     * @param string $schema      The transfer schema
Alexis Ragot's avatar
Alexis Ragot committed
35
     *
Alexis Ragot's avatar
Alexis Ragot committed
36
     * @return medona/message The acknowledgement
Alexis Ragot's avatar
Alexis Ragot committed
37
     */
Alexandre Morin's avatar
Alexandre Morin committed
38
    public function receive($messageFile, $attachments = array(), $schema = null);
Alexis Ragot's avatar
Alexis Ragot committed
39
40
41
42

    /**
     * Validate message against schema and rules
     * @param string $messageId The message identifier
Alexis Ragot's avatar
Alexis Ragot committed
43
     * @param object $archivalAgreement The archival agreement
Alexis Ragot's avatar
Alexis Ragot committed
44
45
46
     *
     * @return boolean The validation result
     */
Alexis Ragot's avatar
Alexis Ragot committed
47
    public function validate($messageId, $archivalAgreement = null);
Alexis Ragot's avatar
Alexis Ragot committed
48
49
50
51
52
53
54
55

    /**
     * Process the archive transfer
     * @param mixed $messageId The message object or the message identifier
     *
     * @return string The reply message identifier
     */
    public function process($messageId);
Alexis Ragot's avatar
Alexis Ragot committed
56
}