directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Wiley <debio...@gmail.com>
Subject Re: Adding an objectClass to an Entry
Date Tue, 13 Apr 2010 20:28:21 GMT
On Tue, Apr 13, 2010 at 3:22 PM, Kiran Ayyagari <ayyagarikiran@gmail.com>wrote:

> hi Andrew,
>
> On Tue, Apr 13, 2010 at 11:10 PM, Andrew Wiley <debio264@gmail.com> wrote:
> > I'm trying to figure out how to add an objectClass to an entry in the
> > directory, but I seem to be misunderstanding how modifications should
> work.
> > I'm trying something like this:
> > AttributeType attr = new AttributeType("objectClass");
> > Modification mod = new
> > ServerModification(ModificationOperation.ADD_ATTRIBUTE, new
> > DefaultServerAttribute(attr, "javaObject"));
> the attributeType in ApacheDS is not created manually rather obtained
> through a lookup operation on
> SchemaManager like
> dirService.getSchemaManager().lookupAttributeTypeRegistry(
> "objectClass" )
>
> having said that, you can create a modification in a rather easy way
> by using ClientModification and DefaultClientAttribute classes as
> shown below
>
>        EntryAttribute attribute = new DefaultClientAttribute(
> "objectClass", "javaObject" );
>        ClientModification cm = new ClientModification(
> ModificationOperation.ADD_ATTRIBUTE, attribute );
>
> Should I be using the ServerModificaton classes if my directory is
embedded?

Thanks,
Andrew Wiley

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message