Package io.sentry
Class Session
java.lang.Object
io.sentry.Session
- All Implemented Interfaces:
JsonSerializable
,JsonUnknown
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
static enum
Session state -
Constructor Summary
ConstructorDescriptionSession
(@NotNull Session.State status, @NotNull Date started, @Nullable Date timestamp, int errorCount, @Nullable String distinctId, @Nullable UUID sessionId, @Nullable Boolean init, @Nullable Long sequence, @Nullable Double duration, @Nullable String ipAddress, @Nullable String userAgent, @Nullable String environment, @NotNull String release, @Nullable String abnormalMechanism) Session
(@Nullable String distinctId, @Nullable User user, @Nullable String environment, @NotNull String release) -
Method Summary
Modifier and TypeMethodDescription@NotNull Session
clone()
Ctor copy of the Sessionvoid
end()
Ends a session and update its valuesvoid
Ends a session and update its valuesint
@Nullable String
@Nullable String
@Nullable Double
@Nullable String
@Nullable Boolean
getInit()
@Nullable String
@NotNull String
@Nullable Long
@Nullable UUID
@Nullable Date
@NotNull Session.State
@Nullable Date
@Nullable String
boolean
void
serialize
(@NotNull ObjectWriter writer, @NotNull ILogger logger) void
Used for migrating the init flag when an session is gonna be deleted.void
setUnknown
(@Nullable Map<String, Object> unknown) boolean
update
(@Nullable Session.State status, @Nullable String userAgent, boolean addErrorsCount) boolean
update
(@Nullable Session.State status, @Nullable String userAgent, boolean addErrorsCount, @Nullable String abnormalMechanism) Updates the current session and set its values
-
Constructor Details
-
Session
public Session(@NotNull @NotNull Session.State status, @NotNull @NotNull Date started, @Nullable @Nullable Date timestamp, int errorCount, @Nullable @Nullable String distinctId, @Nullable @Nullable UUID sessionId, @Nullable @Nullable Boolean init, @Nullable @Nullable Long sequence, @Nullable @Nullable Double duration, @Nullable @Nullable String ipAddress, @Nullable @Nullable String userAgent, @Nullable @Nullable String environment, @NotNull @NotNull String release, @Nullable @Nullable String abnormalMechanism) -
Session
-
-
Method Details
-
isTerminated
public boolean isTerminated() -
getStarted
-
getDistinctId
-
getSessionId
-
getIpAddress
-
getUserAgent
-
getEnvironment
-
getRelease
-
getInit
-
setInitAsTrue
@Internal public void setInitAsTrue()Used for migrating the init flag when an session is gonna be deleted. -
errorCount
public int errorCount() -
getStatus
-
getSequence
-
getDuration
-
getAbnormalMechanism
-
getTimestamp
-
end
public void end()Ends a session and update its values -
end
Ends a session and update its values- Parameters:
timestamp
- the timestamp or null
-
update
public boolean update(@Nullable @Nullable Session.State status, @Nullable @Nullable String userAgent, boolean addErrorsCount) -
update
public boolean update(@Nullable @Nullable Session.State status, @Nullable @Nullable String userAgent, boolean addErrorsCount, @Nullable @Nullable String abnormalMechanism) Updates the current session and set its values- Parameters:
status
- the statususerAgent
- the userAgentaddErrorsCount
- true if should increase error count or notabnormalMechanism
- the mechanism which caused the session to be abnormal- Returns:
- if the session has been updated
-
clone
Ctor copy of the Session -
serialize
public void serialize(@NotNull @NotNull ObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException - Specified by:
serialize
in interfaceJsonSerializable
- Throws:
IOException
-
getUnknown
- Specified by:
getUnknown
in interfaceJsonUnknown
-
setUnknown
- Specified by:
setUnknown
in interfaceJsonUnknown
-