public class Session extends Object implements com.amazonaws.mobileconnectors.pinpoint.internal.core.util.JSONSerializable
| Modifier and Type | Field and Description |
|---|---|
protected static int |
SESSION_ID_APPKEY_LENGTH |
protected static String |
SESSION_ID_DATE_FORMAT |
protected static char |
SESSION_ID_DELIMITER |
protected static char |
SESSION_ID_PAD_CHAR |
protected static String |
SESSION_ID_TIME_FORMAT |
protected static int |
SESSION_ID_UNIQID_LENGTH |
| Modifier | Constructor and Description |
|---|---|
protected |
Session(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext context)
CONSTRUCTOR - ACTUAL Used by SessionClient
|
protected |
Session(String sessionID,
String startTime,
String stopTime)
Used by deserealizer
|
| Modifier and Type | Method and Description |
|---|---|
String |
generateSessionID(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext context)
Generates Session ID by concatenating present AppKey, UniqueID, and
|
Long |
getSessionDuration()
Calculates and returns the session's duration Returns a duration of 0 if
session is not paused or the system clock has been tampered with.
|
static Session |
getSessionFromSerializedSession(String serializedSession)
Re-Generates a session object that has been serialized Returns null if
the input is null
|
String |
getSessionID() |
long |
getStartTime() |
Long |
getStopTime() |
boolean |
isPaused()
Session is considered paused if stopTime is not null
|
static Session |
newInstance(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext context)
STATIC FACTORY
|
void |
pause()
Pauses the session object.
|
void |
resume()
Resumes the session object.
|
org.json.JSONObject |
toJSONObject() |
String |
toString() |
protected static final String SESSION_ID_DATE_FORMAT
protected static final String SESSION_ID_TIME_FORMAT
protected static final char SESSION_ID_DELIMITER
protected static final char SESSION_ID_PAD_CHAR
protected static final int SESSION_ID_APPKEY_LENGTH
protected static final int SESSION_ID_UNIQID_LENGTH
protected Session(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext context)
context - public static Session newInstance(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext context)
context - The PinpointContextpublic static Session getSessionFromSerializedSession(String serializedSession)
serializedSession - - a Session's serialization string.public boolean isPaused()
public void pause()
public void resume()
public Long getSessionDuration()
public String generateSessionID(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext context)
context - The PinpointContextpublic org.json.JSONObject toJSONObject()
toJSONObject in interface com.amazonaws.mobileconnectors.pinpoint.internal.core.util.JSONSerializablepublic String getSessionID()
public long getStartTime()
public Long getStopTime()
Copyright © 2019. All rights reserved.