java.lang.Object
com.unboundid.ldap.sdk.unboundidds.controls.JoinRule
All Implemented Interfaces:
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 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

    Fields
    Modifier and Type
    Field
    Description
    static final byte
    The join rule type that will be used for AND join rules.
    static final byte
    The join rule type that will be used for contains join rules.
    static final byte
    The join rule type that will be used for DN join rules.
    static final byte
    The join rule type that will be used for equality join rules.
    static final byte
    The join rule type that will be used for OR join rules.
    static final byte
    The join rule type that will be used for reverse DN join rules.
  • Method Summary

    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
    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(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 JoinRule
    createDNJoin(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(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 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(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(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.
    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.
    byte
    Retrieves the join rule type for this join rule.
    boolean
    Indicates whether all values of a multivalued source attribute must be present in a target entry for it to be considered a match.
    Retrieve a JSON object representation of this join rule.
    Retrieves a string representation of this join rule.
    void
    Appends a string representation of this join rule to the provided buffer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Method Details

    • 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 be null or empty.
      Returns:
      The created AND join rule.
    • createANDRule

      @NotNull public static JoinRule createANDRule(@NotNull 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 be null 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 be null or empty.
      Returns:
      The created OR join rule.
    • createORRule

      @NotNull public static JoinRule createORRule(@NotNull 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 be null or empty.
      Returns:
      The created OR join rule.
    • createDNJoin

      @NotNull public static JoinRule createDNJoin(@NotNull 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 be null, 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 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.
      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 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.
      Returns:
      The created equality join rule.
    • createReverseDNJoin

      @NotNull public static JoinRule createReverseDNJoin(@NotNull 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 be null, 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

      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 null if 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 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, 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.
    • 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 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.
      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.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this join rule.
    • toString

      public void toString(@NotNull StringBuilder buffer)
      Appends a string representation of this join rule to the provided buffer.
      Parameters:
      buffer - The buffer to which the information should be appended.