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.codec.controls.sort;
21
22
23 import org.apache.directory.api.asn1.ber.AbstractContainer;
24 import org.apache.directory.api.ldap.codec.api.LdapApiService;
25 import org.apache.directory.api.ldap.model.message.controls.SortResponse;
26
27
28
29
30
31
32
33 public class SortResponseContainer extends AbstractContainer
34 {
35
36 private SortResponseDecorator control;
37
38
39 private LdapApiService codec;
40
41
42
43
44
45
46
47 public SortResponseContainer( LdapApiService codec )
48 {
49 super();
50 this.codec = codec;
51 setGrammar( SortResponseGrammar.getInstance() );
52 setTransition( SortResponseStates.START_STATE );
53 }
54
55
56
57
58
59
60
61
62 public SortResponseContainer( LdapApiService codec, SortResponse control )
63 {
64 this( codec );
65 decorate( control );
66 }
67
68
69
70
71
72
73
74 public void decorate( SortResponse control )
75 {
76 if ( control instanceof SortResponseDecorator )
77 {
78 this.control = ( SortResponseDecorator ) control;
79 }
80 else
81 {
82 this.control = new SortResponseDecorator( codec, control );
83 }
84 }
85
86
87
88
89
90 public SortResponseDecorator getControl()
91 {
92 return control;
93 }
94
95
96
97
98
99 public void setControl( SortResponseDecorator control )
100 {
101 this.control = control;
102 }
103
104
105
106
107
108 @Override
109 public void clean()
110 {
111 super.clean();
112 control = null;
113 }
114 }