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.dsmlv2.DsmlLiterals;
24 import org.apache.directory.api.ldap.codec.api.LdapApiService;
25 import org.apache.directory.api.ldap.model.message.Control;
26 import org.apache.directory.api.ldap.model.message.DeleteRequest;
27 import org.apache.directory.api.ldap.model.message.DeleteRequestImpl;
28 import org.apache.directory.api.ldap.model.message.DeleteResponse;
29 import org.apache.directory.api.ldap.model.message.MessageTypeEnum;
30 import org.apache.directory.api.ldap.model.name.Dn;
31 import org.dom4j.Element;
32
33
34
35
36
37
38
39 public class DelRequestDsml
40 extends AbstractResultResponseRequestDsml<DeleteRequest, DeleteResponse>
41 implements DeleteRequest
42 {
43
44
45
46
47
48 public DelRequestDsml( LdapApiService codec )
49 {
50 super( codec, new DeleteRequestImpl() );
51 }
52
53
54
55
56
57
58
59
60 public DelRequestDsml( LdapApiService codec, DeleteRequest ldapMessage )
61 {
62 super( codec, ldapMessage );
63 }
64
65
66
67
68
69 @Override
70 public MessageTypeEnum getType()
71 {
72 return getDecorated().getType();
73 }
74
75
76
77
78
79 @Override
80 public Element toDsml( Element root )
81 {
82 Element element = super.toDsml( root );
83
84
85 if ( getDecorated().getName() != null )
86 {
87 element.addAttribute( DsmlLiterals.DN, getDecorated().getName().getName() );
88 }
89
90 return element;
91 }
92
93
94
95
96
97
98
99 public Dn getEntry()
100 {
101 return getDecorated().getName();
102 }
103
104
105
106
107
108
109
110 public void setEntry( Dn entry )
111 {
112 getDecorated().setName( entry );
113 }
114
115
116
117
118
119 @Override
120 public MessageTypeEnum getResponseType()
121 {
122 return getDecorated().getResponseType();
123 }
124
125
126
127
128
129 @Override
130 public Dn getName()
131 {
132 return getDecorated().getName();
133 }
134
135
136
137
138
139 @Override
140 public DeleteRequest setName( Dn name )
141 {
142 getDecorated().setName( name );
143
144 return this;
145 }
146
147
148
149
150
151 @Override
152 public DeleteRequest setMessageId( int messageId )
153 {
154 super.setMessageId( messageId );
155
156 return this;
157 }
158
159
160
161
162
163 @Override
164 public DeleteRequest addControl( Control control )
165 {
166 return ( DeleteRequest ) super.addControl( control );
167 }
168
169
170
171
172
173 @Override
174 public DeleteRequest addAllControls( Control[] controls )
175 {
176 return ( DeleteRequest ) super.addAllControls( controls );
177 }
178
179
180
181
182
183 @Override
184 public DeleteRequest removeControl( Control control )
185 {
186 return ( DeleteRequest ) super.removeControl( control );
187 }
188 }