directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Doran <matt.do...@papercut.com>
Subject Re: Custom partition - obtaining network connection details
Date Mon, 29 Mar 2010 00:39:13 GMT
Emmanuel Lecharny wrote:
> On 3/28/10 2:11 PM, Matt Doran wrote:
>> On 28/03/2010 11:05 PM, Matt Doran wrote:
>>> On 28/03/2010 5:55 PM, Matt Doran wrote:
>>>> Hi there,
>>>>
>>>> I've been working through implementing a custom partition.  I have 
>>>> a peculiar requirement to know the details of the network 
>>>> connection where the request has come from when I'm processing the 
>>>> partition requests (i.e. in my custom partition implementation).
>>>>
>>>> I can't see anything obvious that might give me access to this 
>>>> information.  Is this possible?
>>>>
>>>> If I wanted to add this info (even as a thread local), is there a 
>>>> hook point that I could use to collect/save this information?
>>>>
>>>>
>>>
>>> I found the "getClientAddress()" method available on the session.  
>>> e.g.  in the following code fragment.
>>>
>>>         public ClonedServerEntry lookup(LookupOperationContext ctx) {
>>>
>>>             if (logger.isDebugEnabled()) {
>>>                 logger.debug("lookup(dn=" + ctx.getDn() + "), attrs: "
>>>    + ctx.getAttrsId()
>>>                         + " addr: " + 
>>> ctx.getSession().getClientAddress());
>>>             }
>>>
>>>
>>> However it always seems to be null even when making requests to the 
>>> server over the network.   Any ideas?
>>>
>>>
>> I just did some digging ..... and I found it.  Looks like it's not 
>> implemented on DefaultCoreSession ...
>>
>>         /* (non-Javadoc)
>>          * @see
>>    org.apache.directory.server.core.CoreSession#getClientAddress()
>>          */
>>         public SocketAddress getClientAddress()
>>         {
>>             // TODO Auto-generated method stub
>>             return null;
>>         }
>>
>>
>> Hmmm. :(
>>
>> Any ideas how I might be able to get the client network address?
> Actually,  we don't store networ information at the LDAP level. May be 
> we are wrong and we should do it.
>
> Can you fill a JIRA asking for those informations to be added into the 
> Ldap session ?
>
>
OK, I've raised an issue for this: 
https://issues.apache.org/jira/browse/DIRSERVER-1489

I'm looking for a short-term (even hacky) way to achieve this ... any 
suggestions on how I might push the network address into the 
DefaultCoreSession?

Thanks,
Matt




Mime
View raw message