Show / Hide Table of Contents

Class SessionListenerBase<TMeta,TStatistics>

The base SessionListener class, that should be implemented by all session listeners.

Inheritance
java.lang.Object
SessionListenerBase<TMeta,TStatistics>
Implements
ISessionListener
Inherited Members
java.lang.Object.clone()
java.lang.Object.equals(java.lang.Object)
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.hashCode()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.toString()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)
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.lang.String game
java.util.UUID sessionId

Fields

game

The game of the listener.

Declaration
protected String game
Field Value
Type Description
java.lang.String

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.time.LocalTime

logger

The logger.

Declaration
protected Logger logger
Field Value
Type Description
org.apache.logging.log4j.Logger

manager

The DatabaseManager used for saving files.

Declaration
protected DatabaseManager manager
Field Value
Type Description
DatabaseManager

sessionId

The sessionId of the corresponding transmission session.

Declaration
protected UUID sessionId
Field Value
Type Description
java.util.UUID

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.util.List<ISubscriber<?>>

Methods

getGame()

Returns the game of the listener.

Declaration
public String getGame()
Returns
Type Description
java.lang.String

getLastReceived()

The last time statistics were received by the listener.

Declaration
public LocalTime getLastReceived()
Returns
Type Description
java.time.LocalTime

getSessionId()

The session listeners corresponding tranmission session sessionId.

Declaration
public UUID getSessionId()
Returns
Type Description
java.util.UUID

initialize(IMetaInformation metaInformation)

Initializes the SessionListener with the meta information for the session.

Declaration
public void initialize(IMetaInformation metaInformation)
Parameters
Type Name Description
IMetaInformation 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.apache.logging.log4j.Level logLevel

The logLevel of the message to log

java.lang.String message

The message to log

Implements

ISessionListener
In This Article
Back to top Generated by DocFX