1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.api.dsmlv2.request;
21
22
23 import org.apache.directory.api.ldap.codec.api.LdapApiService;
24 import org.apache.directory.api.ldap.model.message.BindRequest;
25 import org.apache.directory.api.ldap.model.message.BindRequestImpl;
26 import org.apache.directory.api.ldap.model.message.BindResponse;
27 import org.apache.directory.api.ldap.model.message.Control;
28 import org.apache.directory.api.ldap.model.message.MessageTypeEnum;
29 import org.apache.directory.api.ldap.model.name.Dn;
30 import org.dom4j.Element;
31
32
33
34
35
36
37
38 public class BindRequestDsml
39 extends AbstractResultResponseRequestDsml<BindRequest, BindResponse>
40 implements BindRequest
41 {
42
43
44
45 public BindRequestDsml( LdapApiService codec )
46 {
47 super( codec, new BindRequestImpl() );
48 }
49
50
51
52
53
54
55
56 public BindRequestDsml( LdapApiService codec, BindRequest ldapMessage )
57 {
58 super( codec, ldapMessage );
59 }
60
61
62
63
64
65 public MessageTypeEnum getType()
66 {
67 return getDecorated().getType();
68 }
69
70
71
72
73
74 public Element toDsml( Element root )
75 {
76 Element element = super.toDsml( root );
77
78 BindRequest request = getDecorated();
79
80
81 Dn dn = request.getDn();
82
83 if ( !Dn.isNullOrEmpty( dn ) )
84 {
85
86
87 element.addAttribute( "principal", dn.getName() );
88 }
89 else
90 {
91
92
93 String name = request.getName();
94
95 element.addAttribute( "principal", name );
96 }
97
98 return element;
99 }
100
101
102
103
104
105 public MessageTypeEnum getResponseType()
106 {
107 return getDecorated().getResponseType();
108 }
109
110
111
112
113
114 public boolean isSimple()
115 {
116 return getDecorated().isSimple();
117 }
118
119
120
121
122
123 public boolean getSimple()
124 {
125 return getDecorated().getSimple();
126 }
127
128
129
130
131
132 public BindRequest setSimple( boolean isSimple )
133 {
134 getDecorated().setSimple( isSimple );
135
136 return this;
137 }
138
139
140
141
142
143 public byte[] getCredentials()
144 {
145 return getDecorated().getCredentials();
146 }
147
148
149
150
151
152 public BindRequest setCredentials( String credentials )
153 {
154 getDecorated().setCredentials( credentials );
155
156 return this;
157 }
158
159
160
161
162
163 public BindRequest setCredentials( byte[] credentials )
164 {
165 getDecorated().setCredentials( credentials );
166
167 return this;
168 }
169
170
171
172
173
174 public String getName()
175 {
176 return getDecorated().getName();
177 }
178
179
180
181
182
183 public BindRequest setName( String name )
184 {
185 getDecorated().setName( name );
186
187 return this;
188 }
189
190
191
192
193
194 public Dn getDn()
195 {
196 return getDecorated().getDn();
197 }
198
199
200
201
202
203 public BindRequest setDn( Dn dn )
204 {
205 getDecorated().setDn( dn );
206
207 return this;
208 }
209
210
211
212
213
214 public boolean isVersion3()
215 {
216 return getDecorated().isVersion3();
217 }
218
219
220
221
222
223 public boolean getVersion3()
224 {
225 return getDecorated().getVersion3();
226 }
227
228
229
230
231
232 public BindRequest setVersion3( boolean isVersion3 )
233 {
234 getDecorated().setVersion3( isVersion3 );
235
236 return this;
237 }
238
239
240
241
242
243 public String getSaslMechanism()
244 {
245 return getDecorated().getSaslMechanism();
246 }
247
248
249
250
251
252 public BindRequest setSaslMechanism( String saslMechanism )
253 {
254 getDecorated().setSaslMechanism( saslMechanism );
255
256 return this;
257 }
258
259
260
261
262
263 public BindRequest setMessageId( int messageId )
264 {
265 super.setMessageId( messageId );
266
267 return this;
268 }
269
270
271
272
273
274 public BindRequest addControl( Control control )
275 {
276 return ( BindRequest ) super.addControl( control );
277 }
278
279
280
281
282
283 public BindRequest addAllControls( Control[] controls )
284 {
285 return ( BindRequest ) super.addAllControls( controls );
286 }
287
288
289
290
291
292 public BindRequest removeControl( Control control )
293 {
294 return ( BindRequest ) super.removeControl( control );
295 }
296 }