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::Entry
does not take any arguments.
METHODS
- add ( ATTR => VALUE [, ATTR2 => VALUE2 ... ] )
-
Add attribute values to the entry.
VALUE
may be a reference to an array if multiple values are to be added. - replace ( ATTR => VALUE [, ATTR2 => VALUE2 ... ] )
-
Replace all existing values for
ATTR
withVALUE
.VALUE
may be a reference to an array of multiple values. IfVALUE
is a reference to an empty array the the attributeATTR
will be deleted. - delete ( )
- delete ( ATTR )
- delete ( ATTR => VALUE [, ATTR2 => VALUE2 ... ] )
-
If just
ATTR
is specified then then all values for the given attribute will be deleted. IfVALUE
is given then only the specified value is deleted.VALUE
may 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
delete
and a subsequent call to update will cause the entry to be deleted from the server - dn ( [ DN ] )
-
Get or set the
DN
for the entry. - update ( CLIENT )
-
update
will send the required commands to the server so that anyadd
,replace
,delete
methods 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
CLIENT
with the current contents of the object. - modify
-
A modify request will be sent to
CLIENT
, duplicating any prioradd
,replace
anddelete
methods that have been called on the object. - delete
-
A delete request will be sent to the
CLIENT
with the currentDN
of 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 ] )
-
TYPE
may 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.