Class JoinRule
java.lang.Object
com.unboundid.ldap.sdk.unboundidds.controls.JoinRule
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class JoinRule
extends Object
implements Serializable
This class provides an implementation of a join rule as used by the LDAP join
request control. See the class-level documentation for the
Join rules are encoded as follows:
JoinRequestControl class for additional information and an example
demonstrating its use.
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.
Join rules are encoded as follows:
JoinRule ::= CHOICE {
and [0] SET (1 .. MAX) of JoinRule,
or [1] SET (1 .. MAX) of JoinRule,
dnJoin [2] AttributeDescription,
equalityJoin [3] JoinRuleAssertion,
containsJoin [4] JoinRuleAssertion,
reverseDNJoin [5] AttributeDescription,
... }
JoinRuleAssertion ::= SEQUENCE {
sourceAttribute AttributeDescription,
targetAttribute AttributeDescription,
matchAll BOOLEAN DEFAULT FALSE }
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteThe join rule type that will be used for AND join rules.static final byteThe join rule type that will be used for contains join rules.static final byteThe join rule type that will be used for DN join rules.static final byteThe join rule type that will be used for equality join rules.static final byteThe join rule type that will be used for OR join rules.static final byteThe join rule type that will be used for reverse DN join rules. -
Method Summary
Modifier and TypeMethodDescriptionstatic JoinRulecreateANDRule(JoinRule... components) Creates an AND join rule in which all of the contained join rules must match an entry for it to be included in the join.static JoinRulecreateANDRule(List<JoinRule> components) Creates an AND join rule in which all of the contained join rules must match an entry for it to be included in the join.static JoinRulecreateContainsJoin(String sourceAttribute, String targetAttribute, boolean matchAll) Creates an equality join rule in which the value(s) of the source attribute in the source entry must be equal to or a substring of the value(s) of the target attribute of a target entry for it to be included in the join.static JoinRulecreateDNJoin(String sourceAttribute) Creates a DN join rule in which the value(s) of the source attribute must specify the DN(s) of the target entries to include in the join.static JoinRulecreateEqualityJoin(String sourceAttribute, String targetAttribute, boolean matchAll) Creates an equality join rule in which the value(s) of the source attribute in the source entry must be equal to the value(s) of the target attribute of a target entry for it to be included in the join.static JoinRulecreateORRule(JoinRule... components) Creates an OR join rule in which at least one of the contained join rules must match an entry for it to be included in the join.static JoinRulecreateORRule(List<JoinRule> components) Creates an OR join rule in which at least one of the contained join rules must match an entry for it to be included in the join.static JoinRulecreateReverseDNJoin(String targetAttribute) Creates a reverse DN join rule in which the target entries to include in the join must include a specified attribute that contains the DN of the source entry.static JoinRuledecodeJSONJoinRule(JSONObject o, boolean strict) Decodes the provided JSON object as a join rule.JoinRule[]Retrieves the set of subordinate components for this AND or OR join rule.Retrieves the name of the source attribute for this DN, equality, or contains join rule.Retrieves the name of the target attribute for this reverse DN, equality, or contains join rule.bytegetType()Retrieves the join rule type for this join rule.booleanmatchAll()Indicates whether all values of a multivalued source attribute must be present in a target entry for it to be considered a match.toJSON()Retrieve a JSON object representation of this join rule.toString()Retrieves a string representation of this join rule.voidtoString(StringBuilder buffer) Appends a string representation of this join rule to the provided buffer.
-
Field Details
-
JOIN_TYPE_AND
The join rule type that will be used for AND join rules.- See Also:
-
JOIN_TYPE_OR
The join rule type that will be used for OR join rules.- See Also:
-
JOIN_TYPE_DN
The join rule type that will be used for DN join rules.- See Also:
-
JOIN_TYPE_EQUALITY
The join rule type that will be used for equality join rules.- See Also:
-
JOIN_TYPE_CONTAINS
The join rule type that will be used for contains join rules.- See Also:
-
JOIN_TYPE_REVERSE_DN
The join rule type that will be used for reverse DN join rules.- See Also:
-
-
Method Details
-
createANDRule
Creates an AND join rule in which all of the contained join rules must match an entry for it to be included in the join.- Parameters:
components- The set of components to include in this join. It must not benullor empty.- Returns:
- The created AND join rule.
-
createANDRule
Creates an AND join rule in which all of the contained join rules must match an entry for it to be included in the join.- Parameters:
components- The set of components to include in this join. It must not benullor empty.- Returns:
- The created AND join rule.
-
createORRule
Creates an OR join rule in which at least one of the contained join rules must match an entry for it to be included in the join.- Parameters:
components- The set of components to include in this join. It must not benullor empty.- Returns:
- The created OR join rule.
-
createORRule
Creates an OR join rule in which at least one of the contained join rules must match an entry for it to be included in the join.- Parameters:
components- The set of components to include in this join. It must not benullor empty.- Returns:
- The created OR join rule.
-
createDNJoin
Creates a DN join rule in which the value(s) of the source attribute must specify the DN(s) of the target entries to include in the join.- Parameters:
sourceAttribute- The name or OID of the attribute in the source entry whose values contain the DNs of the entries to be included in the join. It must not benull, and it must be associated with a distinguished name or name and optional UID syntax.- Returns:
- The created DN join rule.
-
createEqualityJoin
@NotNull public static JoinRule createEqualityJoin(@NotNull String sourceAttribute, @NotNull String targetAttribute, boolean matchAll) Creates an equality join rule in which the value(s) of the source attribute in the source entry must be equal to the value(s) of the target attribute of a target entry for it to be included in the join.- Parameters:
sourceAttribute- The name or OID of the attribute in the source entry whose value(s) should be matched in target entries to be included in the join. It must not benull.targetAttribute- The name or OID of the attribute whose value(s) must match the source value(s) in entries included in the join. It must not benull.matchAll- Indicates whether all values of a multivalued source attribute must be present in the target entry for it to be considered a match.- Returns:
- The created equality join rule.
-
createContainsJoin
@NotNull public static JoinRule createContainsJoin(@NotNull String sourceAttribute, @NotNull String targetAttribute, boolean matchAll) Creates an equality join rule in which the value(s) of the source attribute in the source entry must be equal to or a substring of the value(s) of the target attribute of a target entry for it to be included in the join.- Parameters:
sourceAttribute- The name or OID of the attribute in the source entry whose value(s) should be matched in target entries to be included in the join. It must not benull.targetAttribute- The name or OID of the attribute whose value(s) must equal or contain the source value(s) in entries included in the join. It must not benull.matchAll- Indicates whether all values of a multivalued source attribute must be present in the target entry for it to be considered a match.- Returns:
- The created equality join rule.
-
createReverseDNJoin
Creates a reverse DN join rule in which the target entries to include in the join must include a specified attribute that contains the DN of the source entry.- Parameters:
targetAttribute- The name or OID of the attribute in the target entries which must contain the DN of the source entry. It must not benull, and it must be associated with a distinguished nme or name and optional UID syntax.- Returns:
- The created reverse DN join rule.
-
getType
Retrieves the join rule type for this join rule.- Returns:
- The join rule type for this join rule.
-
getComponents
Retrieves the set of subordinate components for this AND or OR join rule.- Returns:
- The set of subordinate components for this AND or OR join rule, or an empty list if this is not an AND or OR join rule.
-
getSourceAttribute
Retrieves the name of the source attribute for this DN, equality, or contains join rule.- Returns:
- The name of the source attribute for this DN, equality, or
contains join rule, or
nullif this is some other type of join rule.
-
getTargetAttribute
Retrieves the name of the target attribute for this reverse DN, equality, or contains join rule.- Returns:
- The name of the target attribute for this reverse DN, equality, or
contains join rule, or
nullif this is some other type of join rule.
-
matchAll
Indicates whether all values of a multivalued source attribute must be present in a target entry for it to be considered a match. The return value will only be meaningful for equality join rules.- Returns:
trueif all values of the source attribute must be included in the target attribute of an entry for it to be considered for inclusion in the join, orfalseif it is only necessary for at least one of the values to be included in a target entry for it to be considered for inclusion in the join.
-
toJSON
Retrieve a JSON object representation of this join rule.- Returns:
- A JSON object representation of this join rule.
-
decodeJSONJoinRule
@NotNull public static JoinRule decodeJSONJoinRule(@NotNull JSONObject o, boolean strict) throws LDAPException Decodes the provided JSON object as a join rule.- Parameters:
o- The JSON object that represents the join rule to decode. It must not benull.strict- Indicates whether to use strict mode when decoding the provided JSON object. If this istrue, then this method will throw an exception if the provided JSON object contains any unrecognized fields. If this isfalse, then unrecognized fields will be ignored.- Returns:
- The join rule decoded from the provided JSON object.
- Throws:
LDAPException- If the provided JSON object cannot be decoded as a valid join rule.
-
toString
Retrieves a string representation of this join rule. -
toString
Appends a string representation of this join rule to the provided buffer.- Parameters:
buffer- The buffer to which the information should be appended.
-