You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-dev@incubator.apache.org by Mark Proctor <li...@markproctor.com> on 2006/12/23 21:57:59 UTC
How to identify sessions
I would like to store additional session data for a sesssion. I was
going to do this by having a HashMap in the FtpLet, but I need to find a
unique key for the request. Currently I can only think of using
connection time and user name, but this cannot be guaranteed to be
unique. Could we maybe have a long counter that is incremented for each
connection which can be used as an id and always available from the
FtpRequest?
Mark
Re: How to identify sessions
Posted by Mark Proctor <li...@markproctor.com>.
doh! you've already made it do key/value pairs, should have read the
email more closely. Just trying it out now.
Mark
Mark Proctor wrote:
> Yup that's fine, I can store a HashMap in there with key/value pairs
> for that session. We need to get an FAQ together for this sort of
> stuff :)
>
> Mark
> Niklas Gustavsson wrote:
>> Mark Proctor wrote:
>>> I would like to store additional session data for a sesssion. I was
>>> going to do this by having a HashMap in the FtpLet, but I need to
>>> find a unique key for the request. Currently I can only think of
>>> using connection time and user name, but this cannot be guaranteed
>>> to be unique. Could we maybe have a long counter that is incremented
>>> for each connection which can be used as an id and always available
>>> from the FtpRequest?
>>
>>
>> On FtpRequest you will find get/setAttribute() methods which are
>> meant for storing session associated data. Would this suffice for you?
>>
>> With the MINA refactoring coming up I'm planing for a more dedicated
>> session interface (split out from RequestHandler and FtpRequest).
>>
>> /niklas
>>
>>
>
>
Re: How to identify sessions
Posted by Mark Proctor <li...@markproctor.com>.
Yup that's fine, I can store a HashMap in there with key/value pairs for
that session. We need to get an FAQ together for this sort of stuff :)
Mark
Niklas Gustavsson wrote:
> Mark Proctor wrote:
>> I would like to store additional session data for a sesssion. I was
>> going to do this by having a HashMap in the FtpLet, but I need to
>> find a unique key for the request. Currently I can only think of
>> using connection time and user name, but this cannot be guaranteed to
>> be unique. Could we maybe have a long counter that is incremented for
>> each connection which can be used as an id and always available from
>> the FtpRequest?
>
>
> On FtpRequest you will find get/setAttribute() methods which are meant
> for storing session associated data. Would this suffice for you?
>
> With the MINA refactoring coming up I'm planing for a more dedicated
> session interface (split out from RequestHandler and FtpRequest).
>
> /niklas
>
>
Re: How to identify sessions
Posted by Niklas Gustavsson <ni...@protocol7.com>.
Mark Proctor wrote:
> I would like to store additional session data for a sesssion. I was
> going to do this by having a HashMap in the FtpLet, but I need to find a
> unique key for the request. Currently I can only think of using
> connection time and user name, but this cannot be guaranteed to be
> unique. Could we maybe have a long counter that is incremented for each
> connection which can be used as an id and always available from the
> FtpRequest?
On FtpRequest you will find get/setAttribute() methods which are meant
for storing session associated data. Would this suffice for you?
With the MINA refactoring coming up I'm planing for a more dedicated
session interface (split out from RequestHandler and FtpRequest).
/niklas