1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.server.xdbm.search.evaluator;
21
22
23 import org.apache.directory.api.ldap.model.entry.Entry;
24 import org.apache.directory.api.ldap.model.exception.LdapException;
25 import org.apache.directory.api.ldap.model.filter.UndefinedNode;
26 import org.apache.directory.server.core.api.partition.PartitionTxn;
27 import org.apache.directory.server.xdbm.IndexEntry;
28 import org.apache.directory.server.xdbm.Store;
29 import org.apache.directory.server.xdbm.search.Evaluator;
30
31
32
33
34
35
36
37 public class PassThroughEvaluator implements Evaluator<UndefinedNode>
38 {
39
40 private final Store db;
41
42
43
44
45
46
47
48 public PassThroughEvaluator( Store db )
49 {
50 this.db = db;
51 }
52
53
54
55
56
57 public boolean evaluate( PartitionTxn partitionTxn, IndexEntry<?, String> indexEntry ) throws LdapException
58 {
59 Entry entry = indexEntry.getEntry();
60
61
62 if ( null == entry )
63 {
64 entry = db.fetch( partitionTxn, indexEntry.getId() );
65
66 if ( null == entry )
67 {
68
69 return false;
70 }
71
72 indexEntry.setEntry( entry );
73 }
74
75 return true;
76 }
77
78
79
80
81
82 public boolean evaluate( Entry entry ) throws LdapException
83 {
84 return true;
85 }
86
87
88
89
90
91
92
93 public UndefinedNode getExpression()
94 {
95 return null;
96 }
97
98
99
100
101
102 public String toString( String tabs )
103 {
104 StringBuilder sb = new StringBuilder();
105
106 sb.append( tabs ).append( "PassthroughEvaluator\n" );
107
108 return sb.toString();
109 }
110
111
112
113
114
115 public String toString()
116 {
117 return toString( "" );
118 }
119 }