Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to rename an existing entry?

0 views
Skip to first unread message

Darren Santafe

unread,
Oct 6, 2000, 3:00:00 AM10/6/00
to
Hi,

I'm trying to rename the distinged name (DN) of an entry that exists in
my LDAP Directory. I want change the entry with its attributes to a new
DN path, using Java.

I'm using the Netscape 4.11 Directory Server, and I generate a
DirContext but when use the method "rename(DN, newDN)", the program
throw an OperationNotSupportedException (server not support moving
entries).

If anyone know how can I change the DN of an enrty, it would be greatly
appreciated.

Thanks in advance,

Darren


Mark Wilcox

unread,
Oct 7, 2000, 3:00:00 AM10/7/00
to Darren Santafe
The only guranteed way is to copy all of the attributes, create a new entry
and then delete the old entry.

Mark

Mike

unread,
Nov 27, 2000, 3:00:00 AM11/27/00
to
There is a way to do this without deleting the old entry. If you look
inside of javax.naming.Context you will find a method named: rebind().

rebind
public void rebind(String name,Object obj) throws NamingException

Binds a name to an object, overwriting any existing binding. See
rebind(Name, Object) for details.

Parameters:
name - the name to bind; may not be empty
obj - the object to bind; possibly null

Throws:
InvalidAttributesException - if object did not supply all mandatory
attributes
NamingException - if a naming exception is encountered


Mark Wilcox <mewi...@unt.edu> wrote in message
news:39DF5365...@unt.edu...

0 new messages