Net::LDAP::Control (3)
Leading comments
Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) Standard preamble: ========================================================================
NAME
Net::LDAP::Control - LDAPv3 control object base classSYNOPSIS
use Net::LDAP::Control; use Net::LDAP::Constant qw( LDAP_CONTROL_MANAGEDSAIT ); my $req_ctrl1 = Net::LDAP::Control->new( type => LDAP_CONTROL_MANAGEDSAIT ); my $req_ctrl2 = Net::LDAP::Control->new( type => "1.2.3.4", value => "help", critical => 0 ); $mesg = $ldap->search( @args, control => [ $req_ctrl1, $req_ctrl2 ]); my @res_ctrls = $mesg->control();
DESCRIPTION
"Net::LDAP::Control" is the base-class for LDAPv3 control objects.Controls provide a mechanism that allows one to extend the semantics and arguments of
Controls sent by clients are termed request controls, and are set using the "control" option of the respective
Servers announce the controls they support in the attribute "supportedControls" in their RootDSE.
CONSTRUCTORS
- new ( ARGS)
-
ARGSis a list of name/value pairs, valid arguments are:
-
- critical
-
A Boolean value, if TRUEand the control is unrecognized by the server or is inappropriate for the requested operation then the server will return an error and the operation will not be performed.
If
FALSEand the control is unrecognized by the server or is inappropriate for the requested operation then the server will ignore the control and perform the requested operation as if the control was not given.If absent,
FALSEis assumed. - type
-
A dotted-decimal representation of an OBJECT IDENTIFIERwhich uniquely identifies the control. This prevents conflicts between control names.
This may be omitted if the constructor is being called on a sub-class of Net::LDAP::Control which has registered to be associated with an
OID.If the constructor is being called on the Net::LDAP::Control package, then this argument must be given. If the givenOIDhas been registered by a package, then the returned object will be of the type registered to handle thatOID. - value
- Optional information associated with the control. Its format is specific to the particular control.
-
- from_asn ( ASN)
-
ASNis aHASHreference, normally extracted from aPDU.It will contain a "type" element and optionally "critical" and "value" elements. On returnASNwill be blessed into a package. If "type" is a registeredOID,thenASNwill be blessed into the registered package, if not thenASNwill be blessed into Net::LDAP::Control.
This constructor is used internally by Net::LDAP and assumes that
HASHpassed contains a valid control. It should be used with caution.
METHODS
In addition to the methods listed below, each of the named parameters to "new" is also available as a method. "type" will return the- error ()
- If there has been an error returns a description of the error, otherwise it will return "undef"
- init ()
- "init" will be called as the last step in both constructors. What it does will depend on the sub-class. It must always return the object.
- register ( OID)
-
"register" is provided for sub-class implementors. It should be called as a class method
on a sub-class of Net::LDAP::Control with the OIDthat the class will handle. Net::LDAP::Control will remember this class andOIDpair and use it in the following situations.
-
- *
-
"new" is called as a class method on the Net::LDAP::Control package and OIDis passed as the type. The returned object will be blessed into the package that registered theOID.
- *
-
"new" is called as a class method on a registered package and the "type" is not
specified. The "type" will be set to the OIDregistered by that package.
- *
-
"from_asn" is called to construct an object from ASN.The returned object will be blessed into the package which was registered to handle theOIDin theASN.
-
- ( to_asn )
-
Returns a structure suitable for passing to Convert::ASN1 for
encoding. This method will be called by Net::LDAP when the
control is used.
The base class implementation of this method will call the "value" method without arguments to allow a sub-class to encode it's value. Sub-classes should not need to override this method.
- valid ()
-
Returns true if the object is valid and can be encoded. The default implementation
for this method is to return TRUEif there is no error, but sub-classes may override that.
SEE ALSO
Net::LDAP, Net::LDAP::RootDSE, Net::LDAP::Control::Assertion, Net::LDAP::Control::DontUseCopy, Net::LDAP::Control::EntryChange, Net::LDAP::Control::ManageDsaIT, Net::LDAP::Control::MatchedValues, Net::LDAP::Control::Paged, Net::LDAP::Control::PasswordPolicy, Net::LDAP::Control::PersistentSearch, Net::LDAP::Control::PostRead, Net::LDAP::Control::PreRead, Net::LDAP::Control::ProxyAuth, Net::LDAP::Control::Relax, Net::LDAP::Control::Sort, Net::LDAP::Control::SortResult, Net::LDAP::Control::SyncDone, Net::LDAP::Control::SyncRequest, Net::LDAP::Control::SyncState, Net::LDAP::Control::VLV, Net::LDAP::Control::VLVResponseAUTHOR
Graham Barr <gbarr@pobox.com>Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>