NAME
Net::LDAP::Entry -- An LDAP entry object
SYNOPSIS
use Net::LDAP::Entry;
$entry = Net::LDAP::Entry->new;
$entry->add(
attr1 => 'value1',
attr2 => [qw(value1 value2)]
);
$entry->delete( 'unwanted' );
$entry->replace(
attr1 => 'newvalue'
attr2 => [qw(new values)]
);
DESCRIPTION
Net::LDAP::Entry is a representation of an entry on an LDAP server. A Net::LDAP::Entry object is typically created as a result of a search on an LDAP server or by reading from an LDIF file with Net::LDAP::LDIF
CONSTRUCTOR
- new
-
The constructor for
Net::LDAP::Entrydoes not take any arguments.
METHODS
- add ( ATTR => VALUE [, ATTR2 => VALUE2 ... ] )
-
Add attribute values to the entry.
VALUEmay be a reference to an array if multiple values are to be added. - replace ( ATTR => VALUE [, ATTR2 => VALUE2 ... ] )
-
Replace all existing values for
ATTRwithVALUE.VALUEmay be a reference to an array of multiple values. IfVALUEis a reference to an empty array the the attributeATTRwill be deleted. - delete ( )
- delete ( ATTR )
- delete ( ATTR => VALUE [, ATTR2 => VALUE2 ... ] )
-
If just
ATTRis specified then then all values for the given attribute will be deleted. IfVALUEis given then only the specified value is deleted.VALUEmay be a reference to an array of values if more than one value for the same attribute is to be deleted.If delete is called with no arguments, then the changetype of the entry will be set to
deleteand a subsequent call to update will cause the entry to be deleted from the server - dn ( [ DN ] )
-
Get or set the
DNfor the entry. - update ( CLIENT )
-
updatewill send the required commands to the server so that anyadd,replace,deletemethods that were performed on the object are replicated on the server. The result depends on the current changetype of the entry.- add
-
An add request will be sent to
CLIENTwith the current contents of the object. - modify
-
A modify request will be sent to
CLIENT, duplicating any prioradd,replaceanddeletemethods that have been called on the object. - delete
-
A delete request will be sent to the
CLIENTwith the currentDNof the object.
- attributes
-
Returns a list of all the know attributes the entry has. This will either be a list of all the attibutes that were requested by a search request or all the attributes that were read from an LDIF file.
- get ( ATTR )
-
Returns a list of values for the attribute
ATTR - changetype ( [ TYPE ] )
-
TYPEmay be one ofadd,modify,delete. Calling without an argument will return the current changetype.The changetype affect what happens when update is called.
SEE ALSO
ACKNOWEDGEMENTS
This document is based on a document originally written by Russell Fulton <r.fulton@auckland.ac.nz>
AUTHOR
Graham Barr <gbarr@pobox.com>
COPYRIGHT
Copyright (c) 1997-8 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.