InitialLdapContext class

2006-02-28 Thread Erwin Rol
A while back i wrote i had some problems with the InitialLdapContext
class. I added the following method to it, which seems to work for Open
Exchange, but since the documentation of what the method should return
for a LDAP name, i have no idea if it always is correct this way.
Comments are welcome.

public String getNameInNamespace ()
throws NamingException
{
String url = (String) myProps.get( PROVIDER_URL );
int i = url.lastIndexOf('/');
if (i == -1)
return ;
else
return url.substring(i + 1);
}


- Erwin





Re: Ldap support in classpath

2006-02-15 Thread Erwin Rol
On Wed, 2006-02-15 at 09:36 +0100, Robert Schuster wrote:

 I think what is missing here is someone with good knowledge on the details of
 javax.naming.

Well that isn't me, I am just trying to get OX working, and stumbled
over the naming thing.

 Naturally volunteers are more than welcome. :)

Well i will see if i can implement as much as is needed to get OX
working. Of course as soon as i start i will get a shit load of other
work to do and it will take for ever.

  Also OX needs LdapName which i found in the apache directory sources,
  are there any plans to add a LdapName implementation to classpath ?
 Is this a publc class of the java or javax namespace? If so we should provide 
 it.

It is new in 1.5 :
http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/ldap/LdapName.html

- Erwin





Re: Ldap support in classpath

2006-02-15 Thread Erwin Rol
On Wed, 2006-02-15 at 14:37 +0100, Mark Wielaard wrote:
 Hi Erwin,
 
 On Wed, 2006-02-15 at 14:08 +0100, Erwin Rol wrote:
  I am just trying to get OX working, and stumbled over the naming thing.
 
 This might be a new issue. I know that in the past some people did try
 to get it working already. There were a couple of small issues though.
 Upstream was aware of them, but might not have solved them all yet. See
 the following threads. Martin Kauss from OpenExchange was aware of the
 issues and might know a bit more about the current status and whether
 upstream has cleaned up some of these already:
 http://www.redhat.com/archives/fedora-devel-java-list/2005-July/thread.html#00095
 http://www.redhat.com/archives/fedora-devel-java-list/2005-July/thread.html#00076

There is no effort at all to remove com.sun. stuff from OX, at least all
the issues from those mails are still in the sourcecode, including the
BASE64, JNDI, javamail and ldap stuff.  

The BASE64 seems to have enough replacements, and was easy to fix. Not a
1:1 drop in but with a small OX patch.

The javamail should be doable with the latest class path if the methodes
that are used by OX are actually correctly implemented and are not dummy
exception throwing ones. 

the JNDI and ldap stuff seems the be a bit harder to fix. maybe the
jldap from Novell (now at openldap.org) could be used as a replacement,
but that will need some serious OX hacking. Or the missing naming stuff
should be implemented in classpath. The netscape jndi stuff might be
good enough also.

- Erwin





Re: Ldap support in classpath

2006-02-15 Thread Erwin Rol
On Wed, 2006-02-15 at 09:36 +0100, Robert Schuster wrote:
 Hi.
 
 Erwin Rol wrote:
  Hey all,
  
  I am trying to get Open Xchange working with gcj, and so far things are
  going OK. Now i ran into a problem with LDAP. OX uses
  InitialLdapContext(...) to create a initial context. Later it uses
  javax.naming.InitialContext.getNameInNamespace(...) and that always seem
  to throw a javax.naming.OperationNotSupportedException. After looking
  into the classpath source code it seems most methodes in .naming.* just
  throw a not supported error.
 Ouch. You found what we call a silent stub. A method that will not show up in
 the JAPI scores.
 

It seems the getNameInNamespace() correctly throws and
OperationNotSupportedException because the javax.nameing.InitialContext
does not know how about things to preform the action. The
LdapInitialContext is the one that knows this, but LdapInitialContext
does not have a getNameInNamespace() method, so the one of the base
class is used. 

How could it be made that those methods that LdapInitialContext should
overload show up as missing in the JAPI scores ?

- Erwin





Ldap support in classpath

2006-02-14 Thread Erwin Rol
Hey all,

I am trying to get Open Xchange working with gcj, and so far things are
going OK. Now i ran into a problem with LDAP. OX uses
InitialLdapContext(...) to create a initial context. Later it uses
javax.naming.InitialContext.getNameInNamespace(...) and that always seem
to throw a javax.naming.OperationNotSupportedException. After looking
into the classpath source code it seems most methodes in .naming.* just
throw a not supported error.
Is this simply because nobody had time yet to implement the real code,
or is this a real design decision ?

Also OX needs LdapName which i found in the apache directory sources,
are there any plans to add a LdapName implementation to classpath ?

- Erwin