@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class JoinRule extends java.lang.Object implements java.io.Serializable
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.
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 }
Modifier and Type | Field and 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.
|
Modifier and Type | Method and 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.
|
public static final byte JOIN_TYPE_AND
public static final byte JOIN_TYPE_OR
public static final byte JOIN_TYPE_DN
public static final byte JOIN_TYPE_EQUALITY
public static final byte JOIN_TYPE_CONTAINS
public static final byte JOIN_TYPE_REVERSE_DN
@NotNull public static JoinRule createANDRule(@NotNull JoinRule... components)
components
- The set of components to include in this join. It must
not be null
or empty.@NotNull public static JoinRule createANDRule(@NotNull java.util.List<JoinRule> components)
components
- The set of components to include in this join. It must
not be null
or empty.@NotNull public static JoinRule createORRule(@NotNull JoinRule... components)
components
- The set of components to include in this join. It must
not be null
or empty.@NotNull public static JoinRule createORRule(@NotNull java.util.List<JoinRule> components)
components
- The set of components to include in this join. It must
not be null
or empty.@NotNull public static JoinRule createDNJoin(@NotNull java.lang.String sourceAttribute)
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 be
null
, and it must be associated with a
distinguished name or name and optional UID
syntax.@NotNull public static JoinRule createEqualityJoin(@NotNull java.lang.String sourceAttribute, @NotNull java.lang.String targetAttribute, boolean matchAll)
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
be null
.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 be null
.matchAll
- Indicates whether all values of a multivalued
source attribute must be present in the target
entry for it to be considered a match.@NotNull public static JoinRule createContainsJoin(@NotNull java.lang.String sourceAttribute, @NotNull java.lang.String targetAttribute, boolean matchAll)
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
be null
.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 be
null
.matchAll
- Indicates whether all values of a multivalued
source attribute must be present in the target
entry for it to be considered a match.@NotNull public static JoinRule createReverseDNJoin(@NotNull java.lang.String targetAttribute)
targetAttribute
- The name or OID of the attribute in the target
entries which must contain the DN of the source
entry. It must not be null
, and it must
be associated with a distinguished nme or name and
optional UID syntax.public byte getType()
@NotNull public JoinRule[] getComponents()
@Nullable public java.lang.String getSourceAttribute()
null
if this is some other type of
join rule.@Nullable public java.lang.String getTargetAttribute()
null
if this is some other type of
join rule.public boolean matchAll()
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, or false
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.@NotNull public JSONObject toJSON()
@NotNull public static JoinRule decodeJSONJoinRule(@NotNull JSONObject o, boolean strict) throws LDAPException
o
- The JSON object that represents the join rule to decode.
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 decoded as a
valid join rule.@NotNull public java.lang.String toString()
toString
in class java.lang.Object