You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by david jones <jo...@gmail.com> on 2011/09/12 23:03:01 UTC

non-String values allowed for Attributes?

Is anything besides String supported for BasicAttribute?

I'm using ApacheDS 1.5.

added this to schema:

dn: m-oid=1.3.6.1.4.1.18060.0.9.1.1.2.1.3, ou=attributeTypes, cn=other,
ou=schema
objectclass: metaAttributeType
objectclass: metaTop
objectclass: top
m-oid: 1.3.6.1.4.1.18060.0.9.1.1.2.1.3
m-name: port
m-description: ip port
m-equality: integerMatch
m-syntax: 1.3.6.1.4.1.1466.115.121.1.27 (Integer)


code:

....
attributes.put(new BasicAttribute("ipV4Addr", "10.0.0.1");
attributes.put(new BasicAttribute("port", intPort);
...
ctx.createSubcontext(cnValue, attributes);


Looking at the created entry with Studio: it got created with the IP address
attribute, but not the port value. I don't see any errors in the ldap debug
printouts.

If i change code to:
         attributes.put(new BasicAttribute("port", intPort.toString());
and the schema to:
     m-syntax: 1.3.6.1.4.1.1466.115.121.1.26 (IA5 String)

The port gets added. I also have a boolean attribute that i'm adding as
Strings "true" | "false" for a similar reason. Is this expected behavior, or
am I missing something in my schema/code to allow non-String attribute
values?

-- 
David Jones
jonesda24@gmail.com

Re: non-String values allowed for Attributes?

Posted by Stefan Seelmann <se...@apache.org>.
Hi David,

I replied already to the user mailing list:
http://mail-archives.apache.org/mod_mbox/directory-users/201109.mbox/%3CCAPz8h_UYi9my9geOX2YBr9+nSTyGfCZs4PO5vHNktY_5mfBDLg@mail.gmail.com%3E

Kind Regards,
Stefan


On Mon, Sep 12, 2011 at 11:03 PM, david jones <jo...@gmail.com> wrote:
> Is anything besides String supported for BasicAttribute?
> I'm using ApacheDS 1.5.
> added this to schema:
>
> dn: m-oid=1.3.6.1.4.1.18060.0.9.1.1.2.1.3, ou=attributeTypes, cn=other,
> ou=schema
> objectclass: metaAttributeType
> objectclass: metaTop
> objectclass: top
> m-oid: 1.3.6.1.4.1.18060.0.9.1.1.2.1.3
> m-name: port
> m-description: ip port
> m-equality: integerMatch
> m-syntax: 1.3.6.1.4.1.1466.115.121.1.27 (Integer)
>
> code:
>
> ....
> attributes.put(new BasicAttribute("ipV4Addr", "10.0.0.1");
> attributes.put(new BasicAttribute("port", intPort);
> ...
> ctx.createSubcontext(cnValue, attributes);
>
> Looking at the created entry with Studio: it got created with the IP address
> attribute, but not the port value. I don't see any errors in the ldap debug
> printouts.
> If i change code to:
>          attributes.put(new BasicAttribute("port", intPort.toString());
> and the schema to:
>      m-syntax: 1.3.6.1.4.1.1466.115.121.1.26 (IA5 String)
> The port gets added. I also have a boolean attribute that i'm adding as
> Strings "true" | "false" for a similar reason. Is this expected behavior, or
> am I missing something in my schema/code to allow non-String attribute
> values?
>
> --
> David Jones
> jonesda24@gmail.com
>
>

Re: non-String values allowed for Attributes?

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 9/12/11 11:03 PM, david jones wrote:
> Is anything besides String supported for BasicAttribute?

BasicAttribute is a JNDI class, you probably get some answer in the 
associatedJavadoc (sorry for the short answer, I'm currently off and 
just looking at my mails from time to time);


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