You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Ca...@ibs-ag.com on 2013/01/29 15:47:51 UTC

MultiValue attribute

Hi,
Congrats on the new releases!  I'm In the process of refactoring all our JNDI code to ApacheDS API :)

The attribute 'member' in our schema  for users is used to store group DN's a user is a member of.

We sometimes need to manipulate this group String[] with other logic and therefore need to retrieve it from the directory.
I can see if the list is the same with .contains but I can't figure out how to get  an array  of values out of an Attribute..?

http://directory.apache.org/api/gen-docs/latest/apidocs/


Thanks.



Re: MultiValue attribute

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 1/29/13 3:47 PM, Carlo.Accorsi@ibs-ag.com a écrit :
> Hi,
> Congrats on the new releases!  I'm In the process of refactoring all our JNDI code to ApacheDS API :)
>
> The attribute 'member' in our schema  for users is used to store group DN's a user is a member of.
>
> We sometimes need to manipulate this group String[] with other logic and therefore need to retrieve it from the directory.
> I can see if the list is the same with .contains but I can't figure out how to get  an array  of values out of an Attribute..?
>
> http://directory.apache.org/api/gen-docs/latest/apidocs/
There is no method that returns a list of values.

However, you don't really need such a method : you can iterate on the
values :

for ( Value<?> value : attribute )
{
    // Do whatever you need with the value...
}

I don't know if it fits your need...


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


RE: MultiValue attribute

Posted by Ca...@ibs-ag.com.
OK, that works.. thanks!	


-----Original Message-----
From: ayyagarikiran@gmail.com [mailto:ayyagarikiran@gmail.com] On Behalf Of Kiran Ayyagari
Sent: Tuesday, January 29, 2013 9:55 AM
To: users@directory.apache.org
Subject: Re: MultiValue attribute

right now the only way is to use iterator() method

On Tue, Jan 29, 2013 at 8:17 PM, <Ca...@ibs-ag.com> wrote:

> Hi,
> Congrats on the new releases!  I'm In the process of refactoring all 
> our JNDI code to ApacheDS API :)
>
> The attribute 'member' in our schema  for users is used to store group 
> DN's a user is a member of.
>
> We sometimes need to manipulate this group String[] with other logic 
> and therefore need to retrieve it from the directory.
> I can see if the list is the same with .contains but I can't figure 
> out how to get  an array  of values out of an Attribute..?
>
> http://directory.apache.org/api/gen-docs/latest/apidocs/
>
>
> Thanks.
>
>
>


--
Kiran Ayyagari
http://keydap.com

Re: MultiValue attribute

Posted by Kiran Ayyagari <ka...@apache.org>.
right now the only way is to use iterator() method

On Tue, Jan 29, 2013 at 8:17 PM, <Ca...@ibs-ag.com> wrote:

> Hi,
> Congrats on the new releases!  I'm In the process of refactoring all our
> JNDI code to ApacheDS API :)
>
> The attribute 'member' in our schema  for users is used to store group
> DN's a user is a member of.
>
> We sometimes need to manipulate this group String[] with other logic and
> therefore need to retrieve it from the directory.
> I can see if the list is the same with .contains but I can't figure out
> how to get  an array  of values out of an Attribute..?
>
> http://directory.apache.org/api/gen-docs/latest/apidocs/
>
>
> Thanks.
>
>
>


-- 
Kiran Ayyagari
http://keydap.com