Welcome to mirror list, hosted at ThFree Co, Russian Federation.

IAdapter.php « PagedResults « lib « user_ldap « apps - github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 95034a1e39d0a13ba5108cf62cef7fd92fba2668 (plain)
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
<?php

declare(strict_types=1);
/**
 * @copyright Copyright (c) 2020 Arthur Schiwon <blizzz@arthur-schiwon.de>
 *
 * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
 *
 * @license GNU AGPL version 3 or any later version
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

namespace OCA\User_LDAP\PagedResults;

interface IAdapter {

	/**
	 * Methods for initiating Paged Results Control
	 */

	/**
	 * The adapter receives paged result parameters from the client. It may
	 * store the parameters for later use.
	 */
	public function setRequestParameters($link, int $pageSize, bool $isCritical): void;

	/**
	 * The adapter is asked for an function that is being explicitly called to
	 * send the control parameters to LDAP. If not function has to be called,
	 * null shall be returned.
	 *
	 * It will used by the callee for diagnosis and error handling.
	 */
	public function getRequestCallFunc(): ?string;

	/**
	 * The adapter is asked to provide the arguments it would pass to the
	 * function returned by getRequestCallFunc(). If none shall be called, an
	 * empty array should be returned.
	 *
	 * It will used by the callee for diagnosis and error handling.
	 */
	public function getRequestCallArgs($link): array;

	/**
	 * The adapter is asked to do the necessary calls to LDAP, if
	 * getRequestCallFunc returned a function. If none, it will not be called
	 * so the return value is best set to false. Otherwise it shall respond
	 * whether setting the controls was successful.
	 */
	public function requestCall($link): bool;

	/**
	 * The adapter shall report which PHP function will be called to process
	 * the paged results call
	 *
	 * It will used by the callee for diagnosis and error handling.
	 */
	public function getResponseCallFunc(): string;

	/**
	 * The adapter shall report with arguments will be provided to the LDAP
	 * function it will call
	 *
	 * It will used by the callee for diagnosis and error handling.
	 */
	public function getResponseCallArgs(array $originalArgs): array;

	/**
	 * the adapter should do it's LDAP function call and return success state
	 *
	 * @param resource $link LDAP resource
	 * @return bool
	 */
	public function responseCall($link): bool;

	/**
	 * The adapter receives the parameters that were passed to a search
	 * operation. Typically it wants to save the them for the call proper later
	 * on.
	 */
	public function setSearchArgs(
		$link,
		string $baseDN,
		string $filter,
		array $attr,
		int $attrsOnly,
		int $limit
	): void;

	/**
	 * The adapter shall report which arguments shall be passed to the
	 * ldap_search function.
	 */
	public function getSearchArgs($link): array;

	/**
	 * The adapter receives the parameters that were passed to a read
	 * operation. Typically it wants to save the them for the call proper later
	 * on.
	 */
	public function setReadArgs($link, string $baseDN, string $filter, array $attr): void;

	/**
	 * The adapter shall report which arguments shall be passed to the
	 * ldap_read function.
	 */
	public function getReadArgs($link): array;

	/**
	 * Returns the current paged results cookie
	 *
	 * @param resource $link LDAP resource
	 * @return string
	 */
	public function getCookie($link): string;
}