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