1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.directory.api.ldap.model.entry;
20
21
22 import java.io.IOException;
23 import java.io.ObjectInput;
24 import java.io.ObjectOutput;
25 import java.util.Collection;
26 import java.util.Iterator;
27 import java.util.List;
28
29 import org.apache.directory.api.ldap.model.exception.LdapException;
30 import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
31 import org.apache.directory.api.ldap.model.name.Dn;
32 import org.apache.directory.api.ldap.model.schema.AttributeType;
33 import org.apache.directory.api.util.exception.NotImplementedException;
34
35
36
37
38
39
40
41
42
43
44 public class ImmutableEntry implements Entry
45 {
46
47 private static final long serialVersionUID = 2L;
48
49
50 private Entry entry;
51
52
53
54
55
56
57
58
59
60
61 public ImmutableEntry( Entry entry )
62 {
63 this.entry = entry;
64 }
65
66
67
68
69
70
71
72
73 public Entry add( AttributeType attributeType, byte[]... values ) throws LdapException
74 {
75 new Exception().printStackTrace();
76 throw new NotImplementedException( "Cannot add an attribute : the entry " + entry.getDn() + " is immutable." );
77 }
78
79
80
81
82
83 public Entry add( AttributeType attributeType, String... values ) throws LdapException
84 {
85 new Exception().printStackTrace();
86 throw new NotImplementedException( "Cannot add an attribute : the entry " + entry.getDn() + " is immutable." );
87 }
88
89
90
91
92
93 public Entry add( AttributeType attributeType, Value<?>... values ) throws LdapException
94 {
95 new Exception().printStackTrace();
96 throw new NotImplementedException( "Cannot add an attribute : the entry " + entry.getDn() + " is immutable." );
97 }
98
99
100
101
102
103 public Entry add( String upId, AttributeType attributeType, byte[]... values ) throws LdapException
104 {
105 new Exception().printStackTrace();
106 throw new NotImplementedException( "Cannot add an attribute : the entry " + entry.getDn() + " is immutable." );
107 }
108
109
110
111
112
113 public Entry add( String upId, AttributeType attributeType, Value<?>... values ) throws LdapException
114 {
115 new Exception().printStackTrace();
116 throw new NotImplementedException( "Cannot add an attribute : the entry " + entry.getDn() + " is immutable." );
117 }
118
119
120
121
122
123 public Entry add( String upId, AttributeType attributeType, String... values ) throws LdapException
124 {
125 new Exception().printStackTrace();
126 throw new NotImplementedException( "Cannot add an attribute : the entry " + entry.getDn() + " is immutable." );
127 }
128
129
130
131
132
133 public Entry add( Attribute... attributes ) throws LdapException
134 {
135 new Exception().printStackTrace();
136 throw new NotImplementedException( "Cannot add an attribute : the entry " + entry.getDn() + " is immutable." );
137 }
138
139
140
141
142
143 public Entry add( String upId, byte[]... values ) throws LdapException
144 {
145 new Exception().printStackTrace();
146 throw new NotImplementedException( "Cannot add an attribute : the entry " + entry.getDn() + " is immutable." );
147 }
148
149
150
151
152
153 public Entry add( String upId, String... values ) throws LdapException
154 {
155 new Exception().printStackTrace();
156 throw new NotImplementedException( "Cannot add an attribute : the entry " + entry.getDn() + " is immutable." );
157 }
158
159
160
161
162
163 public Entry add( String upId, Value<?>... values ) throws LdapException
164 {
165 new Exception().printStackTrace();
166 throw new NotImplementedException( "Cannot add an attribute : the entry " + entry.getDn() + " is immutable." );
167 }
168
169
170
171
172
173
174
175 public Entry clone()
176 {
177 return entry.clone();
178 }
179
180
181
182
183
184 public Entry shallowClone()
185 {
186 return entry.shallowClone();
187 }
188
189
190
191
192
193 public boolean contains( Attribute... attributes )
194 {
195 return entry.contains( attributes );
196 }
197
198
199
200
201
202 public boolean containsAttribute( String... attributes )
203 {
204 return entry.containsAttribute( attributes );
205 }
206
207
208
209
210
211 public boolean containsAttribute( AttributeType attributeType )
212 {
213 return entry.containsAttribute( attributeType );
214 }
215
216
217
218
219
220 public boolean contains( AttributeType attributeType, byte[]... values )
221 {
222 return entry.contains( attributeType, values );
223 }
224
225
226
227
228
229 public boolean contains( AttributeType attributeType, String... values )
230 {
231 return entry.contains( attributeType, values );
232 }
233
234
235
236
237
238 public boolean contains( AttributeType attributeType, Value<?>... values )
239 {
240 return entry.contains( attributeType, values );
241 }
242
243
244
245
246
247 public boolean contains( String upId, byte[]... values )
248 {
249 return entry.contains( upId, values );
250 }
251
252
253
254
255
256 public boolean contains( String upId, String... values )
257 {
258 return entry.contains( upId, values );
259 }
260
261
262
263
264
265 public boolean contains( String upId, Value<?>... values )
266 {
267 return entry.contains( upId, values );
268 }
269
270
271
272
273
274 public Attribute get( String alias )
275 {
276 return entry.get( alias );
277 }
278
279
280
281
282
283 public Attribute get( AttributeType attributeType )
284 {
285 return entry.get( attributeType );
286 }
287
288
289
290
291
292 public Collection<Attribute> getAttributes()
293 {
294 return entry.getAttributes();
295 }
296
297
298
299
300
301 public Attribute put( String upId, byte[]... values )
302 {
303 new Exception().printStackTrace();
304 throw new NotImplementedException( "Cannot put a value : the entry " + entry.getDn() + " is immutable." );
305 }
306
307
308
309
310
311 public Attribute put( String upId, String... values )
312 {
313 new Exception().printStackTrace();
314 throw new NotImplementedException( "Cannot put a value : the entry " + entry.getDn() + " is immutable." );
315 }
316
317
318
319
320
321 public Attribute put( String upId, Value<?>... values )
322 {
323 new Exception().printStackTrace();
324 throw new NotImplementedException( "Cannot put a value : the entry " + entry.getDn() + " is immutable." );
325 }
326
327
328
329
330
331 public List<Attribute> put( Attribute... attributes ) throws LdapException
332 {
333 new Exception().printStackTrace();
334 throw new NotImplementedException( "Cannot put a value : the entry " + entry.getDn() + " is immutable." );
335 }
336
337
338
339
340
341 public Attribute put( AttributeType attributeType, byte[]... values ) throws LdapException
342 {
343 new Exception().printStackTrace();
344 throw new NotImplementedException( "Cannot put a value : the entry " + entry.getDn() + " is immutable." );
345 }
346
347
348
349
350
351 public Attribute put( AttributeType attributeType, String... values ) throws LdapException
352 {
353 new Exception().printStackTrace();
354 throw new NotImplementedException( "Cannot put a value : the entry " + entry.getDn() + " is immutable." );
355 }
356
357
358
359
360
361 public Attribute put( AttributeType attributeType, Value<?>... values ) throws LdapException
362 {
363 new Exception().printStackTrace();
364 throw new NotImplementedException( "Cannot put a value : the entry " + entry.getDn() + " is immutable." );
365 }
366
367
368
369
370
371 public Attribute put( String upId, AttributeType attributeType, byte[]... values ) throws LdapException
372 {
373 new Exception().printStackTrace();
374 throw new NotImplementedException( "Cannot put a value : the entry " + entry.getDn() + " is immutable." );
375 }
376
377
378
379
380
381 public Attribute put( String upId, AttributeType attributeType, String... values ) throws LdapException
382 {
383 new Exception().printStackTrace();
384 throw new NotImplementedException( "Cannot put a value : the entry " + entry.getDn() + " is immutable." );
385 }
386
387
388
389
390
391 public Attribute put( String upId, AttributeType attributeType, Value<?>... values ) throws LdapException
392 {
393 new Exception().printStackTrace();
394 throw new NotImplementedException( "Cannot put a value : the entry " + entry.getDn() + " is immutable." );
395 }
396
397
398
399
400
401 public List<Attribute> remove( Attribute... attributes ) throws LdapException
402 {
403 new Exception().printStackTrace();
404 throw new NotImplementedException( "Cannot remove a value : the entry " + entry.getDn() + " is immutable." );
405 }
406
407
408
409
410
411 public boolean remove( AttributeType attributeType, byte[]... values ) throws LdapException
412 {
413 new Exception().printStackTrace();
414 throw new NotImplementedException( "Cannot remove a value : the entry " + entry.getDn() + " is immutable." );
415 }
416
417
418
419
420
421 public boolean remove( AttributeType attributeType, String... values ) throws LdapException
422 {
423 new Exception().printStackTrace();
424 throw new NotImplementedException( "Cannot remove a value : the entry " + entry.getDn() + " is immutable." );
425 }
426
427
428
429
430
431 public boolean remove( AttributeType attributeType, Value<?>... values ) throws LdapException
432 {
433 new Exception().printStackTrace();
434 throw new NotImplementedException( "Cannot remove a value : the entry " + entry.getDn() + " is immutable." );
435 }
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453 public void removeAttributes( AttributeType... attributes )
454 {
455 new Exception().printStackTrace();
456 throw new NotImplementedException( "Cannot remove a value : the entry " + entry.getDn() + " is immutable." );
457 }
458
459
460
461
462
463 public void removeAttributes( String... attributes )
464 {
465 new Exception().printStackTrace();
466 throw new NotImplementedException( "Cannot remove a value : the entry " + entry.getDn() + " is immutable." );
467 }
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491 public boolean remove( String upId, byte[]... values ) throws LdapException
492 {
493 new Exception().printStackTrace();
494 throw new NotImplementedException( "Cannot remove a value : the entry " + entry.getDn() + " is immutable." );
495 }
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519 public boolean remove( String upId, String... values ) throws LdapException
520 {
521 new Exception().printStackTrace();
522 throw new NotImplementedException( "Cannot remove a value : the entry " + entry.getDn() + " is immutable." );
523 }
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547 public boolean remove( String upId, Value<?>... values ) throws LdapException
548 {
549 new Exception().printStackTrace();
550 throw new NotImplementedException( "Cannot remove a value : the entry " + entry.getDn() + " is immutable." );
551 }
552
553
554
555
556
557
558
559 public Dn getDn()
560 {
561 return entry.getDn();
562 }
563
564
565
566
567
568 public void setDn( Dn dn )
569 {
570 new Exception().printStackTrace();
571 throw new NotImplementedException( "Cannot rename the entry " + entry.getDn() + " is immutable." );
572 }
573
574
575
576
577
578 public void setDn( String dn ) throws LdapInvalidDnException
579 {
580 new Exception().printStackTrace();
581 throw new NotImplementedException( "Cannot rename the entry " + entry.getDn() + " is immutable." );
582 }
583
584
585
586
587
588 public void clear()
589 {
590 new Exception().printStackTrace();
591 throw new NotImplementedException( "Cannot clear the entry " + entry.getDn() + " is immutable." );
592 }
593
594
595
596
597
598
599
600
601
602 public Iterator<Attribute> iterator()
603 {
604 return entry.iterator();
605 }
606
607
608
609
610
611
612
613 public int size()
614 {
615 return entry.size();
616 }
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638 public void writeExternal( ObjectOutput out ) throws IOException
639 {
640 entry.writeExternal( out );
641 }
642
643
644
645
646
647 public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
648 {
649 new Exception().printStackTrace();
650 throw new NotImplementedException( "Cannot read the entry " + entry.getDn() + " is immutable." );
651 }
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668 public void serialize( ObjectOutput out ) throws IOException
669 {
670 new Exception().printStackTrace();
671 throw new NotImplementedException( "Cannot serialize the entry " + entry.getDn() + " is immutable." );
672 }
673
674
675
676
677
678
679
680
681
682 public void deserialize( ObjectInput in ) throws IOException, ClassNotFoundException
683 {
684 new Exception().printStackTrace();
685 throw new NotImplementedException( "Cannot deserialize the entry " + entry.getDn() + " is immutable." );
686 }
687
688
689
690
691
692
693
694
695
696 public int hashCode()
697 {
698 return entry.hashCode();
699 }
700
701
702
703
704
705 public boolean hasObjectClass( String... objectClasses )
706 {
707 return entry.hasObjectClass( objectClasses );
708 }
709
710
711
712
713
714 public boolean hasObjectClass( Attribute... objectClasses )
715 {
716 return entry.hasObjectClass( objectClasses );
717 }
718
719
720
721
722
723 public boolean isSchemaAware()
724 {
725 return entry.isSchemaAware();
726 }
727
728
729
730
731
732 public boolean equals( Object o )
733 {
734 return entry.equals( o );
735 }
736
737
738
739
740
741 public String toString()
742 {
743 return entry.toString();
744 }
745
746
747
748
749
750 public String toString( String tabs )
751 {
752 return entry.toString( tabs );
753 }
754 }