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 boolean value, if TRUE and the control is unrecognized by the
31 server or is inappropriate for the requested operation then the
32 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 omitted if the contructor is being called on a sub-
48 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. Its format is
57 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"
62 elements. On return ASN will be blessed into a package. If "type"
63 is a registered OID, then ASN will be blessed into the registered
64 package, 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
68 caution.
69
71 In addition to the methods listed below, each of the named parameters
72 to "new" is also available 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
75 arguments, 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,
79 otherwise 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
90 remember this class and OID pair and use it in the following
91 situations.
92
93 · "new" is called as a class method on the Net::LDAP::Control
94 package and OID is passed as the type. The returned object will
95 be blessed into the package that registered the OID.
96
97 · "new" is called as a class method on a registered package and
98 the "type" is not specified. The "type" will be set to the OID
99 registered by that package.
100
101 · "from_asn" is called to construct an object from ASN. The
102 returned object will be blessed into the package which was
103 registered to handle the OID in the ASN.
104
105 ( to_asn )
106 Returns a structure suitable for passing to Convert::ASN1 for
107 encoding. This method will be called by Net::LDAP when the control
108 is used.
109
110 The base class implementation of this method will call the "value"
111 method without arguments to allow a sub-class to encode it's value.
112 Sub-classes should not need to override this method.
113
114 valid ()
115 Returns true if the object is valid and can be encoded. The default
116 implementation for this method is to return TRUE if there is no
117 error, but sub-classes may override that.
118
120 Net::LDAP Net::LDAP::Control::Assertion Net::LDAP::Control::EntryChange
121 Net::LDAP::Control::ManageDsaIT Net::LDAP::Control::MatchedValues
122 Net::LDAP::Control::Paged Net::LDAP::Control::PasswordPolicy
123 Net::LDAP::Control::PersistentSearch Net::LDAP::Control::PostRead
124 Net::LDAP::Control::PreRead Net::LDAP::Control::ProxyAuth
125 Net::LDAP::Control::Sort Net::LDAP::Control::SortResult
126 Net::LDAP::Control::SyncDone Net::LDAP::Control::SyncRequest
127 Net::LDAP::Control::SyncState Net::LDAP::Control::VLV
128 Net::LDAP::Control::VLVResponse
129
131 Graham Barr <gbarr@pobox.com>
132
133 Please report any bugs, or post any suggestions, to the perl-ldap
134 mailing list <perl-ldap@perl.org>
135
137 Copyright (c) 1999-2004 Graham Barr. All rights reserved. This program
138 is free software; you can redistribute it and/or modify it under the
139 same terms as Perl itself.
140
141
142
143perl v5.16.3 2013-06-07 Net::LDAP::Control(3)