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