Package io.sentry
Interface IScope
- All Known Implementing Classes:
CombinedScopeView,NoOpScope,Scope
public interface IScope
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachment(@NotNull Attachment attachment) Adds an attachment to the Scope's list of attachments.voidaddBreadcrumb(@NotNull Breadcrumb breadcrumb) Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if setvoidaddBreadcrumb(@NotNull Breadcrumb breadcrumb, @Nullable Hint hint) Adds a breadcrumb to the breadcrumbs queue.voidaddEventProcessor(@NotNull EventProcessor eventProcessor) Adds an event processor to the Scope's event processors listvoidassignTraceContext(@NotNull SentryEvent event) voidbindClient(@NotNull ISentryClient client) voidclear()Resets the Scope to its default statevoidClear all attachments.voidClear all the breadcrumbsvoidvoidClears the transaction.@NotNull IScopeclone()Clones the Scope@Nullable SessionEnds 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 ISentryClient@NotNull ContextsReturns the Scope's contexts@NotNull List<EventProcessor>Returns the Scope's event processors@NotNull List<EventProcessorAndOrder>Returns the Scope's extra mapReturns the Scope's fingerprint list@NotNull SentryId@Nullable SentryLevelgetLevel()@NotNull SentryOptions@NotNull PropagationContext@NotNull SentryIdReturns the Scope's current replay_id, previously set bysetReplayId(SentryId)@Nullable RequestReturns the Scope's request@Nullable StringReturns the Scope's current screen, previously set bysetScreen(String)@Nullable Session@Nullable ISpangetSpan()Returns current active Span or Transaction.getTags()Returns the Scope's tags@Nullable ITransactionReturns active transaction or null if there is no active transaction.@Nullable StringReturns the Scope's transaction name.@Nullable UsergetUser()Returns the Scope's uservoidremoveContexts(@NotNull String key) Removes a value from the Scope's contextsvoidremoveExtra(@NotNull String key) Removes an extra from the Scope's extrasvoidRemoves a tag from the Scope's tagsvoidreplaceOptions(@NotNull SentryOptions options) voidsetActiveSpan(@Nullable ISpan span) voidsetContexts(@NotNull String key, @NotNull Boolean value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull Character value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull Number value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull Object value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull Object[] value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull String value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull Collection<?> value) Sets the Scope's contextsvoidSets an extra to the Scope's extra mapvoidsetFingerprint(@NotNull List<String> fingerprint) Sets the Scope's fingerprint listvoidsetLastEventId(@NotNull SentryId lastEventId) voidsetLevel(@Nullable SentryLevel level) Sets the Scope's SentryLevel Level from scope exceptionally take precedence over the eventvoidsetPropagationContext(@NotNull PropagationContext propagationContext) voidsetReplayId(@NotNull SentryId replayId) Sets the Scope's current replay_idvoidsetRequest(@Nullable Request request) Sets the Scope's requestvoidSets the Scope's current screenvoidsetSpanContext(@NotNull Throwable throwable, @NotNull ISpan span, @NotNull String transactionName) voidSets a tag to Scope's tagsvoidsetTransaction(@NotNull String transaction) Sets the Scope's transaction.voidsetTransaction(@Nullable ITransaction transaction) Sets the current active transactionvoidSets the Scope's userio.sentry.Scope.SessionPairReturns a previous session (now closed) bound to this scope together with the newly created one@NotNull PropagationContext@Nullable SessionwithSession(io.sentry.Scope.IWithSession sessionCallback) Callback to do atomic operations on sessionvoidwithTransaction(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.
-
setActiveSpan
-
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
-
getEventProcessorsWithOrder
-
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
-
setLastEventId
-
getLastEventId
-
bindClient
-
getClient
-
assignTraceContext
-
setSpanContext
-
replaceOptions
-