/// <summary>
 ///     Constructs a new LdapConstraints object specifying constraints that
 ///     control wait time, and referral handling.
 /// </summary>
 /// <param name="msLimit">
 ///     The maximum time in milliseconds to wait for results.
 ///     The default is 0, which means that there is no
 ///     maximum time limit. This limit is enforced for an
 ///     operation by the API, not by the server.
 ///     The operation will be abandoned and terminated by the
 ///     API with a result code of LdapException.Ldap_TIMEOUT
 ///     if the operation exceeds the time limit.
 /// </param>
 /// <param name="doReferrals">
 ///     Determines whether to automatically follow
 ///     referrals or not. Specify true to follow
 ///     referrals automatically, and false to throw
 ///     an LdapReferralException if the server responds
 ///     with a referral. False is the default value.
 ///     The way referrals are followed automatically is
 ///     determined by the setting of the handler parameter.
 ///     It is ignored for asynchronous operations.
 /// </param>
 /// <param name="handler">
 ///     The custom authentication handler called when
 ///     LdapConnection needs to authenticate, typically on
 ///     following a referral.  A null may be specified to
 ///     indicate default authentication processing, i.e.
 ///     referrals are followed with anonymous authentication.
 ///     The handler object may be an implemention of either the
 ///     LdapBindHandler or LdapAuthHandler interface.
 ///     The implementation of these interfaces determines how
 ///     authentication is performed when following referrals.
 ///     It is ignored for asynchronous operations.
 /// </param>
 /// <param name="hop_limit">
 ///     The maximum number of referrals to follow in a
 ///     sequence during automatic referral following.
 ///     The default value is 10. A value of 0 means no limit.
 ///     The operation will be abandoned and terminated by the
 ///     API with a result code of
 ///     LdapException.REFERRAL_LIMIT_EXCEEDED if the
 ///     number of referrals in a sequence exceeds the limit.
 ///     It is ignored for asynchronous operations.
 /// </param>
 /// <seealso cref="LdapException.LdapTimeout">
 /// </seealso>
 /// <seealso cref="LdapException.ReferralLimitExceeded">
 /// </seealso>
 /// <seealso cref="LdapException.Referral">
 /// </seealso>
 /// <seealso cref="LdapReferralException">
 /// </seealso>
 /// <seealso cref="ILdapBindHandler">
 /// </seealso>
 /// <seealso cref="ILdapAuthHandler">
 /// </seealso>
 public LdapConstraints(int msLimit, bool doReferrals, ILdapReferralHandler handler, int hopLimit)
 {
     TimeLimit         = msLimit;
     ReferralFollowing = doReferrals;
     _refHandler       = handler;
     HopLimit          = hopLimit;
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     Constructs a new LdapSearchConstraints object and allows the
 ///     specification operational constraints in that object.
 /// </summary>
 /// <param name="msLimit">
 ///     The maximum time in milliseconds to wait for results.
 ///     The default is 0, which means that there is no
 ///     maximum time limit. This limit is enforced for an
 ///     operation by the API, not by the server.
 ///     The operation will be abandoned and terminated by the
 ///     API with an LdapException.Ldap_TIMEOUT if the
 ///     operation exceeds the time limit.
 /// </param>
 /// <param name="serverTimeLimit">
 ///     The maximum time in seconds that the server
 ///     should spend returning search results. This is a
 ///     server-enforced limit.  The default of 0 means
 ///     no time limit.
 ///     The operation will be terminated by the server with an
 ///     LdapException.TIME_LIMIT_EXCEEDED if the search
 ///     operation exceeds the time limit.
 /// </param>
 /// <param name="dereference">
 ///     Specifies when aliases should be dereferenced.
 ///     Must be either DEREF_NEVER, DEREF_FINDING,
 ///     DEREF_SEARCHING, or DEREF_ALWAYS from this class.
 ///     Default: DEREF_NEVER.
 /// </param>
 /// <param name="maxResults">
 ///     The maximum number of search results to return
 ///     for a search request.
 ///     The search operation will be terminated by the server
 ///     with an LdapException.SIZE_LIMIT_EXCEEDED if the
 ///     number of results exceed the maximum.
 ///     Default: 1000.
 /// </param>
 /// <param name="doReferrals">
 ///     Determines whether to automatically follow
 ///     referrals or not. Specify true to follow
 ///     referrals automatically, and false to throw
 ///     an LdapException.REFERRAL if the server responds
 ///     with a referral.
 ///     It is ignored for asynchronous operations.
 ///     Default: false.
 /// </param>
 /// <param name="batchSize">
 ///     The number of results to return in a batch. Specifying
 ///     0 means to block until all results are received.
 ///     Specifying 1 means to return results one result at a
 ///     time.  Default: 1.
 /// </param>
 /// <param name="handler">
 ///     The custom authentication handler called when
 ///     LdapConnection needs to authenticate, typically on
 ///     following a referral.  A null may be specified to
 ///     indicate default authentication processing, i.e.
 ///     referrals are followed with anonymous authentication.
 ///     ThE object may be an implemention of either the
 ///     the LdapBindHandler or LdapAuthHandler interface.
 ///     It is ignored for asynchronous operations.
 /// </param>
 /// <param name="hop_limit">
 ///     The maximum number of referrals to follow in a
 ///     sequence during automatic referral following.
 ///     The default value is 10. A value of 0 means no limit.
 ///     It is ignored for asynchronous operations.
 ///     The operation will be abandoned and terminated by the
 ///     API with an LdapException.REFERRAL_LIMIT_EXCEEDED if the
 ///     number of referrals in a sequence exceeds the limit.
 /// </param>
 /// <seealso cref="LdapException.LdapTimeout">
 /// </seealso>
 /// <seealso cref="LdapException.Referral">
 /// </seealso>
 /// <seealso cref="LdapException.SizeLimitExceeded">
 /// </seealso>
 /// <seealso cref="LdapException.TimeLimitExceeded">
 /// </seealso>
 public LdapSearchConstraints(int msLimit, int serverTimeLimit, int dereference, int maxResults,
                              bool doReferrals,
                              int batchSize, ILdapReferralHandler handler, int hopLimit)
     : base(msLimit, doReferrals, handler, hopLimit)
 {
     ServerTimeLimit = serverTimeLimit;
     Dereference     = dereference;
     MaxResults      = maxResults;
     BatchSize       = batchSize;
 }