de.novanic.eventservice.client.event.service
Interface EventServiceAsync


public interface EventServiceAsync

EventService is the server side interface to register listen requests for domains and to add events.

Author:
sstrohschein
Date: 05.06.2008
Time: 19:07:07

Method Summary
 void addEvent(Domain aDomain, Event anEvent, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Adds an event for all users in the domain.
 void addEventUserSpecific(Event anEvent, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Adds an event only for the current user.
 void deregisterEventFilter(Domain aDomain, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Deregisters the EventFilter of the domain.
 void getActiveListenDomains(com.google.gwt.user.client.rpc.AsyncCallback<java.util.Set<Domain>> async)
          Returns the domain names, where the user is listening to
 void getEventFilter(Domain aDomain, com.google.gwt.user.client.rpc.AsyncCallback<EventFilter> async)
          Returns the EventFilter for the user domain combination.
 void initEventService(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Initializes the EventService.
 void isUserRegistered(Domain aDomain, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> async)
          Checks if the user is registered for event listening.
 void listen(com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<DomainEvent>> async)
          The listen method returns all events for the user (events for all domains where the user is registered and user specific events).
 void register(Domain aDomain, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Register listen for a domain.
 void register(Domain aDomain, EventFilter anEventFilter, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Register listen for a domain.
 void register(java.util.Set<Domain> aDomains, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Register listen for a domain.
 void register(java.util.Set<Domain> aDomains, EventFilter anEventFilter, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Register listen for domains.
 void registerEventFilter(Domain aDomain, EventFilter anEventFilter, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Registers an EventFilter for the domain.
 void registerUnlistenEvent(UnlistenEventListener.Scope anUnlistenScope, UnlistenEvent anUnlistenEvent, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Registers an UnlistenEvent which is triggered on a timeout or when a user/client leaves a Domain.
 void unlisten(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Unlisten for events (for the current user) in all domains (deregisters the user from all domains).
 void unlisten(Domain aDomain, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Unlisten for events
 void unlisten(java.util.Set<Domain> aDomains, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
          Unlisten for events (for the current user) in the domains and deregisters the user from the domains.
 

Method Detail

initEventService

void initEventService(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Initializes the EventService.


register

void register(Domain aDomain,
              com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Register listen for a domain.

Parameters:
aDomain - domain to listen to

register

void register(Domain aDomain,
              EventFilter anEventFilter,
              com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Register listen for a domain.

Parameters:
aDomain - domain to listen to
anEventFilter - EventFilter to filter events

register

void register(java.util.Set<Domain> aDomains,
              com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Register listen for a domain.

Parameters:
aDomains - domains to listen to

register

void register(java.util.Set<Domain> aDomains,
              EventFilter anEventFilter,
              com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Register listen for domains.

Parameters:
aDomains - domains to listen to
anEventFilter - EventFilter to filter events (applied to all domains)

registerUnlistenEvent

void registerUnlistenEvent(UnlistenEventListener.Scope anUnlistenScope,
                           UnlistenEvent anUnlistenEvent,
                           com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Registers an UnlistenEvent which is triggered on a timeout or when a user/client leaves a Domain. An UnlistenEvent is hold at the server side and can contain custom data. Other users/clients can use the custom data when the event is for example triggered by a timeout.

Parameters:
anUnlistenScope - scope of the unlisten events to receive
anUnlistenEvent - UnlistenEvent which should be transferred to other users/clients when a timeout occurs or a domain is leaved.

registerEventFilter

void registerEventFilter(Domain aDomain,
                         EventFilter anEventFilter,
                         com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Registers an EventFilter for the domain.

Parameters:
aDomain - domain to register the EventFilter to
anEventFilter - EventFilter to filter events for the domain

deregisterEventFilter

void deregisterEventFilter(Domain aDomain,
                           com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Deregisters the EventFilter of the domain.

Parameters:
aDomain - domain to drop the EventFilters from

getEventFilter

void getEventFilter(Domain aDomain,
                    com.google.gwt.user.client.rpc.AsyncCallback<EventFilter> async)
Returns the EventFilter for the user domain combination.

Parameters:
aDomain - domain

listen

void listen(com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<DomainEvent>> async)
The listen method returns all events for the user (events for all domains where the user is registered and user specific events). If no events are available, the method waits a defined time before the events are returned. The client side calls the method with a defined interval to receive all events. If the client don't call the method in the interval, the user will be removed from the EventRegistry. The timeout time and the waiting time can be configured with EventServiceConfiguration/-Factory (server side) and initialized with the init method of EventRegistryFactory (server side).


unlisten

void unlisten(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Unlisten for events (for the current user) in all domains (deregisters the user from all domains).


unlisten

void unlisten(Domain aDomain,
              com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Unlisten for events

Parameters:
aDomain - the domain to unlisten

unlisten

void unlisten(java.util.Set<Domain> aDomains,
              com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Unlisten for events (for the current user) in the domains and deregisters the user from the domains.

Parameters:
aDomains - set of domains to unlisten

isUserRegistered

void isUserRegistered(Domain aDomain,
                      com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> async)
Checks if the user is registered for event listening.

Parameters:
aDomain - domain to check

addEvent

void addEvent(Domain aDomain,
              Event anEvent,
              com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Adds an event for all users in the domain.

Parameters:
aDomain - domain to add the event
anEvent - event to add

addEventUserSpecific

void addEventUserSpecific(Event anEvent,
                          com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> async)
Adds an event only for the current user.

Parameters:
anEvent - event to add to the user

getActiveListenDomains

void getActiveListenDomains(com.google.gwt.user.client.rpc.AsyncCallback<java.util.Set<Domain>> async)
Returns the domain names, where the user is listening to