New ldaptive search executor search executor.

@param baseDn           the base dn
@param filterQuery      the filter query
@param params           the params
@param returnAttributes the return attributes
@return the search executor
11027
public static SearchExecutor newLdaptiveSearchExecutor(final String baseDn, final String filterQuery,
                                                           final List<String> params,
                                                           final List<String> returnAttributes) {
        return newLdaptiveSearchExecutor(baseDn, filterQuery, params, returnAttributes.toArray(ArrayUtils.EMPTY_STRING_ARRAY));
    }
887497
public Query<S> query(Filter<S> filter, OrderingList<S> ordering, QueryHints hints)
        throws FetchException
    {
        filter = filter.bind();

        Map<OrderingList<S>, Query<S>> map;
        synchronized (mFilterToQuery) {
            map = mFilterToQuery.get(filter);
            if (map == null) {
                if (filter == null) {
                    throw new IllegalArgumentException("Query filter must not be null");
                }
                map = new SoftValuedHashMap(7);
                mFilterToQuery.put(filter, map);
            }
        }

        Query<S> query;
        synchronized (map) {
            query = map.get(ordering);
            if (query == null) {
                FilterValues<S> values = filter.initialFilterValues();
                if (values == null && filter.isClosed()) {
                    query = new EmptyQuery<S>(this, ordering);
                } else {
                    StandardQuery<S> standardQuery = createQuery(filter, values, ordering, hints);
                    if (!mLazySetExecutor) {
                        try {
                            standardQuery.setExecutor();
                        } catch (RepositoryException e) {
                            throw e.toFetchException();
                        }
                    }
                    query = standardQuery;
                }
                map.put(ordering, query);
            }
        }

        return query;
    }
838158
public <T> List<T> search(Class<T> managedClass, Name base, String filter, SearchControls scope) {
        Filter searchFilter = null;
        if(StringUtils.hasText(filter)) {
            searchFilter = new HardcodedFilter(filter);
        }

        return ldapTemplate.find(base, searchFilter, scope, managedClass);
    }
1246762
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
    public Searcher addBooleanFilter(String attribute, Boolean value) {
        booleanFilterMap.put(attribute, value);
        rebuildQueryFacetFilters();
        return this;
    }
13395
static Map<String, String> findQueryParams(String baseParam, Method method) {
        Map<String, String> hrefVars = new HashMap<>();
        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
        for (int i = 0; i < parameterAnnotations.length; i++) {
            Annotation[] paramAnnotations = parameterAnnotations[i];
            for (Annotation paramAnnotation : paramAnnotations) {
                Class<?> parameterClass = method.getParameterTypes()[i];
                hrefVars.putAll(findQueryParamOnParameter(baseParam, parameterClass, paramAnnotation));
            }
        }
        return hrefVars;
    }
502671
public <ResultT> ResultT findOne(final Bson filter, final Class<ResultT> resultClass) {
    return proxy.findOne(filter, resultClass);
  }
1099818
def search(self, base, scope, filterstr='(objectClass=*)',
               attrlist=None, limit=None) -> Generator[Tuple[str, dict], None, None]:
        

        _debug("search", base, scope, filterstr, attrlist, limit)

        # first results
        if attrlist is None:
            attrlist = ldap3.ALL_ATTRIBUTES
        elif isinstance(attrlist, set):
            attrlist = list(attrlist)

        def first_results(obj):
            _debug("---> searching ldap", limit)
            obj.search(
                base, filterstr, scope, attributes=attrlist, paged_size=limit)
            return obj.response

        # get the 1st result
        result_list = self._do_with_retry(first_results)

        # Loop over list of search results
        for result_item in result_list:
            # skip searchResRef for now
            if result_item['type'] != "searchResEntry":
                continue
            dn = result_item['dn']
            attributes = result_item['raw_attributes']
            # did we already retrieve this from cache?
            _debug("---> got ldap result", dn)
            _debug("---> yielding", result_item)
            yield (dn, attributes)

        # we are finished - return results, eat cake
        _debug("---> done")
        return
1121564
private Response<SearchResult> searchForServiceById(final Long id) throws LdapException {
        val filter = LdapUtils.newLdaptiveSearchFilter(this.searchFilter,
            LdapUtils.LDAP_SEARCH_FILTER_DEFAULT_PARAM_NAME, CollectionUtils.wrap(id.toString()));
        return LdapUtils.executeSearchOperation(this.connectionFactory, this.baseDn, filter);
    }
141269
public function search($params)
    {
        $query = ShopAttributeValue::find()->where(['attribute_id' => $params['attrId']]);

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'attribute_id' => $this->attribute_id,
        ]);

//        $query->andFilterWhere(['like', 'value', $this->value]);

        return $dataProvider;
    }
347037
public boolean performBooleanQuery(String queryString, SPARQLQueryBindingSet bindings, Transaction tx, boolean includeInferred, String baseURI) {
        SPARQLQueryDefinition qdef = sparqlManager.newQueryDefinition(queryString);
        if(notNull(baseURI) && !baseURI.isEmpty()){ qdef.setBaseUri(baseURI);}
        qdef.setIncludeDefaultRulesets(includeInferred);
        if (notNull(ruleset)) {qdef.setRulesets(ruleset);}
        if (notNull(getConstrainingQueryDefinition())){
        	qdef.setConstrainingQueryDefinition(getConstrainingQueryDefinition());
            qdef.setDirectory(getConstrainingQueryDefinition().getDirectory());
            qdef.setCollections(getConstrainingQueryDefinition().getCollections());
            qdef.setResponseTransform(getConstrainingQueryDefinition().getResponseTransform());
            qdef.setOptionsName(getConstrainingQueryDefinition().getOptionsName());
        	}
        if(notNull(graphPerms)){ qdef.setUpdatePermissions(graphPerms);}
        return sparqlManager.executeAsk(qdef,tx);
    }
