You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Alex Karasulu <ak...@apache.org> on 2009/08/30 14:17:31 UTC

[Shared] [Schema API] SchemaObject byOid and byName lookup issues

I'm running into several bugs and workaround because a byName hash was never
implemented in the new SchemaObject.  I guess this functionality had to be
taken out of the OidRegistry and placed into specific type registries to
avoid name collisions.  However I thought there would be a byName hash.

Any reason why this was explicitly not created ?

-- 
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org

Re: [Shared] [Schema API] SchemaObject byOid and byName lookup issues

Posted by Alex Karasulu <ak...@gmail.com>.
On Mon, Aug 31, 2009 at 10:25 AM, Emmanuel Lecharny <el...@apache.org>wrote:

> Alex Karasulu wrote:
>
>> On Mon, Aug 31, 2009 at 12:54 AM, Emmanuel Lecharny <elecharny@apache.org
>> >wrote:
>>
>>
>>
>>> Alex Karasulu wrote:
>>>
>>>
>>>
>>>> I'm running into several bugs and workaround because a byName hash was
>>>> never
>>>> implemented in the new SchemaObject.  I guess this functionality had to
>>>> be
>>>> taken out of the OidRegistry and placed into specific type registries to
>>>> avoid name collisions.  However I thought there would be a byName hash.
>>>>
>>>> Any reason why this was explicitly not created ?
>>>>
>>>>
>>>>
>>>>
>>> We don't need it. The byOid( String ) method (implemented in
>>> SchemaRegistries) retrieves the OID when a name or an oid is provided.
>>> You
>>> can do :
>>>
>>> String oid = attributeTypeRegistry.byOid( "ou" );
>>>
>>> or
>>>
>>> String oid = attributeTypeRegistry.byOid( "2.5.4.11" );
>>>
>>> That should be enough for our need.
>>>
>>>
>>>
>>
>> In theory yes but it did not work properly.
>>
> Then there are some bugs in the way we feed this unique data structure.
> Let's fix them instead of creating a redundant one.
>
>
OK cool.





-- 
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org

Re: [Shared] [Schema API] SchemaObject byOid and byName lookup issues

Posted by Emmanuel Lecharny <el...@apache.org>.
Alex Karasulu wrote:
> On Mon, Aug 31, 2009 at 12:54 AM, Emmanuel Lecharny <el...@apache.org>wrote:
>
>   
>> Alex Karasulu wrote:
>>
>>     
>>> I'm running into several bugs and workaround because a byName hash was
>>> never
>>> implemented in the new SchemaObject.  I guess this functionality had to be
>>> taken out of the OidRegistry and placed into specific type registries to
>>> avoid name collisions.  However I thought there would be a byName hash.
>>>
>>> Any reason why this was explicitly not created ?
>>>
>>>
>>>       
>> We don't need it. The byOid( String ) method (implemented in
>> SchemaRegistries) retrieves the OID when a name or an oid is provided. You
>> can do :
>>
>> String oid = attributeTypeRegistry.byOid( "ou" );
>>
>> or
>>
>> String oid = attributeTypeRegistry.byOid( "2.5.4.11" );
>>
>> That should be enough for our need.
>>
>>     
>
> In theory yes but it did not work properly. 
Then there are some bugs in the way we feed this unique data structure. 
Let's fix them instead of creating a redundant one.

I will spend some time on it today now that my env is updated.

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: [Shared] [Schema API] SchemaObject byOid and byName lookup issues

Posted by Alex Karasulu <ak...@gmail.com>.
On Mon, Aug 31, 2009 at 12:54 AM, Emmanuel Lecharny <el...@apache.org>wrote:

> Alex Karasulu wrote:
>
>> I'm running into several bugs and workaround because a byName hash was
>> never
>> implemented in the new SchemaObject.  I guess this functionality had to be
>> taken out of the OidRegistry and placed into specific type registries to
>> avoid name collisions.  However I thought there would be a byName hash.
>>
>> Any reason why this was explicitly not created ?
>>
>>
> We don't need it. The byOid( String ) method (implemented in
> SchemaRegistries) retrieves the OID when a name or an oid is provided. You
> can do :
>
> String oid = attributeTypeRegistry.byOid( "ou" );
>
> or
>
> String oid = attributeTypeRegistry.byOid( "2.5.4.11" );
>
> That should be enough for our need.
>

In theory yes but it did not work properly.  I debugged a bit then just
simplified the situation by creating the byName hash and everything worked
just fine.  So I did not ask any more questions.  Too tired at this point to
figure out why it did not work.  I'm sure the problems may creep back up to
figure out why.  And that might catch other bugs.

Personally having one method to use is best I agree.  Why have more surface
area to the API.  It's more exposure.

-- 
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org

Re: [Shared] [Schema API] SchemaObject byOid and byName lookup issues

Posted by Emmanuel Lecharny <el...@apache.org>.
Alex Karasulu wrote:
> I'm running into several bugs and workaround because a byName hash was never
> implemented in the new SchemaObject.  I guess this functionality had to be
> taken out of the OidRegistry and placed into specific type registries to
> avoid name collisions.  However I thought there would be a byName hash.
>
> Any reason why this was explicitly not created ?
>   
We don't need it. The byOid( String ) method (implemented in 
SchemaRegistries) retrieves the OID when a name or an oid is provided. 
You can do :

String oid = attributeTypeRegistry.byOid( "ou" );

or

String oid = attributeTypeRegistry.byOid( "2.5.4.11" );

That should be enough for our need.

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: [Shared] [Schema API] SchemaObject byOid and byName lookup issues

Posted by Emmanuel Lecharny <el...@apache.org>.
Alex Karasulu wrote:
> I'm running into several bugs and workaround because a byName hash was never
> implemented in the new SchemaObject.  I guess this functionality had to be
> taken out of the OidRegistry and placed into specific type registries to
> avoid name collisions.  However I thought there would be a byName hash.
>
> Any reason why this was explicitly not created ?
>   
I saw that the getOid() method has been replaced by a getOidByName() 
method. Not sure that the second method name is better, but in any case, 
as I explained in my previous answer, I think that having a byName Map 
into the SchemaObject instances is a duplication of data. We just need 
to rename the byOid()  ti byName, as the 'oid' usually represent not 
only the OID, but the name (this is the reason why the RFC mentions the 
numericOid in many places when it wants to refers to the OID).

I find it confusing, at best. byName() is probably better : this method 
will return the SchemaObject instance given one of its name ('ou' or 
'OrganizationalUnit') or its OID (2.5.4.11).

We can remove the duplicated Map.


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org