Class: ROM::LDAP::SearchRequest Private
- Inherits:
-
Object
- Object
- ROM::LDAP::SearchRequest
- 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
-
#attributes ⇒ Array<String>
readonly
Restrict attributes returned.
-
#attributes_only ⇒ Boolean
readonly
Do not include values.
-
#base ⇒ String
readonly
Set to Relation default_base:.
- #deref ⇒ Integer readonly
-
#expression ⇒ Expression
readonly
Required.
- #max ⇒ Integer readonly
- #paged ⇒ Boolean readonly
- #reverse ⇒ Boolean readonly
- #scope ⇒ Integer readonly
- #sort ⇒ Array<String> readonly
- #timeout ⇒ Integer readonly
Instance Method Summary collapse
-
#controls ⇒ Array
private
Controls sent by clients are termed ‘request controls’, and those sent by servers are termed ‘response controls’.
-
#parts ⇒ Array
private
Search request components.
Instance Attribute Details
#attributes ⇒ Array<String> (readonly)
Returns Restrict attributes returned.
105 |
# File 'lib/rom/ldap/search_request.rb', line 105 option :attributes, type: Types::Strings, default: -> { [WILDCARD] } |
#attributes_only ⇒ Boolean (readonly)
Returns Do not include values.
111 |
# File 'lib/rom/ldap/search_request.rb', line 111 option :attributes_only, type: Types::Strict::Bool, default: -> { false } |
#base ⇒ String (readonly)
Returns 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 } |
#deref ⇒ Integer (readonly)
97 |
# File 'lib/rom/ldap/search_request.rb', line 97 option :deref, type: Types::Deref, default: -> { DEREF_ALWAYS } |
#expression ⇒ Expression (readonly)
Returns Required.
75 |
# File 'lib/rom/ldap/search_request.rb', line 75 option :expression, type: Types.Instance(Expression) |
#max ⇒ Integer (readonly)
140 |
# File 'lib/rom/ldap/search_request.rb', line 140 option :max, type: Types::Strict::Integer, optional: true |
#paged ⇒ Boolean (readonly)
123 |
# File 'lib/rom/ldap/search_request.rb', line 123 option :paged, type: Types::Strict::Bool, default: -> { false } |
#reverse ⇒ Boolean (readonly)
115 |
# File 'lib/rom/ldap/search_request.rb', line 115 option :reverse, type: Types::Strict::Bool, default: -> { false } |
#scope ⇒ Integer (readonly)
89 |
# File 'lib/rom/ldap/search_request.rb', line 89 option :scope, type: Types::Scope, default: -> { SCOPE_SUB } |
#sort ⇒ Array<String> (readonly)
144 |
# File 'lib/rom/ldap/search_request.rb', line 144 option :sorted, type: Types::Strict::Array, optional: true |
#timeout ⇒ Integer (readonly)
132 |
# File 'lib/rom/ldap/search_request.rb', line 132 option :timeout, type: Types::Strict::Integer, default: -> { 0 } |
Instance Method Details
#controls ⇒ Array
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, ) if paged ctrls << build_controls(:sort_request, sort_rules) if sorted ctrls.empty? ? nil : ctrls.to_ber_contextspecific(0) end |
#parts ⇒ Array
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.
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 |