Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 2887 invoked from network); 20 Aug 2008 14:19:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Aug 2008 14:19:35 -0000 Received: (qmail 76959 invoked by uid 500); 20 Aug 2008 14:19:34 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 76902 invoked by uid 500); 20 Aug 2008 14:19:33 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 76891 invoked by uid 99); 20 Aug 2008 14:19:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2008 07:19:33 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of akarasulu@gmail.com designates 74.125.44.30 as permitted sender) Received: from [74.125.44.30] (HELO yx-out-2324.google.com) (74.125.44.30) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2008 14:18:34 +0000 Received: by yx-out-2324.google.com with SMTP id 8so250313yxb.55 for ; Wed, 20 Aug 2008 07:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type:references :x-google-sender-auth; bh=K6U4X+U/ouHw1VUclQL1nTrQ3O3i11bacSBuyTwX+gY=; b=ZmkFpMlIcA991llVCoMCog6MIPxPBo/Zy6O17s7ltWuifaX5oTMuWSY4FqkYCKeBzS Ul2U4baivrcjskbyIPh+EOSJgSnWD/ipMtiQfxLpk0nqyEas07fMgc4HeWcb7xNhX31h dwudyjQjdZkLe8yDq4DDlWOiiEKkkpLWWPEXI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=S81NBCeH42jicETkv5pkuXyN2nf85XoYmm+UcMxxTBJZBtMqRzNoLqw1V4CLDHBc8C rIN2R4apWWJpcKbV+5l1EHsasTEOgsTSltOCOB4nFpLa0elncdKh96pZtLHVNgAQcP8X bF5kvDnTFC06hrZiXLakxZipIVVXPKhibqfig= Received: by 10.114.154.12 with SMTP id b12mr151154wae.153.1219241932952; Wed, 20 Aug 2008 07:18:52 -0700 (PDT) Received: by 10.114.66.3 with HTTP; Wed, 20 Aug 2008 07:18:52 -0700 (PDT) Message-ID: Date: Wed, 20 Aug 2008 10:18:52 -0400 From: "Alex Karasulu" Sender: akarasulu@gmail.com To: "Apache Directory Developers List" , elecharny@nextury.com Subject: Re: [ApacheDS] Why is setLdapServer() called on LdapSession? In-Reply-To: <48ABA71B.10302@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_21198_12289198.1219241932947" References: <48ABA71B.10302@gmail.com> X-Google-Sender-Auth: c26eadfa01962a0d X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_21198_12289198.1219241932947 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wed, Aug 20, 2008 at 1:09 AM, Emmanuel Lecharny wro= te: > Alex Karasulu wrote: > >> Emmanuel, >> >> You're calling session.setLdapServer() on sessions when you're getting >> them >> from the LdapServer in the first place. Take a look at line 120 of >> LdapRequestHandler to see. I was wondering should not this already be s= et >> when you get the LdapSession from the LdapServer? >> >> > This is to have a direct access to the ldapSession instance from the > ldapServer. If we don't do that, we have to look into the session map to = get > access to it, which is a little bit more complex. > > Now, the question is why is it not set when the session is created the > first time ? The LdapSession instance is created in the LdapProcotolHandl= er > class in ldapServer. Yeah why don't we set it. Creating this field then not having it set on creation leaves us to have to set this value explicitly. Just seems like a great way to have a NPE creep up after some refactoring later on. > > Thanks, >> Alex >> >> >> > > > -- > -- > cordialement, regards, > Emmanuel L=E9charny > www.iktek.com > directory.apache.org > > > --=20 Microsoft gives you Windows, Linux gives you the whole house ... ------=_Part_21198_12289198.1219241932947 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline


On Wed, Aug 20, 2008 at= 1:09 AM, Emmanuel Lecharny <elecharny@gmail.com> wrote:
Alex Karasulu wrote:
Emmanuel,

You're calling session.setLdapServer() on sessions when you're gett= ing them
from the LdapServer in the first place.  Take a look at line 120 of LdapRequestHandler to see.  I was wondering should not this already be= set
when you get the LdapSession from the LdapServer?
 
This is to have a direct access to the ldapSession instance from the ldapSe= rver. If we don't do that, we have to look into the session map to get = access to it, which is a little bit more complex.

Now, the question is why is it not set when the session is created the firs= t time ? The LdapSession instance is created in the LdapProcotolHandler cla= ss in ldapServer.

Yeah why don't we set it.  = Creating this field then not having it set on creation leaves us to have to= set this value explicitly.  Just seems like a great way to have a NPE= creep up after some refactoring later on.
 

Thanks,
Alex

 


--
--
cordialement, regards,
Emmanuel L=E9charny
www.iktek.com
directory.apache.= org





--
Microsoft gives = you Windows, Linux gives you the whole house ...
------=_Part_21198_12289198.1219241932947--