629288
def ldap_search(self, filter, attributes, incremental, incremental_filter):
        
        for uri in self.conf_LDAP_SYNC_BIND_URI:
            #Read record of this uri
            if (self.working_uri == uri):
                adldap_sync = self.working_adldap_sync
                created = False
            else:
                adldap_sync, created = ADldap_Sync.objects.get_or_create(ldap_sync_uri=uri)

            if ((adldap_sync.syncs_to_full > 0) and incremental):
                filter_to_use = incremental_filter.replace('?', self.whenchanged.strftime(self.conf_LDAP_SYNC_INCREMENTAL_TIMESTAMPFORMAT))
                logger.debug("Using an incremental search. Filter is:'%s'" % filter_to_use)
            else:
                filter_to_use = filter

            ldap.set_option(ldap.OPT_REFERRALS, 0)
            #ldap.set_option(ldap.OPT_NETWORK_TIMEOUT, 10)
            l = PagedLDAPObject(uri)
            l.protocol_version = 3

            if (uri.startswith('ldaps:')):
                l.set_option(ldap.OPT_X_TLS, ldap.OPT_X_TLS_DEMAND)
                l.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND)
                l.set_option(ldap.OPT_X_TLS_DEMAND, True)
            else:
                l.set_option(ldap.OPT_X_TLS, ldap.OPT_X_TLS_NEVER)
                l.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
                l.set_option(ldap.OPT_X_TLS_DEMAND, False)
            try:
                l.simple_bind_s(self.conf_LDAP_SYNC_BIND_DN, self.conf_LDAP_SYNC_BIND_PASS)
            except ldap.LDAPError as e:
                logger.error("Error connecting to LDAP server %s : %s" % (uri, e))
                continue

            results = l.paged_search_ext_s(self.conf_LDAP_SYNC_BIND_SEARCH, ldap.SCOPE_SUBTREE, filter_to_use, attrlist=attributes, serverctrls=None)
            l.unbind_s()
            if (self.working_uri is None):
                self.working_uri = uri
                self.conf_LDAP_SYNC_BIND_URI.insert(0, uri)
                self.working_adldap_sync = adldap_sync

            return (uri, results)  # Return both the LDAP server URI used and the request. This is for incremental sync purposes
        #if not connected correctly, raise error
        raise
814924
function addonsManager_waitForSearchFilter(aSpec) {
    var spec = aSpec || { };
    var filter = spec.filter;
    var timeout = (spec.timeout == undefined) ? TIMEOUT : spec.timeout;

    if (!filter)
      throw new Error(arguments.callee.name + ": Search filter not specified.");

    // TODO: restore after 1.5.1 has landed
    // var self = this;
    // 
    // mozmill.utils.waitFor(function () {
    //   return self.selectedSearchFilter.getNode() == filter.getNode();
    // }, timeout, 100, "Search filter '" + filter.getNode().value + "' has been set");
    
    mozmill.utils.waitForEval("subject.self.selectedSearchFilter.getNode() == subject.aFilter.getNode()",
                              timeout, 100,
                              {self: this, aFilter: filter});
  }
1345554
protected function searchForOneNode(Filter\AbstractFilter $filter, $attributes = null, $searchScope = Connection::SEARCH_SCOPE_SUB, $maxFilterTime = 0)
    {
        $results = $this->searchNodes($filter, $attributes, $searchScope, 1, $maxFilterTime);

        if ($results->count() === 0) {
            return null;
        }

        return $results->getFirst();
    }
163536
def _base_query(self, session):
        
        return session.query(ORMTargetMarker) \
            .filter(ORMTargetMarker.name == self.name) \
            .filter(ORMTargetMarker.params == self.params)
1060350
@SneakyThrows
    protected boolean executeSearchForSpnegoAttribute(final String remoteIp) {
        val remoteHostName = getRemoteHostName(remoteIp);
        LOGGER.debug("Resolved remote hostname [{}] based on ip [{}]", remoteHostName, remoteIp);

        try (val connection = createConnection()) {
            val searchOperation = new SearchOperation(connection);
            this.searchRequest.getSearchFilter().setParameter("host", remoteHostName);

            LOGGER.debug("Using search filter [{}] on baseDn [{}]",
                this.searchRequest.getSearchFilter().format(),
                this.searchRequest.getBaseDn());

            val searchResult = searchOperation.execute(this.searchRequest);
            if (searchResult.getResultCode() == ResultCode.SUCCESS) {
                return processSpnegoAttribute(searchResult);
            }
            throw new IllegalArgumentException("Failed to establish a connection ldap. " + searchResult.getMessage());
        }
    }
654799
function querySearch (query) {
      var results = query ? self.states.filter(createFilterFor(query)) : self.states,
          deferred;
      if (self.simulateQuery) {
        deferred = $q.defer();
        $timeout(function () { deferred.resolve(results); }, Math.random() * 1000, false);
        return deferred.promise;
      } else {
        return results;
      }
    }
209439
public <ResultT> ResultT findOne(final Bson filter, final Class<ResultT> resultClass) {
    return executeFindOne(filter, null, resultClass);
  }