You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Bernd Fondermann <bf...@brainlounge.de> on 2011/09/28 10:43:12 UTC
[Vysper][DISCUSS] Remove binding of multiple resources per session
Hi,
This is a substantial change, so I'd like to give it more visibility.
It was proposed to remove support from binding more than one resource
per session. Having mutliple resources per session is a corner use case.
Probably nobody is using it and even fewer understand how it could
possibly work.
However, if you are, or otherwise need this feature, please speak up.
Otherwise I'm +1 to remove it from Vysper and only allow one resource
per session. Note: This of course will not change the ability to have
more than one session, each with unique "full JIDs".
Bernd
On 28.09.11 00:44, Peter Saint-Andre wrote:
> On 9/27/11 4:42 PM, Mike Mahoney wrote:
>>
>>>
>>>> We'd be happy to
>>>>> provide the patch.
>>>
>>> I'd be very interested to review the patch. Please open a new JIRA
>>> (you can link it to VYSPER-11 if you want).
>>>
>>> I never implemented this because I wanted to route around
>>> potential problems like having to check the well-formed-ness of
>>> the client-proposed resource name and the potential runtime
>>> conditions when duplicate names are bound quasi-simultaneously.
>>
>> I do have one question about the current resource binding. It looks
>> like there is some support in there for binding multiple resources to
>> a single session (such as ResourceRegistry.unbindResource()). This
>> used to be specified in XEP-0193, but that is deprecated. Is there
>> any objection to removing that support?
>
> Yeah, that was a bit of an experimental feature that never made the cut
> in the XMPP world. I'd be in favor of removing it, unless folks have a
> compelling use case.
>
> Peter
>
Re: [Vysper][DISCUSS] Remove binding of multiple resources per session
Posted by Bernd Fondermann <bf...@brainlounge.de>.
On 29.09.11 22:50, Mike Mahoney wrote:
>
> On Sep 28, 2011, at 5:43 AM, Niklas Gustavsson wrote:
>
>> On Wed, Sep 28, 2011 at 10:43 AM, Bernd Fondermann
>> <bf...@brainlounge.de> wrote:
>>> It was proposed to remove support from binding more than one resource
>>> per session. Having mutliple resources per session is a corner use case.
>>> Probably nobody is using it and even fewer understand how it could
>>> possibly work.
>
> It looks like people were in favor of this, so I've begun working on it.
>
> Looking over the DefaultResourceRegistry it looks like there are some improvements that can be made if this isn't supported. One thing I am considering is making a change to AbstractSessionContext.bindResource(). Once the resource is bound, the resource field of the context's initiatingEntity could be set. That could remove the need for methods such as ResourceRegistry.getResourcesForSession() and ResourceRegistry.getUniqueResourceSession(), since the resource could just be queried from the SessionContext. Would people be opposed to removing those methods and refactoring the code that calls them? I'm still pretty new to the Vysper source, so just let me know if I'm missing something or if this is a bad idea.
You're right. ResourceRegistry would be greatly simplified.
Let's see:
a.
a1.
Map<SessionContext, List<String>> sessionResources
=> Map<SessionContext, String> sessionResources
a2.
Move resource id into SessionContext (could be done in a second
refactoring step)
b. SessionData
resourceState and priority can be conflated into SessionContext
NOTE: priority must be kept!
AFAICS, we would need to retain the other datastructures.
Please, let's separate the issue of having arbitrary resources accepted
from the client (VYSPER-297) from the issue of removing multiple
resources per session. For the latter, I've opened VYSPER-298.
Mike, I'm very much looking forward to your patches. It'd great if you'd
keep them small and keep the unit tests in mind. Thank you!
Bernd
Re: [Vysper][DISCUSS] Remove binding of multiple resources per
session
Posted by Mike Mahoney <mi...@thingworx.com>.
On Sep 28, 2011, at 5:43 AM, Niklas Gustavsson wrote:
> On Wed, Sep 28, 2011 at 10:43 AM, Bernd Fondermann
> <bf...@brainlounge.de> wrote:
>> It was proposed to remove support from binding more than one resource
>> per session. Having mutliple resources per session is a corner use case.
>> Probably nobody is using it and even fewer understand how it could
>> possibly work.
It looks like people were in favor of this, so I've begun working on it.
Looking over the DefaultResourceRegistry it looks like there are some improvements that can be made if this isn't supported. One thing I am considering is making a change to AbstractSessionContext.bindResource(). Once the resource is bound, the resource field of the context's initiatingEntity could be set. That could remove the need for methods such as ResourceRegistry.getResourcesForSession() and ResourceRegistry.getUniqueResourceSession(), since the resource could just be queried from the SessionContext. Would people be opposed to removing those methods and refactoring the code that calls them? I'm still pretty new to the Vysper source, so just let me know if I'm missing something or if this is a bad idea.
Thanks,
Mike
Re: [Vysper][DISCUSS] Remove binding of multiple resources per session
Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Wed, Sep 28, 2011 at 10:43 AM, Bernd Fondermann
<bf...@brainlounge.de> wrote:
> It was proposed to remove support from binding more than one resource
> per session. Having mutliple resources per session is a corner use case.
> Probably nobody is using it and even fewer understand how it could
> possibly work.
+1, go for it.
/niklas