public interface EventRegistry
EventServiceImpl
.
EventServiceImpl
Modifier and Type | Method and Description |
---|---|
void |
addEvent(Domain aDomain,
Event anEvent)
Adds an event to a domain.
|
void |
addEventUserSpecific(String aUserId,
Event anEvent)
Adds an event directly to a user.
|
EventServiceConfiguration |
getConfiguration()
Returns the initialized
EventServiceConfiguration |
EventFilter |
getEventFilter(Domain aDomain,
String aUserId)
Returns the EventFilter for the user domain combination.
|
Set<Domain> |
getListenDomains()
Returns all registered/activated domains.
|
Set<Domain> |
getListenDomains(String aUserId)
Returns all domains where the user is registered to.
|
Set<String> |
getRegisteredUserIds()
Returns all registered users/clients.
|
Set<String> |
getRegisteredUserIds(Domain aDomain)
Returns all registered users/client of a specific
Domain . |
boolean |
isUserRegistered(Domain aDomain,
String aUserId)
Checks if the user is registered for the corresponding domain.
|
boolean |
isUserRegistered(String aUserId)
Checks if the user is registered for any domain.
|
List<DomainEvent> |
listen(ConnectionStrategyServerConnector aServerEventListener,
String aUserId)
The listen method returns all events for the user (events for all domains where the user is registered and user
specific events).
|
void |
registerUnlistenEvent(String aUserId,
UnlistenEventListener.Scope anUnlistenScope,
UnlistenEvent anUnlistenEvent)
Registers an
UnlistenEvent which is triggered on a
timeout or when a user/client leaves a Domain . |
void |
registerUser(Domain aDomain,
String aUserId,
EventFilter anEventFilter)
Registers a user for listening for the corresponding domain.
|
void |
removeEventFilter(Domain aDomain,
String aUserId)
EventFilters can be removed for a user domain combination with that method.
|
void |
setEventFilter(Domain aDomain,
String aUserId,
EventFilter anEventFilter)
The EventFilter for a user domain combination can be set or changed with that method.
|
void |
unlisten(Domain aDomain,
String aUserId)
This method causes a stop of listening for a domain (
listen(de.novanic.eventservice.service.connection.strategy.connector.ConnectionStrategyServerConnector , String) ). |
void |
unlisten(String aUserId)
This method causes a stop of listening for all domains (
listen(de.novanic.eventservice.service.connection.strategy.connector.ConnectionStrategyServerConnector , String) ). |
boolean isUserRegistered(String aUserId)
aUserId
- the user to checkboolean isUserRegistered(Domain aDomain, String aUserId)
aDomain
- the domain to checkaUserId
- the user to checkvoid registerUser(Domain aDomain, String aUserId, EventFilter anEventFilter)
listen(de.novanic.eventservice.service.connection.strategy.connector.ConnectionStrategyServerConnector , String)
) is called. The EventFilter
is optional and can be NULL.aDomain
- the domain to listenaUserId
- the user to registeranEventFilter
- EventFilter to filter the domain events (optional, can be NULL)void setEventFilter(Domain aDomain, String aUserId, EventFilter anEventFilter)
aDomain
- domainaUserId
- useranEventFilter
- new EventFilterEventFilter getEventFilter(Domain aDomain, String aUserId)
aDomain
- domainaUserId
- uservoid removeEventFilter(Domain aDomain, String aUserId)
aUserId
- useraDomain
- domainList<DomainEvent> listen(ConnectionStrategyServerConnector aServerEventListener, String aUserId)
EventServiceConfiguration
.aServerEventListener
- ConnectionStrategyServerConnector
for the listening methodaUserId
- uservoid unlisten(Domain aDomain, String aUserId)
listen(de.novanic.eventservice.service.connection.strategy.connector.ConnectionStrategyServerConnector , String)
).aDomain
- domain to stop listeningaUserId
- uservoid unlisten(String aUserId)
listen(de.novanic.eventservice.service.connection.strategy.connector.ConnectionStrategyServerConnector , String)
).aUserId
- userSet<Domain> getListenDomains(String aUserId)
aUserId
- userSet<Domain> getListenDomains()
Set<String> getRegisteredUserIds()
Domain
,
the method getRegisteredUserIds(de.novanic.eventservice.client.event.domain.Domain)
can be used instead.Set<String> getRegisteredUserIds(Domain aDomain)
Domain
.
To get all the registered users/client (of all domains), the method getRegisteredUserIds()
can be used instead.aDomain
- domainvoid addEvent(Domain aDomain, Event anEvent)
aDomain
- domain for the eventanEvent
- event to addvoid addEventUserSpecific(String aUserId, Event anEvent)
aUserId
- useranEvent
- eventvoid registerUnlistenEvent(String aUserId, 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.aUserId
- user to register the UnlistenEvent
toanUnlistenScope
- 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.EventServiceConfiguration getConfiguration()
EventServiceConfiguration
EventServiceConfiguration
Copyright © 2012. All Rights Reserved.