~ubuntu-branches/ubuntu/saucy/libnet-ldap-perl/saucy

« back to all changes in this revision

Viewing changes to .pc/fix-pod-spelling.patch/lib/Net/LDAP/Control/SyncDone.pm

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2012-02-08 00:28:33 UTC
  • mfrom: (4.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20120208002833-a15q5uh1pp1e4wgu
Tags: 1:0.4400-1
* New upstream release.
* Remove patch 0001-un-break-certificate-verification.patch.
* Update spelling patch.
* Update upstream and packaging copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (c) 2008 Mathieu Parent <math.parent@gmail.com>. All rights reserved.
2
 
# This program is free software; you can redistribute it and/or
3
 
# modify it under the same terms as Perl itself.
4
 
 
5
 
package Net::LDAP::Control::SyncDone;
6
 
 
7
 
use vars qw(@ISA $VERSION);
8
 
use Net::LDAP::Control;
9
 
 
10
 
@ISA = qw(Net::LDAP::Control);
11
 
$VERSION = "0.02";
12
 
 
13
 
use Net::LDAP::ASN qw(syncDoneValue);
14
 
use strict;
15
 
 
16
 
sub init {
17
 
  my($self) = @_;
18
 
 
19
 
  if (exists $self->{value}) {
20
 
    $self->{asn} = $syncDoneValue->decode(delete $self->{value});
21
 
  } else {
22
 
    $self->{asn} = {
23
 
      cookie => defined($self->{cookie}) ? $self->{cookie} : '',
24
 
      refreshDeletes   => $self->{refreshDeletes} || '0',
25
 
    };
26
 
  }
27
 
 
28
 
  $self;
29
 
}
30
 
 
31
 
sub cookie {
32
 
  my $self = shift;
33
 
  $self->{asn} ||= $syncDoneValue->decode($self->{value});
34
 
  if (@_) {
35
 
    delete $self->{value};
36
 
    return $self->{asn}{cookie} = defined($_[0]) ? $_[0] : '';
37
 
  }
38
 
  $self->{asn}{cookie};
39
 
}
40
 
 
41
 
sub refreshDeletes {
42
 
  my $self = shift;
43
 
  $self->{asn} ||= $syncDoneValue->decode($self->{value});
44
 
  if (@_) {
45
 
    delete $self->{value};
46
 
    return $self->{asn}{refreshDeletes} = shift || 0;
47
 
  }
48
 
  $self->{asn}{refreshDeletes};
49
 
}
50
 
 
51
 
sub value {
52
 
  my $self = shift;
53
 
 
54
 
  exists $self->{value}
55
 
    ? $self->{value}
56
 
    : $self->{value} = $syncDoneValue->encode($self->{asn});
57
 
}
58
 
 
59
 
1;
60
 
 
61
 
 
62
 
__END__
63
 
 
64
 
=head1 NAME
65
 
 
66
 
Net::LDAP::Control::SyncDone - LDAPv3 Sync Done control object
67
 
 
68
 
=head1 SYNOPSIS
69
 
 
70
 
See L<Net::LDAP::Control::SyncRequest>
71
 
 
72
 
=head1 DESCRIPTION
73
 
 
74
 
C<Net::LDAP::Control::SyncDone> provides an interface for the creation and
75
 
manipulation of objects that represent the C<Sync Request Control> as described
76
 
by RFC 4533.
77
 
 
78
 
=head1 CONSTRUCTOR ARGUMENTS
79
 
 
80
 
In addition to the constructor arguments described in
81
 
L<Net::LDAP::Control> the following are provided.
82
 
 
83
 
=over 4
84
 
 
85
 
=item cookie
86
 
 
87
 
=item refreshDeletes
88
 
 
89
 
=back
90
 
 
91
 
=head1 METHODS
92
 
 
93
 
As with L<Net::LDAP::Control> each constructor argument
94
 
described above is also avaliable as a method on the object which will
95
 
return the current value for the attribute if called without an argument,
96
 
and set a new value for the attribute if called with an argument.
97
 
 
98
 
=head1 SEE ALSO
99
 
 
100
 
L<Net::LDAP>,
101
 
L<Net::LDAP::Control>,
102
 
L<Net::LDAP::Control::SyncRequest>,
103
 
L<Net::LDAP::Control::SyncState>,
104
 
http://www.ietf.org/rfc/rfc4533.txt
105
 
 
106
 
=head1 AUTHOR
107
 
 
108
 
Mathieu Parent E<lt>math.parent@gmail.comE<gt>
109
 
 
110
 
Please report any bugs, or post any suggestions, to the perl-ldap mailing list
111
 
E<lt>perl-ldap@perl.orgE<gt>
112
 
 
113
 
=head1 COPYRIGHT
114
 
 
115
 
Copyright (c) 2008 Mathieu Parent. All rights reserved. This program is
116
 
free software; you can redistribute it and/or modify it under the same
117
 
terms as Perl itself.
118
 
 
119
 
=cut
120