Class: ROM::LDAP::SearchRequest Private

Inherits:
Object
  • Object
show all
Extended by:
Initializer
Defined in:
lib/rom/ldap/search_request.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The Search request is defined as follows:

SearchRequest ::= [APPLICATION 3] SEQUENCE {
     baseObject      LDAPDN,
     scope           ENUMERATED {
          baseObject              (0),
          singleLevel             (1),
          wholeSubtree            (2),
          ...  },
     derefAliases    ENUMERATED {
          neverDerefAliases       (0),
          derefInSearching        (1),
          derefFindingBaseObj     (2),
          derefAlways             (3) },
     sizeLimit       INTEGER (0 ..  maxInt),
     timeLimit       INTEGER (0 ..  maxInt),
     typesOnly       BOOLEAN,
     filter          Filter,
     attributes      AttributeSelection }

AttributeSelection ::= SEQUENCE OF selector LDAPString
                -- The LDAPString is constrained to
                -- <attributeSelector> in Section 4.5.1.8

Filter ::= CHOICE {
     and             [0] SET SIZE (1..MAX) OF filter Filter,
     or              [1] SET SIZE (1..MAX) OF filter Filter,
     not             [2] Filter,
     equalityMatch   [3] AttributeValueAssertion,
     substrings      [4] SubstringFilter,
     greaterOrEqual  [5] AttributeValueAssertion,
     lessOrEqual     [6] AttributeValueAssertion,
     present         [7] AttributeDescription,
     approxMatch     [8] AttributeValueAssertion,
     extensibleMatch [9] MatchingRuleAssertion,
     ...  }

SubstringFilter ::= SEQUENCE {
     type           AttributeDescription,
     substrings     SEQUENCE SIZE (1..MAX) OF substring CHOICE {
          initial [0] AssertionValue,  -- can occur at most once
          any     [1] AssertionValue,
          final   [2] AssertionValue } -- can occur at most once
     }

MatchingRuleAssertion ::= SEQUENCE {
     matchingRule    [1] MatchingRuleId OPTIONAL,
     type            [2] AttributeDescription OPTIONAL,
     matchValue      [3] AssertionValue,
     dnAttributes    [4] BOOLEAN DEFAULT FALSE }

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributesArray<String> (readonly)

Returns Restrict attributes returned.

Returns:

  • (Array<String>)

    Restrict attributes returned.



105
# File 'lib/rom/ldap/search_request.rb', line 105

option :attributes, type: Types::Strings, default: -> { [WILDCARD] }

#attributes_onlyBoolean (readonly)

Returns Do not include values.

Returns:

  • (Boolean)

    Do not include values.



111
# File 'lib/rom/ldap/search_request.rb', line 111

option :attributes_only, type: Types::Strict::Bool, default: -> { false }

#baseString (readonly)

Returns Set to Relation default_base:.

Returns:

  • (String)

    Set to Relation default_base:



81
# File 'lib/rom/ldap/search_request.rb', line 81

option :base, proc(&:to_s), type: Types::DN, default: -> { EMPTY_STRING }

#derefInteger (readonly)

Returns:

  • (Integer)


97
# File 'lib/rom/ldap/search_request.rb', line 97

option :deref, type: Types::Deref, default: -> { DEREF_ALWAYS }

#expressionExpression (readonly)

Returns Required.

Returns:



75
# File 'lib/rom/ldap/search_request.rb', line 75

option :expression, type: Types.Instance(Expression)

#maxInteger (readonly)

Returns:

  • (Integer)


140
# File 'lib/rom/ldap/search_request.rb', line 140

option :max, type: Types::Strict::Integer, optional: true

#pagedBoolean (readonly)

Returns:

  • (Boolean)


123
# File 'lib/rom/ldap/search_request.rb', line 123

option :paged, type: Types::Strict::Bool, default: -> { false }

#reverseBoolean (readonly)

Returns:

  • (Boolean)


115
# File 'lib/rom/ldap/search_request.rb', line 115

option :reverse, type: Types::Strict::Bool, default: -> { false }

#scopeInteger (readonly)

Returns:

  • (Integer)


89
# File 'lib/rom/ldap/search_request.rb', line 89

option :scope, type: Types::Scope, default: -> { SCOPE_SUB }

#sortArray<String> (readonly)

Returns:

  • (Array<String>)


144
# File 'lib/rom/ldap/search_request.rb', line 144

option :sorted, type: Types::Strict::Array, optional: true

#timeoutInteger (readonly)

Returns:

  • (Integer)


132
# File 'lib/rom/ldap/search_request.rb', line 132

option :timeout, type: Types::Strict::Integer, default: -> { 0 }

Instance Method Details

#controlsArray

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Controls sent by clients are termed ‘request controls’, and those

sent by servers are termed 'response controls'.

     Controls ::= SEQUENCE OF control Control

     Control ::= SEQUENCE {
          controlType             LDAPOID,
          criticality             BOOLEAN DEFAULT FALSE,
          controlValue            OCTET STRING OPTIONAL }


177
178
179
180
181
182
# File 'lib/rom/ldap/search_request.rb', line 177

def controls
  ctrls = []
  ctrls << build_controls(:paged_results, cookie)    if paged
  ctrls << build_controls(:sort_request, sort_rules) if sorted
  ctrls.empty? ? nil : ctrls.to_ber_contextspecific(0)
end

#partsArray

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Search request components.

Returns:

  • (Array)


149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/rom/ldap/search_request.rb', line 149

def parts
  [
    base.to_ber,                  # 4.5.1.1.  SearchRequest.baseObject
    scope.to_ber_enumerated,      # 4.5.1.2.  SearchRequest.scope
    deref.to_ber_enumerated,      # 4.5.1.3.  SearchRequest.derefAliases
    limit.to_ber,                 # 4.5.1.4.  SearchRequest.sizeLimit
    timeout.to_ber,               # 4.5.1.5.  SearchRequest.timeLimit
    attributes_only.to_ber,       # 4.5.1.6.  SearchRequest.typesOnly
    expression.to_ber,            # 4.5.1.7.  SearchRequest.filter
    ber_attrs.to_ber_sequence     # 4.5.1.8.  SearchRequest.attributes
  ]
end