-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransport.php
144 lines (118 loc) · 3.46 KB
/
Transport.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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
namespace riiak;
use \CComponent,
\CJSON,
\Exception,
\Yii;
/**
* Contains transport layer actions of Riak
* @package riiak
*
* @property-read bool $isAlive
* @property-read array $riakConfiguration
* @property-read \riiak\transport\Status $statusObject
*/
abstract class Transport extends CComponent {
/**
* Riiak client
*
* @var \riiak\Riiak
*/
public $client;
/**
* Initialise processing method object.
* @param \riiak\Riiak $client
*/
public function __construct(\riiak\Riiak $client) {
$this->client = $client;
}
/**
* Return array of Bucket names
*
* @return array
*/
abstract public function listBuckets();
/**
* Return array of Bucket's object keys
*
* @return array
*/
abstract public function listBucketKeys(\riiak\Bucket $bucket);
abstract public function listBucketProps(\riiak\Bucket $bucket);
/**
* Fetches Bucket object
*
* @return array
*/
abstract public function getBucket(\riiak\Bucket $bucket, array $params = array());
/**
* Updates (sets) Bucket object
*
* @return array
*/
abstract public function setBucket(\riiak\Bucket $bucket, array $properties);
abstract public function fetchObject(\riiak\Bucket $bucket, $key, array $params = null);
abstract public function storeObject(\riiak\Object $object, array $params = array());
abstract public function deleteObject(\riiak\Object $object, array $params = array());
abstract public function linkWalk(\riiak\Bucket $bucket, $key, array $links, array $params = null);
abstract public function mapReduce();
abstract public function secondaryIndex();
abstract public function ping();
abstract public function status();
abstract public function listResources();
/**
* Check if Riak server is alive
*
* @return bool
*/
abstract public function getIsAlive();
/**
* Executes request, returns named array(headers, body) of request, or null on error
*
* @param 'GET'|'POST'|'PUT'|'DELETE' $method
* @param string $url
* @param array $requestHeaders optional
* @param string $content optional
* @return array|null
*/
abstract public function processRequest($method, $url, array $requestHeaders = array(), $content = '');
/**
* Parse header string into an assoc array
*
* @param string $headers
* @return array
*/
abstract public function processHeaders($headers);
/**
* Get riak configuration
*
* @return array
*/
abstract public function getRiakConfiguration();
/**
* Check riak supports multi-backend or not.
*
* @return bool
*/
abstract public function getIsMultiBackendSupport();
/**
* Check riak supports secondary index or not.
*
* @return bool
*/
abstract public function getIsSecondaryIndexSupport();
/**
* Method to validate riak response
*
* @param string $response
* @param string|array $action
* @throws \Exception
*/
abstract public function validateResponse($response, $action);
/**
* Get status handling class object
*
* @return object http\Status
*/
abstract public function getStatusObject();
}