1Net::LDAP::Control::SynUcsReerquCeosntt(r3i)buted Perl DNoectu:m:eLnDtAaPt:i:oCnontrol::SyncRequest(3)
2
3
4
6 Net::LDAP::Control::SyncRequest - LDAPv3 Sync Request control object
7
9 use Net::LDAP;
10 use Net::LDAP::Control::SyncRequest;
11 use Net::LDAP::Constant qw(
12 LDAP_SYNC_REFRESH_ONLY
13 LDAP_SYNC_REFRESH_AND_PERSIST
14 LDAP_SUCCESS );
15
16 $ldap = Net::LDAP->new( "ldap.mydomain.eg" );
17
18 $req = Net::LDAP::Control::SyncRequest->new( mode => LDAP_SYNC_REFRESH_ONLY );
19 my $mesg = $ldap->search(base=> 'dc=mydomain,dc='eg',
20 scope => 'sub',
21 control => [ $req ],
22 callback => \&searchCallback, # call for each entry
23 filter => "(objectClass=*)",
24 attrs => [ '*']);
25 sub searchCallback {
26 my $message = shift;
27 my $entry = shift;
28 my @controls = $message->control;
29
30 if ($controls[0]->isa('Net::LDAP::Control::SyncState')) {
31 print "Received Sync State Control\n";
32 print $entry->dn()."\n";
33 print 'State: '.$controls[0]->state."\n".', entryUUID: '.$controls[0]->entryUUID.', cookie: '.$controls[0]->cookie;
34 } elsif ($controls[0]->isa('Net::LDAP::Control::SyncDone')) {
35 print "Received Sync Done Control\n";
36 print 'Cookie: '.$controls[0]->cookie.', refreshDeletes: '.$controls[0]->refreshDeletes;
37 }
38 }
39
41 "Net::LDAP::Control::SyncRequest" provides an interface for the
42 creation and manipulation of objects that represent the "Sync Request
43 Control" as described by RFC 4533.
44
46 In addition to the constructor arguments described in
47 Net::LDAP::Control the following are provided.
48
49 mode
50 cookie
51 reloadHint
52
54 As with Net::LDAP::Control each constructor argument described above is
55 also available as a method on the object which will return the current
56 value for the attribute if called without an argument, and set a new
57 value for the attribute if called with an argument.
58
60 Net::LDAP, Net::LDAP::Control, Net::LDAP::Control::SyncState,
61 Net::LDAP::Control::SyncDone, http://www.ietf.org/rfc/rfc4533.txt
62
64 Mathieu Parent <math.parent@gmail.com>
65
66 Please report any bugs, or post any suggestions, to the perl-ldap
67 mailing list <perl-ldap@perl.org>
68
70 Copyright (c) 2008 Mathieu Parent. All rights reserved. This program is
71 free software; you can redistribute it and/or modify it under the same
72 terms as Perl itself.
73
74
75
76perl v5.32.0 2020-07-28Net::LDAP::Control::SyncRequest(3)