-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathConnectionInterface.php
More file actions
118 lines (99 loc) · 2.71 KB
/
Copy pathConnectionInterface.php
File metadata and controls
118 lines (99 loc) · 2.71 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
declare(strict_types=1);
/*
* This file is part of the Neo4j PHP Client and Driver package.
*
* (c) Nagels <https://nagels.tech>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Laudis\Neo4j\Contracts;
use Laudis\Neo4j\Databags\DatabaseInfo;
use Laudis\Neo4j\Enum\AccessMode;
use Laudis\Neo4j\Enum\ConnectionProtocol;
use Psr\Http\Message\UriInterface;
/**
* A connection is an abstraction over a protocol used to communicate between driver and server.
*
* @template ProtocolImplementation The implementation of the protocol.
*/
interface ConnectionInterface
{
/**
* @return ProtocolImplementation
*/
public function getImplementation();
/**
* Returns the authentication logic attached to this connection.
*
* @psalm-mutation-free
*/
public function getAuthentication(): AuthenticateInterface;
/**
* Returns the agent the servers uses to identify itself.
*
* @psalm-mutation-free
*/
public function getServerAgent(): string;
/**
* Returns the Uri used to connect to the server.
*
* @psalm-mutation-free
*/
public function getServerAddress(): UriInterface;
/**
* Returns the version of the neo4j server.
*
* @psalm-mutation-free
*/
public function getServerVersion(): string;
/**
* Returns the assumed server state.
*/
public function getServerState(): string;
/**
* Returns the protocol used to connect to the server.
*
* @psalm-mutation-free
*/
public function getProtocol(): ConnectionProtocol;
/**
* Returns the mode of access.
*
* @psalm-mutation-free
*/
public function getAccessMode(): ?AccessMode;
/**
* Returns the information about the database the connection reaches.
*
* @psalm-mutation-free
*/
public function getDatabaseInfo(): ?DatabaseInfo;
/**
* Resets the connection.
*/
public function reset(): void;
/**
* Sets the timeout of the connection in seconds.
*/
public function setTimeout(float $timeout): void;
/**
* Checks to see if the connection is open.
*/
public function isOpen(): bool;
/**
* Encryption level can be either '', 's' or 'ssc', which stand for 'no encryption', 'full encryption' and 'self-signed encryption' respectively.
*
* @return ''|'s'|'ssc'
*/
public function getEncryptionLevel(): string;
/**
* Returns the user agent handling this connection.
*/
public function getUserAgent(): string;
/**
* Closes the connection.
*/
public function close(): void;
}