@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class JoinRequestControl 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.
JoinRequestValue
class.
SearchRequest searchRequest = new SearchRequest( "ou=People,dc=example,dc=com", SearchScope.SUB, Filter.createEqualityFilter("uid", userID)); searchRequest.addControl(new JoinRequestControl(new JoinRequestValue( JoinRule.createEqualityJoin("accountNumber", "accountNumber", false), JoinBaseDN.createUseCustomBaseDN("ou=Accounts,dc=example,dc=com"), SearchScope.SUB, DereferencePolicy.NEVER, null, Filter.createEqualityFilter("objectClass", "accountEntry"), new String[0], false, null))); SearchResult searchResult = connection.search(searchRequest); for (SearchResultEntry userEntry : searchResult.getSearchEntries()) { JoinResultControl c = JoinResultControl.get(userEntry); for (JoinedEntry accountEntry : c.getJoinResults()) { // User userEntry was joined with account accountEntry } }
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JOIN_REQUEST_OID
The OID (1.3.6.1.4.1.30221.2.5.9) for the join request control.
|
Constructor and Description |
---|
JoinRequestControl(boolean isCritical,
JoinRequestValue joinRequestValue)
Creates a new join request control with the provided join request value.
|
JoinRequestControl(Control control)
Creates a new join request control which is decoded from the provided
generic control.
|
JoinRequestControl(JoinRequestValue joinRequestValue)
Creates a new join request control with the provided join request value.
|
Modifier and Type | Method and Description |
---|---|
static JoinRequestControl |
decodeJSONControl(JSONObject controlObject,
boolean strict)
Attempts to decode the provided object as a JSON representation of a join
request control.
|
java.lang.String |
getControlName()
Retrieves the user-friendly name for this control, if available.
|
JoinRequestValue |
getJoinRequestValue()
Retrieves the join request value for this join request control.
|
JSONObject |
toJSONControl()
Retrieves a representation of this join 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 JOIN_REQUEST_OID
public JoinRequestControl(@NotNull JoinRequestValue joinRequestValue)
joinRequestValue
- The join request value to use for this control.public JoinRequestControl(boolean isCritical, @NotNull JoinRequestValue joinRequestValue)
isCritical
- Indicates whether this control should be
considered critical.joinRequestValue
- The join request value to use for this control.public JoinRequestControl(@NotNull Control control) throws LDAPException
control
- The generic control to be decoded as a join request
control.LDAPException
- If the provided control cannot be decoded as a
virtual attributes only request control.@NotNull public JoinRequestValue getJoinRequestValue()
@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 join request control, the OID is
"1.3.6.1.4.1.30221.2.5.9".
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 join 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 join 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:
join-rule
-- A mandatory JSON object field that provides
the primary criteria to use when selecting entries to be joined
with search result entries. The format for join rule objects will
be described in more detail below.
base-dn-type
-- A mandatory string field that indicates
who the server should determine the base DN to use for join
processing. The value must be one of "use-search-base-dn
",
"use-source-entry-dn
", or "use-custom-base-dn
".
base-dn-value
-- An optional string field that provides the
custom base DN value to use if the base-dn-type
value was
"use-custom-base-dn
". This field must be present if the
base-dn-type
value was "use-custom-base-dn
", and it
must be absent for other base-dn-type
values.
scope
-- An optional string field whose value specifies the
scope to use for join processing. If present, the value must be
one of "baseObject
", "singleLevel
",
"wholeSubtree
", or "subordinateSubtree
". If this
is not specified, the scope from the search request will be used.
alias-dereferencing-behavior
-- An optional string field
whose value specifies the behavior to use for dereferencing any
aliases encountered during join processing. If present, the value
must be one of "neverDerefAliases
",
"derefInSearching
", "derefInFindingBaseObj
", or
derefAlways
". If this is not specified, the dereferencing
behavior from the search request will be used.
size-limit
-- An optional integer field whose value
specifies the maximum number of entries that may be joined with any
single search
result entry.
filter
-- An optional string field whose value is the
string representation of a filter that will be required to match an
entry for it to be joined with a search result entry.
attributes
-- An optional array field whose values are
strings that are the names of attributes to include in joined
entries.
require-match
-- A mandatory Boolean field that indicates
whether to suppress a search result entry from the set of results
to the client if it is not joined with any other entries.
nested-join
-- An optional JSON object field whose value
represents the join criteria for a nested join operation. If
present, the fields in this object are the same as the fields that
may be used in the top-level value-json
field (optionally
including another nested-jon
element if desired).
type
-- A mandatory string field whose value must be
"dn
".
source-attribute
-- A mandatory string field whose value is
the name of the attribute in the source entry that contains the DNs
of the entries to be joined with that entry.
type
-- A mandatory string field whose value must be
"reverse-dn
".
target-attribute
-- A mandatory string field whose value is
the name of the attribute in joined entries that contains a value
that matches the DN of the source entry.
type
-- A mandatory string field whose value must be
"equality
".
source-attribute
-- A mandatory string field whose value is
the name of an attribute in the source entry whose values will be
used to identify entries to be joined with that source entry.
target-attribute
-- A mandatory string field whose value is
the name of the attribute in joined entries that must contain at
least one of the values from the source attribute in the source
entry.
match-all
-- A mandatory Boolean field that indicates
whether to only join entries in which the target attribute contains
all of the values of the source attribute.
type
-- A mandatory string field whose value must be
"contains
".
source-attribute
-- A mandatory string field whose value is
the name of an attribute in the source entry whose values will be
used to identify entries to be joined with that source entry.
target-attribute
-- A mandatory string field whose value is
the name of the attribute in joined entries that must contain at
least one value that includes the value of a source attribute as a
substring.
match-all
-- A mandatory Boolean field that indicates
whether to only join entries in which the target attribute contains
values that contain all of the values of the source attribute as
substrings.
type
-- A mandatory string field whose value must be
"and
".
rules
-- A mandatory, non-empty array field whose values
are the JSON objects that represent the nested join rules that must
all match an entry for it to be joined with the source entry.
type
-- A mandatory string field whose value must be
"or
".
rules
-- A mandatory, non-empty array field whose values
are the JSON objects that represent the nested join rules of which
at least one must match an entry for it to be joined with the
source entry.
toJSONControl
in class Control
@NotNull public static JoinRequestControl 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 join request control.