[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| Re: [ecf-dev]  org.eclipse.ecf.presence.IFQID | 
Hi Scott,
obviously I'm not the only one who's working on sunday :) I've tried  
your new solution with the IFQID and it looks great!!! I will have a  
deep look at it during the week and check out whether the remote  
services are working properly with user/resource pairs, but my first  
impression is that it works pretty good. Thanks Scott!
You should not have to specify this property any longer:
props.put(Constants.SERVICE_REGISTRATION_TARGETS, targetIDs);
What is the right way to register remote services, just provide empty  
Dictionary<?> parameters?
Thanks,
Eugen
Am 02.11.2008 um 18:58 schrieb Scott Lewis:
Hi Eugen and all,
I believe I've worked out a solution for the XMPP resource id  
problem and committed to HEAD as described here
https://bugs.eclipse.org/bugs/show_bug.cgi?id=246155
Eugene I would appreciate it if you would try with your use case  
(accessing IFQID I mean).
As for the remote services issue...lets get in direct touch to  
figure out what's going wrong in your use case.
Thanks,
Scott
Scott Lewis wrote:
Hi Eugen,
Eugen Reiswich wrote:
Hi Scott,
I have tried out today both the IFQID and "on demand  
RemoteService" solution. Here are my findings:
The IFQID works fine now with resources but there is still a  
problem left. If I log-in two users with the same username and  
password only one of them is created/displayed correctly with the  
resource. There is no IRosterEntry created for the second user.  
But in order to deal with both user/resource pairs and to handle  
remote services for both user/resource pairs actually two  
IRosterEntry-objects will be needed - or something similar. Maybe  
the IFQID method fqID.getResourceName() could return an Array of  
all resources for a user? But if it does, how can remote services  
be than distinguished for each user/resource pair?
Arg.  I hate the fact that XMPP doesn't include the resource  
identifier in all uses of the id...this is the underlying cause of  
this problem...and means that the provider has to somehow devine  
the 'correct' resource identifier for multiple logins for the same  
account.  I'll take another look at this in the XMPP provider.
The remote service registration on demand doesn't work properly  
as well. I don't know why, but some services are registered  
properly others are not. If I log-in user A first and afterwards  
user B, some services of user A are registered properly to user B  
others are not. This is the way how I register remote services:
public void registerRemoteService(String serviceName, Object impl,
ID[] targetIDs) {
if (targetIDs == null) {
// register service to all user
targetIDs = RosterUtil.getUserIDs(getRoster());
Assert.isNotNull(targetIDs);
}
Dictionary<String, ID[]> props = new Hashtable<String, ID[]>();
props.put(Constants.SERVICE_REGISTRATION_TARGETS, targetIDs);
// register ECF remote service
getRemoteServiceContainerAdapter().registerRemoteService(
new String[] { serviceName }, impl, props);
logger.info("Service Registered: " + serviceName);
}
Please let me know if I can help you to sort this things out.
You should not have to specify this property any longer:
props.put(Constants.SERVICE_REGISTRATION_TARGETS, targetIDs);
I'm not sure if this is the source of your problem, but would you  
try it out without it?
Thanks,
Scott
Thanks,
Eugen
Am 30.10.2008 um 16:19 schrieb Scott Lewis:
Hi Eugen,
Eugen Reiswich wrote:
Hi Scott,
thanks for the hint with Remote-OSGi-Services in your last  
email. I will try it out this weekend and give you feedback.  
The problem with IDFQ is the following:
The 'id' I'm trying to get the resource for is an item in the  
IRosterEntry-object:
IRosterEntry entry = (IRosterEntry) object;
ID id = entry.getUser().getID();
_IFQID_ fqID = id.getAdapter(_IFQID_.class);
If I got it right the problem is located in the  
XMPPContainerPresenceHelper in this method:
protected void handleIQEvent(IQEvent evt) {
....
final IRosterEntry entry = createRosterEntry(item);
....
}
The IRosterEntry object created in this method does not contain  
any resources as the RosterPacket.Item 'item' doesn't have this  
information either. And if I try to obtain this information  
from the IRosterEntry-object the result is just a "/". I've  
been thinking how to solve this issue but I have got not idea  
how to obtain the resource information as in my opinion the  
RosterPacket.Item is the first and only information I get from  
the XMPP-Server. Have you got any ideas?
Yes, yesterday I added code that replaces the resource in the  
xmpp id when a message from server (presence available in many  
cases) arrives.  So now it should have the resource value for  
the xmppids of the available roster entries.  Please give it a  
try and see:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=246155
And even if we are able to get the resources for an ID, will  
all the Remote-OSGi-Services work with this? I mean there will  
be one user with several resources and though I'll need to  
distinguish the remote-services for each user/resource pair.  
Problems over problems, sorry for that. I already talked to  
Markus Alexander Kuppe and we'll meet in a few weeks to talk  
about this issue.
I think the solution I put in place should work properly,  
although any code that calls getResourceName() will have to deal  
with the possibility that the resource is null (since there is  
no info from the server or elsewhere about what the users id has  
as it's current resource).
Thanks,
Scott
Cheers,
Eugen
Am 29.10.2008 um 21:51 schrieb Scott Lewis:
Hi Eugen,
I'm looking at this now and need to ask...where are you  
calling the code
IDFQ idfq = (IDFQ) id.getAdapter(IDFQ.class);
idfq.getResourceName();
I guess what I'm asking is:  how do you get the 'id' above (is  
it a listener and if so which one).
Thanks,
Scott
Eugen Reiswich wrote:
Hi folks,
I'm trying to work with the above mentioned ID to get the  
resource for an XMPP-ID. According to this solution: https:// 
bugs.eclipse.org/bugs/show_bug.cgi?id=246155 I should be able  
to call:
IDFQ idfq = (IDFQ) id.getAdapter(IDFQ.class);
idfq.getResourceName();
But unfortunately this doesn't work for me. The resource I  
get is always empty. I'm basically trying to display online  
user in a tree with the associated resource using XMPP as  
protocol. When I debug my code my IRosterEntry-objects are  
all listed without a resource. This is the way how I retrieve  
the IRoster:
IPresenceContainerAdapter adapter =  
(IPresenceContainerAdapter) this.containter
.getAdapter(IPresenceContainerAdapter.class);
IRosterManager rosterManager = adapter.getRosterManager();
IRoster roster = rosterManager.getRoster(); I would really  
appreciate if someone could help me with my problem.
Cheers,
Eugen
---------------------------------------------------------------- 
--------
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx <mailto:ecf-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/ecf-dev
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx <mailto:ecf-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/ecf-dev
------------------------------------------------------------------ 
------
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx <mailto:ecf-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/ecf-dev
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx <mailto:ecf-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/ecf-dev
-------------------------------------------------------------------- 
----
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev