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.Control;
25 import org.apache.directory.api.ldap.model.message.MessageTypeEnum;
26 import org.apache.directory.api.ldap.model.message.ModifyDnRequest;
27 import org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl;
28 import org.apache.directory.api.ldap.model.message.ModifyDnResponse;
29 import org.apache.directory.api.ldap.model.name.Dn;
30 import org.apache.directory.api.ldap.model.name.Rdn;
31 import org.dom4j.Element;
32
33
34
35
36
37
38
39 public class ModifyDNRequestDsml
40 extends AbstractResultResponseRequestDsml<ModifyDnRequest, ModifyDnResponse>
41 implements ModifyDnRequest
42 {
43
44
45
46 public ModifyDNRequestDsml( LdapApiService codec )
47 {
48 super( codec, new ModifyDnRequestImpl() );
49 }
50
51
52
53
54
55
56
57
58 public ModifyDNRequestDsml( LdapApiService codec, ModifyDnRequest ldapMessage )
59 {
60 super( codec, ldapMessage );
61 }
62
63
64
65
66
67 public MessageTypeEnum getType()
68 {
69 return getDecorated().getType();
70 }
71
72
73
74
75
76 public Element toDsml( Element root )
77 {
78 Element element = super.toDsml( root );
79
80 ModifyDnRequest request = getDecorated();
81
82
83 if ( request.getName() != null )
84 {
85 element.addAttribute( "dn", request.getName().getName() );
86 }
87
88
89 if ( request.getNewRdn() != null )
90 {
91 element.addAttribute( "newrdn", request.getNewRdn().getName() );
92 }
93
94
95 element.addAttribute( "deleteoldrdn", ( request.getDeleteOldRdn() ? "true" : "false" ) );
96
97
98 if ( request.getNewRdn() != null )
99 {
100 element.addAttribute( "newSuperior", request.getNewSuperior().getName() );
101 }
102
103 return element;
104 }
105
106
107
108
109
110
111
112 public Dn getName()
113 {
114 return getDecorated().getName();
115 }
116
117
118
119
120
121
122
123 public void setEntry( Dn name )
124 {
125 getDecorated().setName( name );
126 }
127
128
129
130
131
132
133
134 public boolean isDeleteOldRDN()
135 {
136 return getDecorated().getDeleteOldRdn();
137 }
138
139
140
141
142
143
144
145 public void setDeleteOldRDN( boolean deleteOldRDN )
146 {
147 getDecorated().setDeleteOldRdn( deleteOldRDN );
148 }
149
150
151
152
153
154
155
156 public Rdn getNewRDN()
157 {
158 return getDecorated().getNewRdn();
159 }
160
161
162
163
164
165
166
167 public void setNewRDN( Rdn newRdn )
168 {
169 getDecorated().setNewRdn( newRdn );
170 }
171
172
173
174
175
176
177
178 public Dn getNewSuperior()
179 {
180 return getDecorated().getNewSuperior();
181 }
182
183
184
185
186
187
188
189 public ModifyDnRequest setNewSuperior( Dn newSuperior )
190 {
191 getDecorated().setNewSuperior( newSuperior );
192
193 return this;
194 }
195
196
197
198
199
200 public MessageTypeEnum getResponseType()
201 {
202 return getDecorated().getResponseType();
203 }
204
205
206
207
208
209 public ModifyDnRequest setName( Dn name )
210 {
211 getDecorated().setName( name );
212
213 return this;
214 }
215
216
217
218
219
220 public Rdn getNewRdn()
221 {
222 return getDecorated().getNewRdn();
223 }
224
225
226
227
228
229 public ModifyDnRequest setNewRdn( Rdn newRdn )
230 {
231 getDecorated().setNewRdn( newRdn );
232
233 return this;
234 }
235
236
237
238
239
240 public boolean getDeleteOldRdn()
241 {
242 return getDecorated().getDeleteOldRdn();
243 }
244
245
246
247
248
249 public ModifyDnRequest setDeleteOldRdn( boolean deleteOldRdn )
250 {
251 getDecorated().setDeleteOldRdn( deleteOldRdn );
252
253 return this;
254 }
255
256
257
258
259
260 public boolean isMove()
261 {
262 return getDecorated().isMove();
263 }
264
265
266
267
268
269 public ModifyDnRequest setMessageId( int messageId )
270 {
271 super.setMessageId( messageId );
272
273 return this;
274 }
275
276
277
278
279
280 public ModifyDnRequest addControl( Control control )
281 {
282 return ( ModifyDnRequest ) super.addControl( control );
283 }
284
285
286
287
288
289 public ModifyDnRequest addAllControls( Control[] controls )
290 {
291 return ( ModifyDnRequest ) super.addAllControls( controls );
292 }
293
294
295
296
297
298 public ModifyDnRequest removeControl( Control control )
299 {
300 return ( ModifyDnRequest ) super.removeControl( control );
301 }
302 }