/
ConnectionInterface.php
92 lines (81 loc) · 2.22 KB
/
ConnectionInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
namespace Elasticsearch\Connections;
use Elasticsearch\Serializers\SerializerInterface;
use Elasticsearch\Transport;
use Psr\Log\LoggerInterface;
/**
* Interface ConnectionInterface
*
* @category Elasticsearch
* @package Elasticsearch\Connections
* @author Zachary Tong <zach@elastic.co>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
interface ConnectionInterface
{
/**
* Constructor
*
* @param $handler
* @param array $hostDetails
* @param array $connectionParams connection-specific parameters
* @param \Elasticsearch\Serializers\SerializerInterface $serializer
* @param \Psr\Log\LoggerInterface $log Logger object
* @param \Psr\Log\LoggerInterface $trace Logger object
*/
public function __construct($handler, $hostDetails, $connectionParams,
SerializerInterface $serializer, LoggerInterface $log, LoggerInterface $trace);
/**
* Get the transport schema for this connection
*
* @return string
*/
public function getTransportSchema();
/**
* Get the hostname for this connection
*
* @return string
*/
public function getHost();
/**
* Get the username:password string for this connection, null if not set
*
* @return null|string
*/
public function getUserPass();
/**
* Check to see if this instance is marked as 'alive'
*
* @return bool
*/
public function isAlive();
/**
* Mark this instance as 'alive'
*
* @return void
*/
public function markAlive();
/**
* Mark this instance as 'dead'
*
* @return void
*/
public function markDead();
/**
* Return an associative array of information about the last request
*
* @return array
*/
public function getLastRequestInfo();
/**
* @param $method
* @param $uri
* @param null $params
* @param null $body
* @param array $options
* @param \Elasticsearch\Transport $transport
* @return mixed
*/
public function performRequest($method, $uri, $params = null, $body = null, $options = [], Transport $transport);
}