Package io.sentry
Class Session
java.lang.Object
io.sentry.Session
- All Implemented Interfaces:
JsonSerializable,JsonUnknown
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classstatic enumSession state -
Constructor Summary
ConstructorsConstructorDescriptionSession(@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 Sessionclone()Ctor copy of the Sessionvoidend()Ends a session and update its valuesvoidEnds a session and update its valuesint@Nullable String@Nullable String@Nullable Double@Nullable String@Nullable BooleangetInit()@Nullable String@NotNull String@Nullable Long@Nullable UUID@Nullable Date@NotNull Session.State@Nullable Date@Nullable Stringvoidserialize(@NotNull JsonObjectWriter writer, @NotNull ILogger logger) voidUsed for migrating the init flag when an session is gonna be deleted.voidsetUnknown(@Nullable Map<String, Object> unknown) booleanupdate(@Nullable Session.State status, @Nullable String userAgent, boolean addErrorsCount) booleanupdate(@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
-
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 JsonObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException - Specified by:
serializein interfaceJsonSerializable- Throws:
IOException
-
getUnknown
- Specified by:
getUnknownin interfaceJsonUnknown
-
setUnknown
- Specified by:
setUnknownin interfaceJsonUnknown
-