Class JoinRule
- java.lang.Object
-
- com.unboundid.ldap.sdk.unboundidds.controls.JoinRule
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class JoinRule extends java.lang.Object implements java.io.Serializable
This class provides an implementation of a join rule as used by the LDAP join request control. See the class-level documentation for theJoinRequestControl
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static byte
JOIN_TYPE_AND
The join rule type that will be used for AND join rules.static byte
JOIN_TYPE_CONTAINS
The join rule type that will be used for contains join rules.static byte
JOIN_TYPE_DN
The join rule type that will be used for DN join rules.static byte
JOIN_TYPE_EQUALITY
The join rule type that will be used for equality join rules.static byte
JOIN_TYPE_OR
The join rule type that will be used for OR join rules.static byte
JOIN_TYPE_REVERSE_DN
The join rule type that will be used for reverse DN join rules.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JoinRule
createANDRule(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 JoinRule
createANDRule(java.util.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 JoinRule
createContainsJoin(java.lang.String sourceAttribute, java.lang.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 JoinRule
createDNJoin(java.lang.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 JoinRule
createEqualityJoin(java.lang.String sourceAttribute, java.lang.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 JoinRule
createORRule(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 JoinRule
createORRule(java.util.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 JoinRule
createReverseDNJoin(java.lang.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 JoinRule
decodeJSONJoinRule(JSONObject o, boolean strict)
Decodes the provided JSON object as a join rule.JoinRule[]
getComponents()
Retrieves the set of subordinate components for this AND or OR join rule.java.lang.String
getSourceAttribute()
Retrieves the name of the source attribute for this DN, equality, or contains join rule.java.lang.String
getTargetAttribute()
Retrieves the name of the target attribute for this reverse DN, equality, or contains join rule.byte
getType()
Retrieves the join rule type for this join rule.boolean
matchAll()
Indicates whether all values of a multivalued source attribute must be present in a target entry for it to be considered a match.JSONObject
toJSON()
Retrieve a JSON object representation of this join rule.java.lang.String
toString()
Retrieves a string representation of this join rule.void
toString(java.lang.StringBuilder buffer)
Appends a string representation of this join rule to the provided buffer.
-
-
-
Field Detail
-
JOIN_TYPE_AND
public static final byte JOIN_TYPE_AND
The join rule type that will be used for AND join rules.- See Also:
- Constant Field Values
-
JOIN_TYPE_OR
public static final byte JOIN_TYPE_OR
The join rule type that will be used for OR join rules.- See Also:
- Constant Field Values
-
JOIN_TYPE_DN
public static final byte JOIN_TYPE_DN
The join rule type that will be used for DN join rules.- See Also:
- Constant Field Values
-
JOIN_TYPE_EQUALITY
public static final byte JOIN_TYPE_EQUALITY
The join rule type that will be used for equality join rules.- See Also:
- Constant Field Values
-
JOIN_TYPE_CONTAINS
public static final byte JOIN_TYPE_CONTAINS
The join rule type that will be used for contains join rules.- See Also:
- Constant Field Values
-
JOIN_TYPE_REVERSE_DN
public static final byte JOIN_TYPE_REVERSE_DN
The join rule type that will be used for reverse DN join rules.- See Also:
- Constant Field Values
-
-
Method Detail
-
createANDRule
@NotNull public static JoinRule createANDRule(@NotNull 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.- Parameters:
components
- The set of components to include in this join. It must not benull
or empty.- Returns:
- The created AND join rule.
-
createANDRule
@NotNull public static JoinRule createANDRule(@NotNull java.util.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.- Parameters:
components
- The set of components to include in this join. It must not benull
or empty.- Returns:
- The created AND join rule.
-
createORRule
@NotNull public static JoinRule createORRule(@NotNull 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.- Parameters:
components
- The set of components to include in this join. It must not benull
or empty.- Returns:
- The created OR join rule.
-
createORRule
@NotNull public static JoinRule createORRule(@NotNull java.util.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.- Parameters:
components
- The set of components to include in this join. It must not benull
or empty.- Returns:
- The created OR join rule.
-
createDNJoin
@NotNull public static JoinRule createDNJoin(@NotNull java.lang.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.- 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 java.lang.String sourceAttribute, @NotNull java.lang.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 java.lang.String sourceAttribute, @NotNull java.lang.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
@NotNull public static JoinRule createReverseDNJoin(@NotNull java.lang.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.- 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
public byte getType()
Retrieves the join rule type for this join rule.- Returns:
- The join rule type for this join rule.
-
getComponents
@NotNull public JoinRule[] 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
@Nullable public java.lang.String 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
null
if this is some other type of join rule.
-
getTargetAttribute
@Nullable public java.lang.String 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
null
if this is some other type of join rule.
-
matchAll
public boolean 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:
true
if 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, orfalse
if 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
@NotNull public JSONObject 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
@NotNull public java.lang.String toString()
Retrieves a string representation of this join rule.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of this join rule.
-
-