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 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"
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 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
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::EntryChange
121 Net::LDAP::Control::ManageDsaIT Net::LDAP::Control::Paged
122 Net::LDAP::Control::PasswordPolicy Net::LDAP::Control::PersistentSearch
123 Net::LDAP::Control::PostRead Net::LDAP::Control::PreRead
124 Net::LDAP::Control::ProxyAuth Net::LDAP::Control::Sort
125 Net::LDAP::Control::SortResult Net::LDAP::Control::SyncDone
126 Net::LDAP::Control::SyncRequest Net::LDAP::Control::SyncState
127 Net::LDAP::Control::VLV Net::LDAP::Control::VLVResponse
128
130 Graham Barr <gbarr@pobox.com>
131
132 Please report any bugs, or post any suggestions, to the perl-ldap
133 mailing list <perl-ldap@perl.org>
134
136 Copyright (c) 1999-2004 Graham Barr. All rights reserved. This program
137 is free software; you can redistribute it and/or modify it under the
138 same terms as Perl itself.
139
140
141
142perl v5.12.0 2010-03-12 Net::LDAP::Control(3)