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 import org.apache.directory.api.ldap.model.entry.Value;
23
24
25
26
27
28
29 public class ExtensibleMatchFilter extends Filter
30 {
31
32 private String matchingRule;
33
34
35 private String type;
36
37
38 private org.apache.directory.api.ldap.model.entry.Value matchValue;
39
40
41 private boolean dnAttributes = false;
42
43
44
45
46
47
48
49 public boolean isDnAttributes()
50 {
51 return dnAttributes;
52 }
53
54
55
56
57
58
59
60 public void setDnAttributes( boolean dnAttributes )
61 {
62 this.dnAttributes = dnAttributes;
63 }
64
65
66
67
68
69
70
71 public String getMatchingRule()
72 {
73 return matchingRule;
74 }
75
76
77
78
79
80
81
82 public void setMatchingRule( String matchingRule )
83 {
84 this.matchingRule = matchingRule;
85 }
86
87
88
89
90
91
92
93 public Value getMatchValue()
94 {
95 return matchValue;
96 }
97
98
99
100
101
102
103
104 public void setMatchValue( Value matchValue )
105 {
106 this.matchValue = matchValue;
107 }
108
109
110
111
112
113
114
115 public String getType()
116 {
117 return type;
118 }
119
120
121
122
123
124
125
126 public void setType( String type )
127 {
128 this.type = type;
129 }
130
131
132
133
134
135
136
137 @Override
138 public String toString()
139 {
140 StringBuilder sb = new StringBuilder();
141
142 if ( type != null )
143 {
144 sb.append( type );
145 }
146
147 if ( dnAttributes )
148 {
149 sb.append( ":dn" );
150 }
151
152 if ( matchingRule == null )
153 {
154
155 if ( type == null )
156 {
157 return "Extended Filter wrong syntax";
158 }
159 }
160 else
161 {
162 sb.append( ':' ).append( matchingRule );
163 }
164
165 sb.append( ":=" ).append( matchValue );
166
167 return sb.toString();
168 }
169 }