1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * Copyright OpenSearch Contributors
7: * SPDX-License-Identifier: Apache-2.0
8: *
9: * OpenSearch PHP client
10: *
11: * @link https://github.com/opensearch-project/opensearch-php/
12: * @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
13: * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
14: * @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
15: *
16: * Licensed to Elasticsearch B.V under one or more agreements.
17: * Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
18: * the GNU Lesser General Public License, Version 2.1, at your option.
19: * See the LICENSE file in the project root for more information.
20: */
21:
22: namespace OpenSearch\Connections;
23:
24: use OpenSearch\Transport;
25:
26: // @phpstan-ignore classConstant.deprecatedInterface
27: @trigger_error(ConnectionInterface::class . ' is deprecated in 2.4.0 and will be removed in 3.0.0.', E_USER_DEPRECATED);
28:
29: /**
30: * @deprecated in 2.4.0 and will be removed in 3.0.0.
31: */
32: interface ConnectionInterface
33: {
34: /**
35: * Get the transport schema for this connection
36: */
37: public function getTransportSchema(): string;
38:
39: /**
40: * Get the hostname for this connection
41: */
42: public function getHost(): string;
43:
44: /**
45: * Get the port for this connection
46: *
47: * @return int
48: */
49: public function getPort();
50:
51: /**
52: * Get the username:password string for this connection, null if not set
53: */
54: public function getUserPass(): ?string;
55:
56: /**
57: * Get the URL path suffix, null if not set
58: */
59: public function getPath(): ?string;
60:
61: /**
62: * Check to see if this instance is marked as 'alive'
63: */
64: public function isAlive(): bool;
65:
66: /**
67: * Mark this instance as 'alive'
68: */
69: public function markAlive(): void;
70:
71: /**
72: * Mark this instance as 'dead'
73: */
74: public function markDead(): void;
75:
76: /**
77: * Return an associative array of information about the last request
78: */
79: public function getLastRequestInfo(): array;
80:
81: /**
82: * @param array<string, mixed>|null $params
83: * @param mixed $body
84: * @return mixed
85: */
86: public function performRequest(string $method, string $uri, ?array $params = [], $body = null, array $options = [], ?Transport $transport = null);
87: }
88: