KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ldap > server > invocation > Search


1 /*
2  * Copyright 2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17 package org.apache.ldap.server.invocation;
18
19
20 import org.apache.ldap.common.filter.ExprNode;
21 import org.apache.ldap.server.BackingStore;
22
23 import javax.naming.Name JavaDoc;
24 import javax.naming.NamingException JavaDoc;
25 import javax.naming.directory.SearchControls JavaDoc;
26 import java.util.Map JavaDoc;
27
28
29 /**
30  * Represents an {@link Invocation} on {@link BackingStore#search(Name, Map, ExprNode, SearchControls)}.
31  *
32  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
33  * @version $Rev: 169198 $, $Date: 2005-05-08 20:05:59 -0400 (Sun, 08 May 2005) $
34  */

35 public class Search extends Invocation
36 {
37     private static final long serialVersionUID = 3258410651234678579L;
38
39     private Name JavaDoc baseName;
40
41     private final Map JavaDoc environment;
42
43     private final ExprNode filter;
44
45     private final SearchControls JavaDoc controls;
46
47
48     public Search( Name JavaDoc baseName, Map JavaDoc environment, ExprNode filters,
49                    SearchControls JavaDoc controls )
50     {
51         if ( baseName == null )
52         {
53             throw new NullPointerException JavaDoc( "baseName" );
54         }
55         if ( environment == null )
56         {
57             throw new NullPointerException JavaDoc( "environment" );
58         }
59         if ( filters == null )
60         {
61             throw new NullPointerException JavaDoc( "filter" );
62         }
63         if ( controls == null )
64         {
65             throw new NullPointerException JavaDoc( "controls" );
66         }
67
68         this.baseName = baseName;
69
70         this.environment = environment;
71
72         this.filter = filters;
73
74         this.controls = controls;
75     }
76
77
78     public Name JavaDoc getBaseName()
79     {
80         return baseName;
81     }
82
83
84     public Map JavaDoc getEnvironment()
85     {
86         return environment;
87     }
88
89
90     public ExprNode getFilter()
91     {
92         return filter;
93     }
94
95
96     public SearchControls JavaDoc getControls()
97     {
98         return controls;
99     }
100
101
102     protected Object JavaDoc doExecute( BackingStore store ) throws NamingException JavaDoc
103     {
104         return store.search( baseName, environment, filter, controls );
105     }
106
107
108     public void setBaseName( Name JavaDoc baseName )
109     {
110         this.baseName = baseName;
111     }
112 }
113
Popular Tags