Class SessionListenerBase<TMeta,TStatistics>
The base SessionListener class, that should be implemented by all session listeners.
Inheritance
Implements
Inherited Members
Namespace:
Assembly: .dll
Syntax
public abstract class SessionListenerBase<TMeta,TStatistics> implements ISessionListener
Type Parameters
Name | Description |
---|---|
TMeta | |
TStatistics |
Constructors
SessionListenerBase(String game, UUID sessionId)
Declaration
public SessionListenerBase(String game, UUID sessionId)
Parameters
Type | Name | Description |
---|---|---|
java. |
game | |
java. |
sessionId |
Fields
game
The game of the listener.
Declaration
protected String game
Field Value
Type | Description |
---|---|
java. |
isActive
Whether the listener is still actively listening to events.
Declaration
protected boolean isActive
Field Value
Type | Description |
---|---|
boolean |
lastReceived
The time at which the last statistics object was received for the session.
Declaration
protected LocalTime lastReceived
Field Value
Type | Description |
---|---|
java. |
logger
The logger.
Declaration
protected Logger logger
Field Value
Type | Description |
---|---|
org. |
manager
The DatabaseManager used for saving files.
Declaration
protected DatabaseManager manager
Field Value
Type | Description |
---|---|
Database |
sessionId
The sessionId of the corresponding transmission session.
Declaration
protected UUID sessionId
Field Value
Type | Description |
---|---|
java. |
subscribers
List of all subscribers. All subscribers in this list will be unsubscribed on the SessionClosedEvent.
Declaration
protected List<ISubscriber<?>> subscribers
Field Value
Type | Description |
---|---|
java. |
Methods
getGame()
Returns the game of the listener.
Declaration
public String getGame()
Returns
Type | Description |
---|---|
java. |
getLastReceived()
The last time statistics were received by the listener.
Declaration
public LocalTime getLastReceived()
Returns
Type | Description |
---|---|
java. |
getSessionId()
The session listeners corresponding tranmission session sessionId.
Declaration
public UUID getSessionId()
Returns
Type | Description |
---|---|
java. |
initialize(IMetaInformation metaInformation)
Initializes the SessionListener with the meta information for the session.
Declaration
public void initialize(IMetaInformation metaInformation)
Parameters
Type | Name | Description |
---|---|---|
IMeta |
metaInformation |
isActive()
Whether the ISessionListener is still actively listening to Events.
Declaration
public boolean isActive()
Returns
Type | Description |
---|---|
boolean |
onSessionClosed()
Called when the listeners corresponding session is closed.
Declaration
protected abstract void onSessionClosed()
onSessionStarted(TMeta metaInformation)
Called when the listeners is started.
Declaration
protected abstract void onSessionStarted(TMeta metaInformation)
Parameters
Type | Name | Description |
---|---|---|
TMeta | metaInformation | The meta information object using which the session was opened. |
processStatistics(TStatistics statistics)
Called upon reciving statistics for the current session. Is only called if the received Statistics object was not null.
Declaration
protected abstract void processStatistics(TStatistics statistics)
Parameters
Type | Name | Description |
---|---|---|
TStatistics | statistics | The received TStatistics object |
writeLog(Level logLevel, String message)
Writes to the log using a prefix containing session information.
Declaration
protected void writeLog(Level logLevel, String message)
Parameters
Type | Name | Description |
---|---|---|
org. |
logLevel | The logLevel of the message to log |
java. |
message | The message to log |