|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
com.google.gwt.user.server.rpc.RemoteServiceServlet
de.novanic.eventservice.service.EventServiceImpl
public class EventServiceImpl
EventService is the server side interface to register listen
requests for domains and to add events.
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet |
|---|
perThreadRequest, perThreadResponse |
| Constructor Summary | |
|---|---|
EventServiceImpl()
|
|
| Method Summary | |
|---|---|
void |
addEvent(Domain aDomain,
Event anEvent)
Adds an event for all users in the domain. |
void |
addEventUserSpecific(Event anEvent)
Adds an event only for the current user. |
void |
deregisterEventFilter(Domain aDomain)
Deregisters the EventFilter of the domain. |
java.util.Set<Domain> |
getActiveListenDomains()
Returns the domain names, where the user is listening to |
protected java.lang.String |
getClientId(boolean isInitSession)
Returns the client id. |
EventFilter |
getEventFilter(Domain aDomain)
Returns the EventFilter for the user domain combination. |
void |
init(javax.servlet.ServletConfig aConfig)
The init method should be called automatically before the servlet can be used and should called only one time. |
void |
initEventService()
Initializes the EventService. |
boolean |
isUserRegistered(Domain aDomain)
Checks if the user is registered for event listening. |
java.util.List<DomainEvent> |
listen()
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)
Register listen for a domain. |
void |
register(Domain aDomain,
EventFilter anEventFilter)
Register listen for a domain. |
void |
register(java.util.Set<Domain> aDomains)
Register listen for a domain. |
void |
register(java.util.Set<Domain> aDomains,
EventFilter anEventFilter)
Register listen for domains. |
void |
registerEventFilter(Domain aDomain,
EventFilter anEventFilter)
Registers an EventFilter for the domain. |
void |
registerUnlistenEvent(UnlistenEventListener.Scope anUnlistenScope,
UnlistenEvent anUnlistenEvent)
Registers an UnlistenEvent which is triggered on a
timeout or when a user/client leaves a Domain. |
void |
unlisten()
Unlisten for events (for the current user) in all domains (deregisters the user from all domains). |
void |
unlisten(Domain aDomain)
Unlisten for events (for the current user) in the domain and deregisters the user from the domain. |
void |
unlisten(java.util.Set<Domain> aDomains)
Unlisten for events (for the current user) in the domains and deregisters the user from the domains. |
| Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet |
|---|
doGetSerializationPolicy, getSerializationPolicy, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processPost, shouldCompressResponse |
| Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet |
|---|
doPost, doUnexpectedFailure, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EventServiceImpl()
| Method Detail |
|---|
public void init(javax.servlet.ServletConfig aConfig)
throws javax.servlet.ServletException
EventRegistry.
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletaConfig - servlet configuration
javax.servlet.ServletExceptionpublic void initEventService()
EventService.
initEventService in interface EventServicepublic void register(Domain aDomain)
register in interface EventServiceaDomain - domain to listen to
public void register(Domain aDomain,
EventFilter anEventFilter)
register in interface EventServiceaDomain - domain to listen toanEventFilter - EventFilter to filter eventspublic void register(java.util.Set<Domain> aDomains)
register in interface EventServiceaDomains - domains to listen to
public void register(java.util.Set<Domain> aDomains,
EventFilter anEventFilter)
register in interface EventServiceaDomains - domains to listen toanEventFilter - EventFilter to filter events (applied to all domains)
public void registerUnlistenEvent(UnlistenEventListener.Scope anUnlistenScope,
UnlistenEvent anUnlistenEvent)
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.
registerUnlistenEvent in interface EventServiceanUnlistenScope - scope of the unlisten events to receiveanUnlistenEvent - UnlistenEvent which should
be transferred to other users/clients when a timeout occurs or a domain is leaved.
public void registerEventFilter(Domain aDomain,
EventFilter anEventFilter)
EventFilter for the domain.
registerEventFilter in interface EventServiceaDomain - domain to register the EventFilter toanEventFilter - EventFilter to filter events for the domainpublic void deregisterEventFilter(Domain aDomain)
EventFilter of the domain.
deregisterEventFilter in interface EventServiceaDomain - domain to drop the EventFilters frompublic EventFilter getEventFilter(Domain aDomain)
getEventFilter in interface EventServiceaDomain - domain
public java.util.List<DomainEvent> listen()
EventServiceConfiguration.
listen in interface EventServicepublic void unlisten()
unlisten in interface EventServicepublic void unlisten(Domain aDomain)
unlisten in interface EventServiceaDomain - domain to unlistenpublic void unlisten(java.util.Set<Domain> aDomains)
unlisten in interface EventServiceaDomains - set of domains to unlistenpublic boolean isUserRegistered(Domain aDomain)
isUserRegistered in interface EventServiceaDomain - domain to check
public void addEvent(Domain aDomain,
Event anEvent)
addEvent in interface EventServiceaDomain - domain to add the eventanEvent - event to addpublic void addEventUserSpecific(Event anEvent)
addEventUserSpecific in interface EventServiceanEvent - event to add to the userpublic java.util.Set<Domain> getActiveListenDomains()
getActiveListenDomains in interface EventServiceprotected java.lang.String getClientId(boolean isInitSession)
isInitSession - initializes the session (if not already initialized).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||