-
- All Implemented Interfaces:
-
co.elastic.apm.android.sdk.internal.api.Initializable
public final class SessionManager implements Initializable
Provides an ID that has a 30 mins timeout that gets reset on every call to getSessionId - If 30 mins or more have passed since the last call, then a new session id is generated.
The session ID is persisted until the timeout completes, even after an app relaunch.
-
-
Constructor Summary
Constructors Constructor Description SessionManager(SessionIdGenerator sessionIdGenerator)
-
Method Summary
Modifier and Type Method Description synchronized StringgetSessionId()static SessionManagerget()static voidset(SessionManager sessionManager)static voidresetForTest()synchronized voidforceRefreshId()voidaddObserver(SessionObserver observer)voidinitialize()-
-
Constructor Detail
-
SessionManager
SessionManager(SessionIdGenerator sessionIdGenerator)
-
-
Method Detail
-
getSessionId
@NonNull() synchronized String getSessionId()
-
get
static SessionManager get()
-
set
static void set(SessionManager sessionManager)
-
resetForTest
static void resetForTest()
-
forceRefreshId
synchronized void forceRefreshId()
-
addObserver
void addObserver(SessionObserver observer)
-
initialize
void initialize()
-
-
-
-