Net::LD...rol::VLV(3)
π NAME π
Okay bestie, this page is Net::LD...rol::VLV(3) β aka Net::LDAP::Control::VLV β from User Contributed Perl Documentation. The actual object is an LDAPv3 Virtual List View control object. Periodt. π
β¨ SYNOPSIS β¨
No cap, here's the whole example vibe:
use Net::LDAP;
use Net::LDAP::Control::VLV;
use Net::LDAP::Constant qw( LDAP_CONTROL_VLVRESPONSE );
$ldap = Net::LDAP->new( "ldap.mydomain.eg" );
# Get the first 20 entries
$vlv = Net::LDAP::Control::VLV->new(
before => 0, # No entries from before target entry
after => 19, # 19 entries after target entry
content => 0, # List size unknown
offset => 1, # Target entry is the first
);
$sort = Net::LDAP::Control::Sort->new( order => 'cn' );
@args = ( base => "o=Ace Industry, c=us",
scope => "subtree",
filter => "(objectClass=inetOrgPerson)",
callback => \&process_entry, # Call this sub for each entry
control => [ $vlv, $sort ],
);
$mesg = $ldap->search( @args );
# Get VLV response control
($resp) = $mesg->control( LDAP_CONTROL_VLVRESPONSE ) or die;
$vlv->response( $resp );
# Set the control to get the last 20 entries
$vlv->end;
$mesg = $ldap->search( @args );
# Get VLV response control
($resp) = $mesg->control( LDAP_CONTROL_VLVRESPONSE ) or die;
$vlv->response( $resp );
# Now get the previous page
$vlv->scroll_page( -1 );
$mesg = $ldap->search( @args );
# Get VLV response control
($resp) = $mesg->control( LDAP_CONTROL_VLVRESPONSE ) or die;
$vlv->response( $resp );
# Now page with first entry starting with "B" in the middle
$vlv->before(9); # Change page to show 9 before
$vlv->after(10); # Change page to show 10 after
$vlv->assert("B"); # assert "B"
$mesg = $ldap->search( @args );
π¦ DESCRIPTION π¦
Net::LDAP::Control::VLV gives you an interface for creating and manipulating objects that represent the Virtual List View, as described by draft-ietf-ldapext-ldapv3-vlv-09.txt. β¨
The way that this works in a search: when you use a Virtual List View control, it must be accompanied by a sort control. See Net::LDAP::Control::Sort. That's the rule, bestie β no sort control, no VLV slay. π
π CONSTRUCTOR ARGUMENTS π
In addition to the constructor arguments described in Net::LDAP::Control, the following are provided. π«Ά
afterβ Sets the number of entries the server should return from the list after the target entry. πassertβ Sets the assertion value used to locate the target entry. This value should be a legal value to compare with the first attribute in the sort control that is passed with the VLV control. The target entry is the first entry in the list which is greater than or equal theassertvalue.beforeβ Sets the number of entries the server should return from the list before the target entry. πΈcontentβ Sets the number of entries in the list. On the first search this value should be set to zero. On subsequent searches it should be set to the length of the list, as returned by the server in the VLVResponse control.contextβ Sets the context identifier. On the first search this value should be set to zero. On subsequent searches it should be set to the context value returned by the server in the VLVResponse control.offsetβ Sets the offset of the target entry. π―
π§ METHODS π§
As with Net::LDAP::Control, each constructor argument described above is also available as a method on the object. Called without an argument, it returns the current value for the attribute; called with an argument, it sets a new value for the attribute. Iconic behavior, honestly. π
The offset and assert attributes are mutually exclusive. Setting one or the other will cause previous values set by the other to be forgotten. The content attribute is also associated with the offset attribute, so setting assert will cause any content value to be forgotten. Bestie, they do not share the aux cord. π
endβ Set the target entry to the end of the list. This method will change thebeforeandafterattributes so that the target entry is the last in the page. π₯response VLV_RESPONSEβ Set the attributes in the control as per VLV_RESPONSE. VLV_RESPONSE should be a control of typeNet::LDAP::Control::VLVResponsereturned from the server.responsewill populate thecontext,offsetandcontentattributes of the control with the values from VLV_RESPONSE. Because this sets theoffsetattribute, any previous setting of theassertattribute will be forgotten.scroll NUMβ Move the target entry by NUM entries. A positive NUM will move the target entry towards the end of the list, and a negative NUM will move the target entry towards the start of the list. Returns the index of the new target entry, orundefif the current target is identified by an assertion. π
scroll may change the before and after attributes if the scroll value would cause the page to go off either end of the list. But the page size will be maintained. Fr fr.
scroll_page NUMβ Scroll by NUM pages. This method simply calculates the current page size and callsscrollwithNUM * $page_size. π¦startβ Set the target entry to the start of the list. This method will change thebeforeandafterattributes so that the target entry is the first entry in the page. π
π SEE ALSO π
Net::LDAPNet::LDAP::ControlNet::LDAP::Control::SortNet::LDAP::Control::VLVResponse
π AUTHOR π
Graham Barr <gbarr@pobox.com>
Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>. π¬
π COPYRIGHT π
Copyright (c) 2000-2004 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Okay that's the whole page, bestie π«Ά β the footer vibes are source/version perl v5.42.0, dated 2024-01-02, and the manual name is Net::LD...rol::VLV(3). Mwah! πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-ldap 0.68-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms