1Net::LDAP::Control(3) User Contributed Perl DocumentationNet::LDAP::Control(3)
2
3
4
6 Net::LDAP::Control - LDAPv3 control object base class
7
9 use Net::LDAP::Control;
10 use Net::LDAP::Constant qw( LDAP_CONTROL_MATCHEDVALS );
11
12 $ctrl = Net::LDAP::Control->new(
13 type => "1.2.3.4",
14 value => "help",
15 critical => 0
16 );
17
18 $mesg = $ldap->search( @args, control => [ $ctrl ]);
19
20 $ctrl = Net::LDAP::Control->new( type => LDAP_CONTROL_MATCHEDVALS );
21
23 "Net::LDAP::Control" is a base-class for LDAPv3 control objects.
24
26 new ( ARGS )
27 ARGS is a list of name/value pairs, valid arguments are.
28
29 critical
30 A booloean value, if TRUE and the control is unrecognized by
31 the server or is inappropriate for the requested operation then
32 the server will return an error and the operation will not be
33 performed.
34
35 If FALSE and the control is unrecognized by the server or is
36 inappropriate for the requested operation then the server will
37 ignore the control and perform the requested operation as if
38 the control was not given.
39
40 If absent, FALSE is assumed.
41
42 type
43 A dotted-decimal representation of an OBJECT IDENTIFIER which
44 uniquely identifies the control. This prevents conflicts
45 between control names.
46
47 This may be ommitted if the contructor is being called on a
48 sub-class of Net::LDAP::Control which has registered to be
49 associated with an OID. If the contructor is being called on
50 the Net::LDAP::Control package, then this argument must be
51 given. If the given OID has been registered by a package, then
52 the returned object will be of the type registered to handle
53 that OID.
54
55 value
56 Optional information associated with the control. It's format
57 is specific to the particular control.
58
59 from_asn ( ASN )
60 ASN is a HASH reference, normally extracted from a PDU. It will
61 contain a "type" element and optionally "critical" and "value" ele‐
62 ments. On return ASN will be blessed into a package. If "type" is a
63 registered OID, then ASN will be blessed into the registered pack‐
64 age, if not then ASN will be blessed into Net::LDAP::Control.
65
66 This constructor is used internally by Net::LDAP and assumes that
67 HASH passed contains a valid control. It should be used with cau‐
68 tion.
69
71 In addition to the methods listed below, each of the named parameters
72 to "new" is also avaliable as a method. "type" will return the OID of
73 the control object. "value" and "critical" are set/get methods and will
74 return the current value for each attribute if called without argu‐
75 ments, but may also be called with arguments to set new values.
76
77 error ()
78 If there has been an error returns a description of the error, oth‐
79 erwise it will return "undef"
80
81 init ()
82 "init" will be called as the last step in both contructors. What it
83 does will depend on the sub-class. It must always return the
84 object.
85
86 register ( OID )
87 "register" is provided for sub-class implementors. It should be
88 called as a class method on a sub-class of Net::LDAP::Control with
89 the OID that the class will handle. Net::LDAP::Control will remem‐
90 ber this class and OID pair and use it in the following situations.
91
92 * "new" is called as a class method on the Net::LDAP::Control
93 package and OID is passed as the type. The returned object will
94 be blessed into the package that registered the OID.
95
96 * "new" is called as a class method on a registered package and
97 the "type" is not specified. The "type" will be set to the OID
98 registered by that package.
99
100 * "from_asn" is called to construct an object from ASN. The
101 returned object will be blessed into the package which was reg‐
102 istered to handle the OID in the ASN.
103
104 ( to_asn )
105 Returns a structure suitable for passing to Convert::ASN1 for
106 encoding. This method will be called by Net::LDAP when the control
107 is used.
108
109 The base class implementation of this method will call the "value"
110 method without arguments to allow a sub-class to encode it's value.
111 Sub-classes should not need to override this method.
112
113 valid ()
114 Returns true if the object is valid and can be encoded. The default
115 implementation for this method is to return TRUE if there is no
116 error, but sub-classes may override that.
117
119 Net::LDAP Net::LDAP::Control::EntryChange Net::LDAP::Control::ManageD‐
120 saIT Net::LDAP::Control::Paged Net::LDAP::Control::PersistentSearch
121 Net::LDAP::Control::ProxyAuth Net::LDAP::Control::Sort Net::LDAP::Con‐
122 trol::SortResult Net::LDAP::Control::VLV Net::LDAP::Control::VLVRe‐
123 sponse
124
126 Graham Barr <gbarr@pobox.com>
127
128 Please report any bugs, or post any suggestions, to the perl-ldap mail‐
129 ing list <perl-ldap@perl.org>
130
132 Copyright (c) 1999-2004 Graham Barr. All rights reserved. This program
133 is free software; you can redistribute it and/or modify it under the
134 same terms as Perl itself.
135
136
137
138perl v5.8.8 2007-02-10 Net::LDAP::Control(3)