001    /*
002     * Copyright 2007-2016 UnboundID Corp.
003     * All Rights Reserved.
004     */
005    /*
006     * Copyright (C) 2008-2016 UnboundID Corp.
007     *
008     * This program is free software; you can redistribute it and/or modify
009     * it under the terms of the GNU General Public License (GPLv2 only)
010     * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011     * as published by the Free Software Foundation.
012     *
013     * This program is distributed in the hope that it will be useful,
014     * but WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016     * GNU General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with this program; if not, see <http://www.gnu.org/licenses>.
020     */
021    package com.unboundid.ldap.sdk;
022    
023    
024    
025    import java.util.List;
026    
027    
028    
029    
030    /**
031     * This interface defines a set of methods that may be safely called in an LDAP
032     * search request without altering its contents.  This interface must not be
033     * implemented by any class other than {@code SearchRequest}.
034     * <BR><BR>
035     * This interface does not inherently provide the assurance of thread safety for
036     * the methods that it exposes, because it is still possible for a thread
037     * referencing the object which implements this interface to alter the request
038     * using methods not included in this interface.  However, if it can be
039     * guaranteed that no thread will alter the underlying object, then the methods
040     * exposed by this interface can be safely invoked concurrently by any number of
041     * threads.
042     */
043    public interface ReadOnlySearchRequest
044           extends ReadOnlyLDAPRequest
045    {
046      /**
047       * Retrieves the base DN for this search request.
048       *
049       * @return  The base DN for this search request.
050       */
051      String getBaseDN();
052    
053    
054    
055      /**
056       * Retrieves the scope for this search request.
057       *
058       * @return  The scope for this search request.
059       */
060      SearchScope getScope();
061    
062    
063    
064      /**
065       * Retrieves the dereference policy that should be used by the server for any
066       * aliases encountered during search processing.
067       *
068       * @return  The dereference policy that should be used by the server for any
069       *          aliases encountered during search processing.
070       */
071      DereferencePolicy getDereferencePolicy();
072    
073    
074    
075      /**
076       * Retrieves the maximum number of entries that should be returned by the
077       * server when processing this search request.
078       *
079       * @return  The maximum number of entries that should be returned by the
080       *          server when processing this search request, or zero if there is
081       *          no limit.
082       */
083      int getSizeLimit();
084    
085    
086    
087      /**
088       * Retrieves the maximum length of time in seconds that the server should
089       * spend processing this search request.
090       *
091       * @return  The maximum length of time in seconds that the server should
092       *          spend processing this search request, or zero if there is no
093       *          limit.
094       */
095      int getTimeLimitSeconds();
096    
097    
098    
099      /**
100       * Indicates whether the server should return only attribute names in matching
101       * entries, rather than both names and values.
102       *
103       * @return  {@code true} if matching entries should include only attribute
104       *          names, or {@code false} if matching entries should include both
105       *          attribute names and values.
106       */
107      boolean typesOnly();
108    
109    
110    
111      /**
112       * Retrieves the filter that should be used to identify matching entries.
113       *
114       * @return  The filter that should be used to identify matching entries.
115       */
116      Filter getFilter();
117    
118    
119    
120      /**
121       * Retrieves the set of requested attributes to include in matching entries.
122       *
123       * @return  The set of requested attributes to include in matching entries, or
124       *          an empty array if the default set of attributes (all user
125       *          attributes but no operational attributes) should be requested.
126       */
127      List<String> getAttributeList();
128    
129    
130    
131      /**
132       * {@inheritDoc}
133       */
134      SearchRequest duplicate();
135    
136    
137    
138      /**
139       * {@inheritDoc}
140       */
141      SearchRequest duplicate(final Control[] controls);
142    }