tomasbilek / gwteventservice

Automatically exported from code.google.com/p/gwteventservice
Other
0 stars 0 forks source link

Send an userspecific event to a domain #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of the product are you using? On what operating system?
1.0.2

Please provide any additional information below.
I also would like to fire user&domain-specific events. Currently an event
is either domain-specific OR user-specific.

a

  addEvent(Domain aDomain, String aUserId, Event anEvent)

method within the EventRegistry interface would be nice

Original issue reported on code.google.com by dem...@googlemail.com on 22 Oct 2009 at 4:40

GoogleCodeExporter commented 8 years ago
You mean when a user has more than one listener registered to different domains 
and
only one listener should be informed and the other users of the domain 
shouldn't be
informed? I think that is very seldom, but should be integrated, because there 
is no
clean way to solve that without API-changes at the moment. The apply-method of 
the
listener could filter that event, but that isn't a good solution.

That can be solved with version 1.1.x or 1.2.

Original comment by sven.strohschein@googlemail.com on 23 Oct 2009 at 5:21

GoogleCodeExporter commented 8 years ago
If this is possible I rather prefer filtering on EventType level.

For example I added something like this:
public interface ServerSideEventFilter {
    boolean match(Domain aDomain, UserInfo aUserInfo, Event anEvent);
}

and I modified method in DefaultEventRegistry:
    private boolean isEventValid(Domain aDomain, UserInfo aUserInfo, Event anEvent, EventFilter anEventFilter) {
        return (anEventFilter == null || anEventFilter.match(anEvent)) && (serverSideEventFilter == null || 
serverSideEventFilter.match(aDomain, aUserInfo, anEvent));
    }

Note this is method from very odl GwtEventService ;) I did it long time ago and 
it works.

In simplest words: I need to check privileges of user before I send him event.

Original comment by bartosz....@gmail.com on 27 Nov 2009 at 7:48

GoogleCodeExporter commented 8 years ago
Sending message to specific user in domain is a very vital case. Currently i 
use domain name which has a user name postfix : chatDomain_john. However the 
following method should do it much more convienience:
addEvent(Domain aDomain, String aUserId, Event anEvent)

Original comment by werde...@gmail.com on 11 Feb 2011 at 7:57