1Net::LDAP::Control::PagUesde(r3)Contributed Perl DocumenNteatt:i:oLnDAP::Control::Paged(3)
2
3
4

NAME

6       Net::LDAP::Control::Paged - LDAPv3 Paged results control object
7

SYNOPSIS

9        use Net::LDAP;
10        use Net::LDAP::Control::Paged;
11        use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED );
12
13        $ldap = Net::LDAP->new( "ldap.mydomain.eg" );
14
15        $page = Net::LDAP::Control::Paged->new( size => 100 );
16
17        @args = ( base     => "cn=subnets,cn=sites,cn=configuration,$BASE_DN",
18                  scope    => "subtree",
19                  filter   => "(objectClass=subnet)",
20                  callback => \&process_entry, # Call this sub for each entry
21                  control  => [ $page ],
22        );
23
24        my $cookie;
25        while(1) {
26          # Perform search
27          my $mesg = $ldap->search( @args );
28
29          # Only continue on LDAP_SUCCESS
30          $mesg->code and last;
31
32          # Get cookie from paged control
33          my($resp)  = $mesg->control( LDAP_CONTROL_PAGED ) or last;
34          $cookie    = $resp->cookie or last;
35
36          # Set cookie in paged control
37          $page->cookie($cookie);
38        }
39
40        if ($cookie) {
41          # We had an abnormal exit, so let the server know we do not want any more
42          $page->cookie($cookie);
43          $page->size(0);
44          $ldap->search( @args );
45        }
46

DESCRIPTION

48       "Net::LDAP::Control::Paged" provides an interface for the creation and
49       manipulation of objects that represent the "pagedResultsControl" as
50       described by RFC-2696.
51

CONSTRUCTOR ARGUMENTS

53       In addition to the constructor arguments described in
54       Net::LDAP::Control the following are provided.
55
56       cookie
57           The value to use as the cookie. This is not normally set when an
58           object is created, but is set from the cookie value returned by the
59           server. This associates a search with a previous search, so the
60           server knows to return the page of entries following the entries it
61           returned the previous time.
62
63       size
64           The page size that is required. This is the maximum number of
65           entries that the server will return to the search request.
66

METHODS

68       As with Net::LDAP::Control each constructor argument described above is
69       also avaliable as a method on the object which will return the current
70       value for the attribute if called without an argument, and set a new
71       value for the attribute if called with an argument.
72

SEE ALSO

74       Net::LDAP, Net::LDAP::Control, http://www.ietf.org/rfc/rfc2696.txt
75

AUTHOR

77       Graham Barr <gbarr@pobox.com>
78
79       Please report any bugs, or post any suggestions, to the perl-ldap
80       mailing list <perl-ldap@perl.org>
81
83       Copyright (c) 2000-2004 Graham Barr. All rights reserved. This program
84       is free software; you can redistribute it and/or modify it under the
85       same terms as Perl itself.
86
87
88
89perl v5.12.0                      2010-03-12      Net::LDAP::Control::Paged(3)
Impressum