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.ldap.model.message;
21
22
23 import org.apache.directory.api.i18n.I18n;
24
25
26
27
28
29
30
31 public class AbandonRequestImpl extends AbstractRequest implements AbandonRequest
32 {
33
34 private int abandonId;
35
36
37
38
39
40 public AbandonRequestImpl()
41 {
42 super( -1, TYPE, false );
43 }
44
45
46
47
48
49
50
51 public AbandonRequestImpl( final int abdandonnedId )
52 {
53 super( -1, TYPE, false );
54 abandonId = abdandonnedId;
55 }
56
57
58
59
60
61
62
63 public int getAbandoned()
64 {
65 return abandonId;
66 }
67
68
69
70
71
72 public AbandonRequest setAbandoned( int abandonId )
73 {
74 this.abandonId = abandonId;
75
76 return this;
77 }
78
79
80
81
82
83
84 public void abandon()
85 {
86 throw new UnsupportedOperationException( I18n.err( I18n.ERR_04185 ) );
87 }
88
89
90
91
92
93 public AbandonRequest setMessageId( int messageId )
94 {
95 super.setMessageId( messageId );
96
97 return this;
98 }
99
100
101
102
103
104 public AbandonRequest addControl( Control control )
105 {
106 return ( AbandonRequest ) super.addControl( control );
107 }
108
109
110
111
112
113 public AbandonRequest addAllControls( Control[] controls )
114 {
115 return ( AbandonRequest ) super.addAllControls( controls );
116 }
117
118
119
120
121
122 public AbandonRequest removeControl( Control control )
123 {
124 return ( AbandonRequest ) super.removeControl( control );
125 }
126
127
128
129
130
131
132
133
134
135
136 public boolean equals( Object obj )
137 {
138 if ( this == obj )
139 {
140 return true;
141 }
142
143 if ( ( obj == null ) || !( obj instanceof AbandonRequest ) )
144 {
145 return false;
146 }
147
148 if ( !super.equals( obj ) )
149 {
150 return false;
151 }
152
153 AbandonRequest req = ( AbandonRequest ) obj;
154
155 return req.getAbandoned() == abandonId;
156 }
157
158
159
160
161
162
163 public int hashCode()
164 {
165 int hash = 37;
166 hash = hash * 17 + abandonId;
167 hash = hash * 17 + super.hashCode();
168
169 return hash;
170 }
171
172
173
174
175
176
177
178 public String toString()
179 {
180 StringBuilder sb = new StringBuilder();
181
182 sb.append( " Abandon Request :\n" );
183 sb.append( " Message Id : " ).append( abandonId );
184
185
186 sb.append( super.toString() );
187
188 return sb.toString();
189 }
190 }