|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.novanic.eventservice.service.registry.user.UserInfo
public class UserInfo
UserInfo is a class to represent all users/clients and to manage all their information.
It holds the events, the EventFilters (EventFilter) and the last
activity time for the user.
| Constructor Summary | |
|---|---|
UserInfo(java.lang.String aUserId)
Creates a new UserInfo for the user id. |
|
| Method Summary | |
|---|---|
void |
addEvent(Domain aDomain,
Event anEvent)
Adds an event for a domain to the user. |
int |
compareTo(UserInfo aUserInfo)
|
boolean |
equals(java.lang.Object anObject)
|
EventFilter |
getEventFilter(Domain aDomain)
Returns the EventFilter for the domain. |
long |
getLastActivityTime()
Returns the last activity time. |
UnlistenEvent |
getUnlistenEvent()
Returns the registered UnlistenEvent. |
java.lang.String |
getUserId()
Returns the user id. |
int |
hashCode()
|
boolean |
isEventsEmpty()
Checks if events are available. |
boolean |
removeEventFilter(Domain aDomain)
Removes the EventFilter for a domain. |
java.util.List<DomainEvent> |
retrieveEvents()
Returns and removes all recorded events. |
void |
setEventFilter(Domain aDomain,
EventFilter anEventFilter)
Sets an EventFilter to a domain. |
void |
setLastActivityTime(long aLastActivityTime)
Sets the last activity time. |
void |
setUnlistenEvent(UnlistenEvent anUnlistenEvent)
A custom UnlistenEvent can be set which is transferred
to all registered UnlistenEventListener instances when
an unlisten occurred (for example by a timeout or when a user/client leaves a domain). |
java.lang.String |
toString()
The user id is used to represent the UserInfo. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UserInfo(java.lang.String aUserId)
aUserId - user| Method Detail |
|---|
public java.lang.String getUserId()
public void addEvent(Domain aDomain,
Event anEvent)
aDomain - domainanEvent - eventpublic java.util.List<DomainEvent> retrieveEvents()
public boolean isEventsEmpty()
public void setEventFilter(Domain aDomain,
EventFilter anEventFilter)
aDomain - domain where the EventFilter should be applied.anEventFilter - EventFilter to filter the events for the domainpublic boolean removeEventFilter(Domain aDomain)
aDomain - domain where the EventFilter to remove is applied.
EventFilter is removed, otherwise false
(for example the EventFilter was already removed before)public EventFilter getEventFilter(Domain aDomain)
aDomain - domain
public UnlistenEvent getUnlistenEvent()
UnlistenEvent. That can be
a custom UnlistenEvent which can be set with
setUnlistenEvent(de.novanic.eventservice.client.event.listener.unlisten.UnlistenEvent)
or a default/generic UnlistenEvent when no custom
UnlistenEvent is registered.
UnlistenEvent to report a timeout or
a user/client which left a domain.public void setUnlistenEvent(UnlistenEvent anUnlistenEvent)
UnlistenEvent can be set which is transferred
to all registered UnlistenEventListener instances when
an unlisten occurred (for example by a timeout or when a user/client leaves a domain). When no custom
UnlistenEvent is registered, a default/generic
UnlistenEvent will be processed and reported.
anUnlistenEvent - UnlistenEvent which should be
triggered.public void setLastActivityTime(long aLastActivityTime)
aLastActivityTime - last activity timepublic long getLastActivityTime()
public int compareTo(UserInfo aUserInfo)
compareTo in interface java.lang.Comparable<UserInfo>public boolean equals(java.lang.Object anObject)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||