Package io.sentry
Interface IScope
public interface IScope
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttachment
(@NotNull Attachment attachment) Adds an attachment to the Scope's list of attachments.void
addBreadcrumb
(@NotNull Breadcrumb breadcrumb) Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if setvoid
addBreadcrumb
(@NotNull Breadcrumb breadcrumb, @Nullable Hint hint) Adds a breadcrumb to the breadcrumbs queue.void
addEventProcessor
(@NotNull EventProcessor eventProcessor) Adds an event processor to the Scope's event processors listvoid
clear()
Resets the Scope to its default statevoid
Clear all attachments.void
Clear all the breadcrumbsvoid
void
Clears the transaction.@NotNull IScope
clone()
Clones the Scope@Nullable Session
Ends a session, unbinds it from the scope and returns it.@NotNull List<Attachment>
Returns the Scopes's attachments@NotNull Queue<Breadcrumb>
Returns the Scope's breadcrumbs queue@NotNull Contexts
Returns the Scope's contexts@NotNull List<EventProcessor>
Returns the Scope's event processorsReturns the Scope's extra mapReturns the Scope's fingerprint list@Nullable SentryLevel
getLevel()
@NotNull SentryOptions
@NotNull PropagationContext
@NotNull SentryId
Returns the Scope's current replay_id, previously set bysetReplayId(SentryId)
@Nullable Request
Returns the Scope's request@Nullable String
Returns the Scope's current screen, previously set bysetScreen(String)
@Nullable Session
@Nullable ISpan
getSpan()
Returns current active Span or Transaction.getTags()
Returns the Scope's tags@Nullable ITransaction
Returns active transaction or null if there is no active transaction.@Nullable String
Returns the Scope's transaction name.@Nullable User
getUser()
Returns the Scope's uservoid
removeContexts
(@NotNull String key) Removes a value from the Scope's contextsvoid
removeExtra
(@NotNull String key) Removes an extra from the Scope's extrasvoid
Removes a tag from the Scope's tagsvoid
setContexts
(@NotNull String key, @NotNull Boolean value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull Character value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull Number value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull Object value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull Object[] value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull String value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull Collection<?> value) Sets the Scope's contextsvoid
Sets an extra to the Scope's extra mapvoid
setFingerprint
(@NotNull List<String> fingerprint) Sets the Scope's fingerprint listvoid
setLevel
(@Nullable SentryLevel level) Sets the Scope's SentryLevel Level from scope exceptionally take precedence over the eventvoid
setPropagationContext
(@NotNull PropagationContext propagationContext) void
setReplayId
(@NotNull SentryId replayId) Sets the Scope's current replay_idvoid
setRequest
(@Nullable Request request) Sets the Scope's requestvoid
Sets the Scope's current screenvoid
Sets a tag to Scope's tagsvoid
setTransaction
(@NotNull String transaction) Sets the Scope's transaction.void
setTransaction
(@Nullable ITransaction transaction) Sets the current active transactionvoid
Sets the Scope's userio.sentry.Scope.SessionPair
Returns a previous session (now closed) bound to this scope together with the newly created one@NotNull PropagationContext
@Nullable Session
withSession
(io.sentry.Scope.IWithSession sessionCallback) Callback to do atomic operations on sessionvoid
withTransaction
(Scope.IWithTransaction callback) Mutates the current transaction atomically
-
Method Details
-
getLevel
-
setLevel
Sets the Scope's SentryLevel Level from scope exceptionally take precedence over the event- Parameters:
level
- the SentryLevel
-
getTransactionName
Returns the Scope's transaction name.- Returns:
- the transaction
-
setTransaction
Sets the Scope's transaction.- Parameters:
transaction
- the transaction
-
getSpan
Returns current active Span or Transaction.- Returns:
- current active Span or Transaction or null if transaction has not been set.
-
setTransaction
Sets the current active transaction- Parameters:
transaction
- the transaction
-
getUser
Returns the Scope's user- Returns:
- the user
-
setUser
Sets the Scope's user- Parameters:
user
- the user
-
getScreen
Returns the Scope's current screen, previously set bysetScreen(String)
- Returns:
- the name of the screen
-
setScreen
Sets the Scope's current screen- Parameters:
screen
- the name of the screen
-
getReplayId
Returns the Scope's current replay_id, previously set bysetReplayId(SentryId)
- Returns:
- the id of the current session replay
-
setReplayId
Sets the Scope's current replay_id- Parameters:
replayId
- the id of the current session replay
-
getRequest
Returns the Scope's request- Returns:
- the request
-
setRequest
Sets the Scope's request- Parameters:
request
- the request
-
getFingerprint
Returns the Scope's fingerprint list- Returns:
- the fingerprint list
-
setFingerprint
Sets the Scope's fingerprint list- Parameters:
fingerprint
- the fingerprint list
-
getBreadcrumbs
Returns the Scope's breadcrumbs queue- Returns:
- the breadcrumbs queue
-
addBreadcrumb
Adds a breadcrumb to the breadcrumbs queue. It also executes the BeforeBreadcrumb callback if set- Parameters:
breadcrumb
- the breadcrumbhint
- the hint
-
addBreadcrumb
Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if set- Parameters:
breadcrumb
- the breadcrumb
-
clearBreadcrumbs
void clearBreadcrumbs()Clear all the breadcrumbs -
clearTransaction
void clearTransaction()Clears the transaction. -
getTransaction
Returns active transaction or null if there is no active transaction.- Returns:
- the transaction
-
clear
void clear()Resets the Scope to its default state -
getTags
Returns the Scope's tags- Returns:
- the tags map
-
setTag
Sets a tag to Scope's tags- Parameters:
key
- the keyvalue
- the value
-
removeTag
Removes a tag from the Scope's tags- Parameters:
key
- the key
-
getExtras
Returns the Scope's extra map- Returns:
- the extra map
-
setExtra
Sets an extra to the Scope's extra map- Parameters:
key
- the keyvalue
- the value
-
removeExtra
Removes an extra from the Scope's extras- Parameters:
key
- the key
-
getContexts
Returns the Scope's contexts- Returns:
- the contexts
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
removeContexts
Removes a value from the Scope's contexts- Parameters:
key
- the Key
-
getAttachments
Returns the Scopes's attachments- Returns:
- the attachments
-
addAttachment
Adds an attachment to the Scope's list of attachments. The SDK adds the attachment to every event and transaction sent to Sentry.- Parameters:
attachment
- The attachment to add to the Scope's list of attachments.
-
clearAttachments
void clearAttachments()Clear all attachments. -
getEventProcessors
Returns the Scope's event processors- Returns:
- the event processors list
-
addEventProcessor
Adds an event processor to the Scope's event processors list- Parameters:
eventProcessor
- the event processor
-
withSession
Callback to do atomic operations on session- Parameters:
sessionCallback
- the IWithSession callback- Returns:
- a clone of the Session after executing the callback and mutating the session
-
startSession
@Nullable io.sentry.Scope.SessionPair startSession()Returns a previous session (now closed) bound to this scope together with the newly created one- Returns:
- the SessionPair with the previous closed session if exists and the current session
-
endSession
Ends a session, unbinds it from the scope and returns it.- Returns:
- the previous session
-
withTransaction
Mutates the current transaction atomically- Parameters:
callback
- the IWithTransaction callback
-
getOptions
-
getSession
-
clearSession
@Internal void clearSession() -
setPropagationContext
-
getPropagationContext
-
withPropagationContext
@Internal @NotNull @NotNull PropagationContext withPropagationContext(@NotNull Scope.IWithPropagationContext callback) -
clone
Clones the Scope- Returns:
- the cloned Scope
-