public class Session
extends java.lang.Object
implements com.amazonaws.mobileconnectors.pinpoint.internal.core.util.JSONSerializable
Modifier and Type | Method and Description |
---|---|
java.lang.String |
generateSessionID(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext context)
Generates Session ID by concatenating present AppKey, UniqueID, and
|
java.lang.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(java.lang.String serializedSession)
Re-Generates a session object that has been serialized Returns null if
the input is null
|
java.lang.String |
getSessionID() |
long |
getStartTime() |
java.lang.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() |
java.lang.String |
toString() |
public static Session newInstance(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext context)
context
- The PinpointContext
public static Session getSessionFromSerializedSession(java.lang.String serializedSession)
serializedSession
- - a Session's serialization string.public boolean isPaused()
public void pause()
public void resume()
public java.lang.Long getSessionDuration()
public java.lang.String generateSessionID(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext context)
context
- The PinpointContext
public org.json.JSONObject toJSONObject()
toJSONObject
in interface com.amazonaws.mobileconnectors.pinpoint.internal.core.util.JSONSerializable
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSessionID()
public long getStartTime()
public java.lang.Long getStopTime()
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.