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_MANAGEDSAIT );
11
12 my $req_ctrl1 = Net::LDAP::Control->new( type => LDAP_CONTROL_MANAGEDSAIT );
13 my $req_ctrl2 = Net::LDAP::Control->new(
14 type => "1.2.3.4",
15 value => "help",
16 critical => 0
17 );
18
19 $mesg = $ldap->search( @args, control => [ $req_ctrl1, $req_ctrl2 ]);
20
21 my @res_ctrls = $mesg->control();
22
24 "Net::LDAP::Control" is the base-class for LDAPv3 control objects.
25
26 Controls provide a mechanism that allows one to extend the semantics
27 and arguments of LDAP operations. Controls may be attached to LDAP
28 operations, and only affect the semantics of the operation they are
29 attached to.
30
31 Controls sent by clients are termed request controls, and are set using
32 the "control" option of the respective LDAP operations. Controls sent
33 by servers are called response controls, they can be found using the
34 "control()" method of the response message objects.
35
36 Servers announce the controls they support in the attribute
37 "supportedControls" in their RootDSE.
38
40 new ( ARGS )
41 ARGS is a list of name/value pairs, valid arguments are:
42
43 critical
44 A Boolean value, if TRUE and the control is unrecognized by the
45 server or is inappropriate for the requested operation then the
46 server will return an error and the operation will not be
47 performed.
48
49 If FALSE and the control is unrecognized by the server or is
50 inappropriate for the requested operation then the server will
51 ignore the control and perform the requested operation as if
52 the control was not given.
53
54 If absent, FALSE is assumed.
55
56 type
57 A dotted-decimal representation of an OBJECT IDENTIFIER which
58 uniquely identifies the control. This prevents conflicts
59 between control names.
60
61 This may be omitted if the constructor is being called on a
62 sub-class of Net::LDAP::Control which has registered to be
63 associated with an OID. If the constructor is being called on
64 the Net::LDAP::Control package, then this argument must be
65 given. If the given OID has been registered by a package, then
66 the returned object will be of the type registered to handle
67 that OID.
68
69 value
70 Optional information associated with the control. Its format is
71 specific to the particular control.
72
73 from_asn ( ASN )
74 ASN is a HASH reference, normally extracted from a PDU. It will
75 contain a "type" element and optionally "critical" and "value"
76 elements. On return ASN will be blessed into a package. If "type"
77 is a registered OID, then ASN will be blessed into the registered
78 package, if not then ASN will be blessed into Net::LDAP::Control.
79
80 This constructor is used internally by Net::LDAP and assumes that
81 HASH passed contains a valid control. It should be used with
82 caution.
83
85 In addition to the methods listed below, each of the named parameters
86 to "new" is also available as a method. "type" will return the OID of
87 the control object. "value" and "critical" are set/get methods and will
88 return the current value for each attribute if called without
89 arguments, but may also be called with arguments to set new values.
90
91 error ()
92 If there has been an error returns a description of the error,
93 otherwise it will return "undef"
94
95 init ()
96 "init" will be called as the last step in both constructors. What
97 it does will depend on the sub-class. It must always return the
98 object.
99
100 register ( OID )
101 "register" is provided for sub-class implementors. It should be
102 called as a class method on a sub-class of Net::LDAP::Control with
103 the OID that the class will handle. Net::LDAP::Control will
104 remember this class and OID pair and use it in the following
105 situations.
106
107 · "new" is called as a class method on the Net::LDAP::Control
108 package and OID is passed as the type. The returned object will
109 be blessed into the package that registered the OID.
110
111 · "new" is called as a class method on a registered package and
112 the "type" is not specified. The "type" will be set to the OID
113 registered by that package.
114
115 · "from_asn" is called to construct an object from ASN. The
116 returned object will be blessed into the package which was
117 registered to handle the OID in the ASN.
118
119 ( to_asn )
120 Returns a structure suitable for passing to Convert::ASN1 for
121 encoding. This method will be called by Net::LDAP when the control
122 is used.
123
124 The base class implementation of this method will call the "value"
125 method without arguments to allow a sub-class to encode it's value.
126 Sub-classes should not need to override this method.
127
128 valid ()
129 Returns true if the object is valid and can be encoded. The default
130 implementation for this method is to return TRUE if there is no
131 error, but sub-classes may override that.
132
134 Net::LDAP, Net::LDAP::RootDSE, Net::LDAP::Control::Assertion,
135 Net::LDAP::Control::DontUseCopy, Net::LDAP::Control::EntryChange,
136 Net::LDAP::Control::ManageDsaIT, Net::LDAP::Control::MatchedValues,
137 Net::LDAP::Control::Paged, Net::LDAP::Control::PasswordPolicy,
138 Net::LDAP::Control::PersistentSearch, Net::LDAP::Control::PostRead,
139 Net::LDAP::Control::PreRead, Net::LDAP::Control::ProxyAuth,
140 Net::LDAP::Control::Relax, Net::LDAP::Control::Sort,
141 Net::LDAP::Control::SortResult, Net::LDAP::Control::SyncDone,
142 Net::LDAP::Control::SyncRequest, Net::LDAP::Control::SyncState,
143 Net::LDAP::Control::VLV, Net::LDAP::Control::VLVResponse
144
146 Graham Barr <gbarr@pobox.com>
147
148 Please report any bugs, or post any suggestions, to the perl-ldap
149 mailing list <perl-ldap@perl.org>
150
152 Copyright (c) 1999-2004 Graham Barr. All rights reserved. This program
153 is free software; you can redistribute it and/or modify it under the
154 same terms as Perl itself.
155
156
157
158perl v5.28.1 2015-04-06 Net::LDAP::Control(3)