1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Ivory Http Adapter package. |
5
|
|
|
* |
6
|
|
|
* (c) Eric GELOEN <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please read the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Ivory\HttpAdapter\Event\Cache; |
13
|
|
|
|
14
|
|
|
use Ivory\HttpAdapter\HttpAdapterException; |
15
|
|
|
use Ivory\HttpAdapter\Message\InternalRequestInterface; |
16
|
|
|
use Ivory\HttpAdapter\Message\MessageFactoryInterface; |
17
|
|
|
use Ivory\HttpAdapter\Message\ResponseInterface; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @author GeLo <[email protected]> |
21
|
|
|
*/ |
22
|
|
|
interface CacheInterface |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* @param InternalRequestInterface $internalRequest |
26
|
|
|
* @param MessageFactoryInterface $messageFactory |
27
|
|
|
* |
28
|
|
|
* @return ResponseInterface|null |
29
|
|
|
*/ |
30
|
|
|
public function getResponse(InternalRequestInterface $internalRequest, MessageFactoryInterface $messageFactory); |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @param InternalRequestInterface $internalRequest |
34
|
|
|
* @param MessageFactoryInterface $messageFactory |
35
|
|
|
* |
36
|
|
|
* @return HttpAdapterException|null |
37
|
|
|
*/ |
38
|
|
|
public function getException(InternalRequestInterface $internalRequest, MessageFactoryInterface $messageFactory); |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param ResponseInterface $response |
42
|
|
|
* @param InternalRequestInterface $internalRequest |
43
|
|
|
*/ |
44
|
|
|
public function saveResponse(ResponseInterface $response, InternalRequestInterface $internalRequest); |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @param HttpAdapterException $exception |
48
|
|
|
* @param InternalRequestInterface $internalRequest |
49
|
|
|
*/ |
50
|
|
|
public function saveException(HttpAdapterException $exception, InternalRequestInterface $internalRequest); |
51
|
|
|
} |
52
|
|
|
|