Class MatchedValuesRequestControl

  • All Implemented Interfaces:
    Control, RequestControl

    public class MatchedValuesRequestControl
    extends AbstractControl
    implements RequestControl
    Request control for limiting the attribute values returned by a search request. See https://tools.ietf.org/html/rfc3876. Control is defined as:
        ValuesReturnFilter ::= SEQUENCE OF SimpleFilterItem
    
        SimpleFilterItem ::= CHOICE {
           equalityMatch   [3] AttributeValueAssertion,
           substrings      [4] SubstringFilter,
           greaterOrEqual  [5] AttributeValueAssertion,
           lessOrEqual     [6] AttributeValueAssertion,
           present         [7] AttributeDescription,
           approxMatch     [8] AttributeValueAssertion,
           extensibleMatch [9] SimpleMatchingAssertion }
    
        SimpleMatchingAssertion ::= SEQUENCE {
           matchingRule    [1] MatchingRuleId OPTIONAL,
           type            [2] AttributeDescription OPTIONAL,
           --- at least one of the above must be present
           matchValue      [3] AssertionValue}
     
    • Field Detail

      • HASH_CODE_SEED

        private static final int HASH_CODE_SEED
        hash code seed.
        See Also:
        Constant Field Values
      • matchedValuesFilters

        private Filter[] matchedValuesFilters
        list of matched values filters.
    • Constructor Detail

      • MatchedValuesRequestControl

        public MatchedValuesRequestControl()
        Default constructor.
      • MatchedValuesRequestControl

        public MatchedValuesRequestControl​(String... filters)
        Creates a new matched values request control.
        Parameters:
        filters - to use for value matching
      • MatchedValuesRequestControl

        public MatchedValuesRequestControl​(String[] filters,
                                           boolean critical)
        Creates a new matched values request control.
        Parameters:
        filters - to use for value matching
        critical - whether this control is critical
      • MatchedValuesRequestControl

        public MatchedValuesRequestControl​(Filter... filters)
        Creates a new matched values request control.
        Parameters:
        filters - to use for value matching
      • MatchedValuesRequestControl

        public MatchedValuesRequestControl​(Filter[] filters,
                                           boolean critical)
        Creates a new matched values request control.
        Parameters:
        filters - to use for value matching
        critical - whether this control is critical
    • Method Detail

      • hasValue

        public boolean hasValue()
        Description copied from interface: RequestControl
        Returns whether the control has a value associated with it.
        Specified by:
        hasValue in interface RequestControl
        Returns:
        whether the control has a value
      • getMatchedValuesFilters

        public Filter[] getMatchedValuesFilters()
        Returns the filters to use for matching values.
        Returns:
        matched values filters
      • setMatchedValuesFilters

        public void setMatchedValuesFilters​(String... filters)
        Sets the filters to use for matching values.
        Parameters:
        filters - for matching values
        Throws:
        IllegalArgumentException - if the filter cannot be parsed or is not allowed
      • setMatchedValuesFilters

        public void setMatchedValuesFilters​(Filter... filters)
        Sets the filters to use for matching values.
        Parameters:
        filters - for matching values
        Throws:
        IllegalArgumentException - if the filter is not allowed
      • validateFilter

        private void validateFilter​(Filter filter)
        Throws if the supplied filter is not a valid type for the matched values request control.
        Parameters:
        filter - to validate
        Throws:
        IllegalArgumentException - if the filter is null or not a valid type
      • hashCode

        public int hashCode()
        Description copied from class: AbstractControl
        Returns the hash code for this object.
        Specified by:
        hashCode in class AbstractControl
        Returns:
        hash code
      • encode

        public byte[] encode()
        Description copied from interface: RequestControl
        Provides the BER encoding of this control.
        Specified by:
        encode in interface RequestControl
        Returns:
        BER encoded request control