You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Merve Temizer <me...@gmail.com> on 2013/03/05 17:09:00 UTC

Can i save a byte array into an attribute?

Hello,

I am using Apache DS with a Java application.

I guess i can save a Java object as a byte array into an attribute.

Is it possible?

I have custom Directory server classes which i import into DS with ldif
files.

Also i have custom attribute types
under ou=attributeTypes,cn=adsconfig,ou=schema

If i want my custom classes to have byte array attributes, how should i
define these custom attributes?


Thanks

Re: Can i save a byte array into an attribute?

Posted by Merve Temizer <me...@gmail.com>.
Thanks in advance for detailed answer.


2013/3/5 Emmanuel Lécharny <el...@gmail.com>

> Le 3/5/13 5:09 PM, Merve Temizer a écrit :
> > Hello,
> >
> > I am using Apache DS with a Java application.
> >
> > I guess i can save a Java object as a byte array into an attribute.
>
> > Is it possible?
>
> Sure. You just have to select the correct AttributeType. In your case, if
> you want to store an instance of a Java class, you should use the
> javaSerializedData AttributeType, which is present in the Java schema (you
> just have to enable this schema, it's disabled by default AFAIR).
>
> >
> > I have custom Directory server classes which i import into DS with ldif
> > files.
> >
> > Also i have custom attribute types
> > under ou=attributeTypes,cn=adsconfig,ou=schema
> >
> > If i want my custom classes to have byte array attributes, how should i
> > define these custom attributes?
>
> Pick the OctetString syntax. This is what it's used for.
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Re: Can i save a byte array into an attribute?

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 3/5/13 5:09 PM, Merve Temizer a écrit :
> Hello,
>
> I am using Apache DS with a Java application.
>
> I guess i can save a Java object as a byte array into an attribute.

> Is it possible?

Sure. You just have to select the correct AttributeType. In your case, if you want to store an instance of a Java class, you should use the javaSerializedData AttributeType, which is present in the Java schema (you just have to enable this schema, it's disabled by default AFAIR).

>
> I have custom Directory server classes which i import into DS with ldif
> files.
>
> Also i have custom attribute types
> under ou=attributeTypes,cn=adsconfig,ou=schema
>
> If i want my custom classes to have byte array attributes, how should i
> define these custom attributes?

Pick the OctetString syntax. This is what it's used for.

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: Can i save a byte array into an attribute?

Posted by Merve Temizer <me...@gmail.com>.
Thanks i will use this guide


2013/3/5 Kiran Ayyagari <ka...@apache.org>

>
>
> On Tue, Mar 5, 2013 at 9:39 PM, Merve Temizer <me...@gmail.com>wrote:
>
>> Hello,
>>
>> I am using Apache DS with a Java application.
>>
>> I guess i can save a Java object as a byte array into an attribute.
>>
>> Is it possible?
>>
>> I have custom Directory server classes which i import into DS with ldif
>> files.
>>
>> Also i have custom attribute types
>> under ou=attributeTypes,cn=adsconfig,ou=schema
>>
>> try to avoid placing your custom attributes under the adsconfig schema,
> it is a good practice to place them under
> a new schema of your own
>
>> If i want my custom classes to have byte array attributes, how should i
>> define these custom attributes?
>>
>>
>> Thanks
>>
>
>
>
> --
> Kiran Ayyagari
> http://keydap.com

Re: Can i save a byte array into an attribute?

Posted by Kiran Ayyagari <ka...@apache.org>.
On Tue, Mar 5, 2013 at 9:39 PM, Merve Temizer <me...@gmail.com> wrote:

> Hello,
>
> I am using Apache DS with a Java application.
>
> I guess i can save a Java object as a byte array into an attribute.
>
> Is it possible?
>
> I have custom Directory server classes which i import into DS with ldif
> files.
>
> Also i have custom attribute types
> under ou=attributeTypes,cn=adsconfig,ou=schema
>
> try to avoid placing your custom attributes under the adsconfig schema, it
is a good practice to place them under
a new schema of your own

> If i want my custom classes to have byte array attributes, how should i
> define these custom attributes?
>
>
> Thanks
>



-- 
Kiran Ayyagari
http://keydap.com