1 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 ; 24 import javax.naming.NamingException ; 25 import javax.naming.directory.SearchControls ; 26 import java.util.Map ; 27 28 29 35 public class Search extends Invocation 36 { 37 private static final long serialVersionUID = 3258410651234678579L; 38 39 private Name baseName; 40 41 private final Map environment; 42 43 private final ExprNode filter; 44 45 private final SearchControls controls; 46 47 48 public Search( Name baseName, Map environment, ExprNode filters, 49 SearchControls controls ) 50 { 51 if ( baseName == null ) 52 { 53 throw new NullPointerException ( "baseName" ); 54 } 55 if ( environment == null ) 56 { 57 throw new NullPointerException ( "environment" ); 58 } 59 if ( filters == null ) 60 { 61 throw new NullPointerException ( "filter" ); 62 } 63 if ( controls == null ) 64 { 65 throw new NullPointerException ( "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 getBaseName() 79 { 80 return baseName; 81 } 82 83 84 public Map getEnvironment() 85 { 86 return environment; 87 } 88 89 90 public ExprNode getFilter() 91 { 92 return filter; 93 } 94 95 96 public SearchControls getControls() 97 { 98 return controls; 99 } 100 101 102 protected Object doExecute( BackingStore store ) throws NamingException 103 { 104 return store.search( baseName, environment, filter, controls ); 105 } 106 107 108 public void setBaseName( Name baseName ) 109 { 110 this.baseName = baseName; 111 } 112 } 113 | Popular Tags |