@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class MatchingEntryCountRequestControl extends Control
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
true
or false
. It must include a value with the following
encoding:
MatchingEntryCountRequest ::= SEQUENCE { maxCandidatesToExamine [0] INTEGER (0 .. MAX) DEFAULT 0, alwaysExamineCandidates [1] BOOLEAN DEFAULT FALSE, processSearchIfUnindexed [2] BOOLEAN DEFAULT FALSE, includeDebugInfo [3] BOOLEAN DEFAULT FALSE, skipResolvingExplodedIndexes [4] BOOLEAN DEFAULT FALSE, fastShortCircuitThreshold [5] INTEGER (0 .. MAX) OPTIONAL, slowShortCircuitThreshold [6] INTEGER (0 .. MAX) OPTIONAL, includeExtendedResponseData [7] BOOLEAN DEFAULT FALSE, ... }
MatchingEntryCountResponseControl
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTENDED_RESPONSE_DATA_FEATURE_OID
The OID (1.3.6.1.4.1.30221.2.12.7) for the supportedFeature value that a
server should advertise in its root DSE if it supports returning extended
information in the response control that older clients may not be able to
handle.
|
static java.lang.String |
MATCHING_ENTRY_COUNT_REQUEST_OID
The OID (1.3.6.1.4.1.30221.2.5.36) for the matching entry count request
control.
|
Constructor and Description |
---|
MatchingEntryCountRequestControl()
Creates a new matching entry count request control with the default
settings.
|
MatchingEntryCountRequestControl(boolean isCritical,
int maxCandidatesToExamine,
boolean alwaysExamineCandidates,
boolean processSearchIfUnindexed,
boolean includeDebugInfo)
Creates a new matching entry count request control with the provided
information.
|
MatchingEntryCountRequestControl(boolean isCritical,
int maxCandidatesToExamine,
boolean alwaysExamineCandidates,
boolean processSearchIfUnindexed,
boolean skipResolvingExplodedIndexes,
java.lang.Long fastShortCircuitThreshold,
java.lang.Long slowShortCircuitThreshold,
boolean includeDebugInfo)
Creates a new matching entry count request control with the provided
information.
|
MatchingEntryCountRequestControl(boolean isCritical,
MatchingEntryCountRequestControlProperties properties)
Creates a new matching entry count request control with the provided
properties.
|
MatchingEntryCountRequestControl(Control control)
Creates a new matching entry count request control that is decoded from the
provided generic control.
|
Modifier and Type | Method and Description |
---|---|
boolean |
alwaysExamineCandidates()
Indicates whether the server should always examine candidate entries in
fully-indexed searches to determine whether they would actually be returned
to the client in a normal search with the same criteria.
|
static MatchingEntryCountRequestControl |
decodeJSONControl(JSONObject controlObject,
boolean strict)
Attempts to decode the provided object as a JSON representation of a
matching entry count request control.
|
java.lang.String |
getControlName()
Retrieves the user-friendly name for this control, if available.
|
java.lang.Long |
getFastShortCircuitThreshold()
Retrieves the short-circuit threshold that the server should use when
determining whether to continue with index processing in an attempt to
further pare down a candidate set that already has a defined superset of
the entries that actually match the filter.
|
int |
getMaxCandidatesToExamine()
Retrieves the maximum number of candidate entries that should be examined
in order to determine accurate count of the number of matching entries.
|
java.lang.Long |
getSlowShortCircuitThreshold()
Retrieves the short-circuit threshold that the server should use when
determining whether to continue with index processing in an attempt to
further pare down a candidate set that already has a defined superset of
the entries that actually match the filter.
|
boolean |
includeDebugInfo()
Indicates whether the server should include debug information in the
response control that provides additional information about how the server
arrived at the result.
|
boolean |
includeExtendedResponseData()
Indicates whether the server may include extended response data in the
corresponding response control, which may provide information like whether
all of the identified candidate entries are within the scope of the search
and any unindexed or unevaluated portion of the search filter.
|
boolean |
processSearchIfUnindexed()
Indicates whether the server should internally retrieve and examine all
entries within the search scope in order to obtain an exact matching entry
count for an unindexed search.
|
static boolean |
serverSupportsExtendedResponseData(LDAPInterface connection)
Attempts to determine whether the server to which the provided connection
is established supports including extended response data in the matching
entry count response control.
|
static boolean |
serverSupportsExtendedResponseData(RootDSE rootDSE)
Determines whether the provided root DSE indicates that the associated
server supports including extended response data in the matching entry
count response control.
|
boolean |
skipResolvingExplodedIndexes()
Indicates whether the server should skip the effort of actually retrieving
the candidate entry IDs for exploded index keys in which the number of
matching entries is known.
|
JSONObject |
toJSONControl()
Retrieves a representation of this matching entry count request control as
a JSON object.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP control to the provided
buffer.
|
decode, decode, decodeControls, decodeJSONControl, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, registerDecodeableControl, toString, writeTo
@NotNull public static final java.lang.String MATCHING_ENTRY_COUNT_REQUEST_OID
@NotNull public static final java.lang.String EXTENDED_RESPONSE_DATA_FEATURE_OID
includeExtendedResponseData
element of the request control should check the target server's root DSE
to determine whether it supports this feature before requesting it because
older versions of the server that do not support it may not accept a
control that requests it.public MatchingEntryCountRequestControl()
public MatchingEntryCountRequestControl(boolean isCritical, int maxCandidatesToExamine, boolean alwaysExamineCandidates, boolean processSearchIfUnindexed, boolean includeDebugInfo)
isCritical
- Indicates whether this control should be
critical.maxCandidatesToExamine
- The maximum number of candidate entries
that the server should retrieve and
examine to determine whether they
actually match the search criteria. If
the search is partially indexed and the
total number of candidate entries is less
than or equal to this value, then these
candidate entries will be examined to
determine which of them match the search
criteria so that an accurate count can
be determined. If the search is fully
indexed such that the all candidate
entries are known to match the search
criteria, then the server may still
examine each of these entries if the
number of candidates is less than
maxCandidatesToExamine
and
alwaysExamineCandidates
is true
in order to allow the entry count that
is returned to be restricted to only
those entries that would actually be
returned to the client. This will be
ignored for searches that are completely
unindexed.
Integer.MAX_VALUE
may be specified.alwaysExamineCandidates
- Indicates whether the server should
always examine candidate entries to
determine whether they would actually
be returned to the client in a normal
search. This will only be used for
fully-indexed searches in which the
set of matching entries is known. If the
value is true
and the number of
candidates is smaller than
maxCandidatesToExamine
, then each
matching entry will be internally
retrieved and examined to determine
whether it would be returned to the
client based on the details of the search
request (e.g., whether the requester has
permission to access the entry, whether
it's an LDAP subentry, replication
conflict entry, soft-deleted entry, or
other type of entry that is normally
hidden) so that an exact count can be
returned. If this is false
or
the number of candidates exceeds
maxCandidatesToExamine
, then the
server will only be able to return an
unexamined count which may include
entries that match the search criteria
but that would not normally be returned
to the requester.processSearchIfUnindexed
- Indicates whether the server should
attempt to determine the number of
matching entries if the search criteria
is completely unindexed. If this is
true
and the requester has the
unindexed-search privilege, then the
server will iterate through all entries
in the scope (which may take a very long
time to complete) in order to to
determine which of them match the search
criteria so that it can return an
accurate count. If this is
false
or the requester does not
have the unindexed-search privilege, then
the server will not spend any time
attempting to determine the number of
matching entries and will instead return
a matching entry count response control
indicating that the entry count is
unknown.includeDebugInfo
- Indicates whether the server should
include debug information in the response
that may help better understand how it
arrived at the result. If any debug
information is returned, it will be in
the form of human-readable text that is
not intended to be machine-parsable.public MatchingEntryCountRequestControl(boolean isCritical, int maxCandidatesToExamine, boolean alwaysExamineCandidates, boolean processSearchIfUnindexed, boolean skipResolvingExplodedIndexes, @Nullable java.lang.Long fastShortCircuitThreshold, @Nullable java.lang.Long slowShortCircuitThreshold, boolean includeDebugInfo)
isCritical
- Indicates whether this control should
be critical.maxCandidatesToExamine
- The maximum number of candidate
entries that the server should
retrieve and examine to determine
whether they actually match the
search criteria. If the search is
partially indexed and the total
number of candidate entries is less
than or equal to this value, then
these candidate entries will be
examined to determine which of them
match the search criteria so that an
accurate count can be determined. If
the search is fully indexed such that
the all candidate entries are known
to match the search criteria, then
the server may still examine each of
these entries if the number of
candidates is less than
maxCandidatesToExamine
and
alwaysExamineCandidates
is
true
in order to allow the
entry count that is returned to be
restricted to only those entries that
would actually be returned to the
client. This will be ignored for
searches that are completely
unindexed.
Integer.MAX_VALUE
may be
specified.alwaysExamineCandidates
- Indicates whether the server should
always examine candidate entries to
determine whether they would actually
be returned to the client in a normal
search. This will only be used for
fully-indexed searches in which the
set of matching entries is known. If
the value is true
and the
number of candidates is smaller than
maxCandidatesToExamine
, then
each matching entry will be
internally retrieved and examined to
determine whether it would be
returned to the client based on the
details of the search request (e.g.,
whether the requester has permission
to access the entry, whether it's an
LDAP subentry, replication conflict
entry, soft-deleted entry, or other
type of entry that is normally
hidden, etc.) so that an exact count
can be returned. If this is
false
or the number of
candidates exceeds
maxCandidatesToExamine
, then
the server will only be able to
return an unexamined count which may
include entries that match the search
criteria but that would not normally
be returned to the requester.processSearchIfUnindexed
- Indicates whether the server should
attempt to determine the number of
matching entries if the search
criteria is completely unindexed. If
this is true
and the
requester has the unindexed-search
privilege, then the server will
iterate through all entries in the
scope (which may take a very long
time to complete) in order to to
determine which of them match the
search criteria so that it can return
an accurate count. If this is
false
or the requester does
not have the unindexed-search
privilege, then the server will not
spend any time attempting to
determine the number of matching
entries and will instead return a
matching entry count response control
indicating that the entry count is
unknown.skipResolvingExplodedIndexes
- Indicates whether the server should
skip the effort of actually
retrieving the candidate entry IDs
for exploded index keys in which the
number of matching entries is known.
Skipping the process of retrieving
the candidate entry IDs can allow the
server to more quickly estimate the
matching entry count, but the
resulting estimate may be less
accurate.fastShortCircuitThreshold
- Specifies the short-circuit threshold
that the server should use when
determining whether to continue with
index processing in an attempt to
further pare down a candidate set
that already has a defined superset
of the entries that actually match
the filter. Short-circuiting may
allow the server to skip
potentially-costly index processing
and allow it to obtain the matching
entry count estimate faster, but the
resulting estimate may be less
accurate. The fast short-circuit
threshold will be used for index
processing that is expected to be
very fast (e.g., when performing
index lookups for presence, equality,
and approximate-match components,
which should only require accessing a
single index key). A value that is
less than or equal to zero indicates
that the server should never short
circuit when performing fast index
processing. A value of null
indicates that the server should
determine the appropriate fast
short-circuit threshold to use.slowShortCircuitThreshold
- Specifies the short-circuit threshold
that the server should use when
determining whether to continue with
index processing for evaluation that
may be more expensive than what falls
into the "fast" category (e.g.,
substring and range filter
components). A value that is less
than or equal to zero indicates that
the server should never short circuit
when performing slow index
processing. A value of null
indicates that the server should
determine the appropriate slow
short-circuit threshold to use.includeDebugInfo
- Indicates whether the server should
include debug information in the
response that may help better
understand how it arrived at the
result. If any debug information is
returned, it will be in the form of
human-readable text that is not
intended to be machine-parsable.public MatchingEntryCountRequestControl(boolean isCritical, @NotNull MatchingEntryCountRequestControlProperties properties)
isCritical
- Indicates whether the control should be critical.properties
- The properties that should be used to create this
matching entry count request control. It must not be
null
.public MatchingEntryCountRequestControl(@NotNull Control control) throws LDAPException
control
- The control to decode as a matching entry count request
control.LDAPException
- If the provided control cannot be decoded as a
matching entry count request control.public int getMaxCandidatesToExamine()
alwaysExamineCandidates
is true. If the number of candidate
entries identified is less than the maximum number of candidates to
examine, then the server will return an EXAMINED_COUNT
result that
indicates the number of entries matching the criteria that would actually
be returned in a normal search with the same criteria. If the number of
candidate entries exceeds the maximum number of candidates to examine, then
the server will return an UNEXAMINED_COUNT
result that indicates
the number of entries matching the search criteria but that may include
entries that would not actually be returned to the client.
EXAMINED_COUNT
result with that count. If the upper bound on the
number of candidates is greater than the maximum number of candidates to
examine, then the server will return an UPPER_BOUND
result to
indicate that the exact count is not known but an upper bound is available.public boolean alwaysExamineCandidates()
true
if the server should attempt to internally retrieve
and examine matching entries to determine whether they would
normally be returned to the client (e.g., that the client has
permission to access the entry and that it is not a
normally-hidden entry like an LDAP subentry, a replication
conflict entry, or a soft-deleted entry), or false
if the
server should return an unverified count.public boolean processSearchIfUnindexed()
true
if the server should internally retrieve and examine
all entries within the search scope in order to obtain an exact
matching entry count for an unindexed search, or false
if
not.public boolean skipResolvingExplodedIndexes()
true
if the server should skip the effort of actually
retrieving the candidate entry IDs for exploded index keys in
which the number of matching entries is known, or false
if
it may retrieve candidates from an exploded index in the course of
determining the matching entry count.@Nullable public java.lang.Long getFastShortCircuitThreshold()
null
if the server should
determine the appropriate fast short-circuit threshold to use.@Nullable public java.lang.Long getSlowShortCircuitThreshold()
null
if the server should
determine the appropriate slow short-circuit threshold to use.public boolean includeExtendedResponseData()
true
if the server may include extended response data
in the corresponding response control, or false
if not.public static boolean serverSupportsExtendedResponseData(@NotNull LDAPInterface connection) throws LDAPException
connection
- The connection (or connection pool or other interface)
to use to communicate with the server. It must not be
null
and must be established.true
if the server reports that supports including
extended response data in the matching entry count response
control, or false
if it does not indicate that it is
supported.LDAPException
- If a problem occurs while attempting to communicate
with the server.public static boolean serverSupportsExtendedResponseData(@NotNull RootDSE rootDSE)
rootDSE
- The root DSE retrieved from the server for which to make
the determination. It must not be null
.true
if the root DSE indicates that supports including
extended response data in the matching entry count response
control, or false
if not.public boolean includeDebugInfo()
true
if the server should include debug information in
the response control, or false
if not.@NotNull public java.lang.String getControlName()
getControlName
in class Control
@NotNull public JSONObject toJSONControl()
oid
-- A mandatory string field whose value is the object
identifier for this control. For the matching entry count request
control, the OID is "1.3.6.1.4.1.30221.2.5.36".
control-name
-- An optional string field whose value is a
human-readable name for this control. This field is only intended for
descriptive purposes, and when decoding a control, the oid
field should be used to identify the type of control.
criticality
-- A mandatory Boolean field used to indicate
whether this control is considered critical.
value-base64
-- An optional string field whose value is a
base64-encoded representation of the raw value for this matching entry
count request control. Exactly one of the value-base64
and
value-json
fields must be present.
value-json
-- An optional JSON object field whose value is a
user-friendly representation of the value for this matching entry count
request control. Exactly one of the value-base64
and
value-json
fields must be present, and if the
value-json
field is used, then it will use the following
fields:
maximum-candidates-to-examine
-- An optional integer field
whose value indicates the maximum number of entries that the server
should retrieve and examine to determine whether they actually
match the search criteria and would be returned to the client.
always-examine-candidates
-- An optional Boolean field that
indicates whether the server should always examine candidates to
determine whether they would actually be returned to the client,
even if the search is fully indexed and the server knows that all
candidates match the search criteria.
process-search-if-unindexed
-- An optional Boolean field
that indicates whether the server should attempt to process the
search even if the search criteria is completely unindexed.
include-debug-info
-- An optional Boolean field
that indicates whether the server should return debug information
in the response control about the processing it performed in the
course of determining the matching entry count estimate.
skip-resolving-exploded-indexes
-- An optional Boolean
field that indicates whether the server should skip the step of
resolving exploded indexes in cases where the size of the ID set is
known.
fast-short-circuit-threshold
-- An optional integer field
whose value is the short-circuit threshold that the server should
use for "fast" filter components.
slow-short-circuit-threshold
-- An optional integer field
whose value is the short-circuit threshold that the server should
use for "slow" filter components.
include-extended-response-data
-- An optional Boolean field
that indicates whether the server should include extended
information in the response control.
toJSONControl
in class Control
@NotNull public static MatchingEntryCountRequestControl decodeJSONControl(@NotNull JSONObject controlObject, boolean strict) throws LDAPException
controlObject
- The JSON object to be decoded. It must not be
null
.strict
- Indicates whether to use strict mode when decoding
the provided JSON object. If this is true
,
then this method will throw an exception if the
provided JSON object contains any unrecognized
fields. If this is false
, then unrecognized
fields will be ignored.LDAPException
- If the provided JSON object cannot be parsed as a
valid matching entry count request control.