public final class Scope
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Scope.IWithTransaction
the IWithTransaction callback
|
| Constructor and Description |
|---|
Scope(@NotNull SentryOptions options)
Scope's ctor
|
| Modifier and Type | Method and Description |
|---|---|
void |
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
set
|
void |
addBreadcrumb(@NotNull Breadcrumb breadcrumb,
@Nullable java.lang.Object hint)
Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if
set
|
void |
addEventProcessor(@NotNull EventProcessor eventProcessor)
Adds an event processor to the Scope's event processors list
|
void |
clear()
Resets the Scope to its default state
|
void |
clearAttachments()
Clear all attachments.
|
void |
clearBreadcrumbs()
Clear all the breadcrumbs
|
void |
clearTransaction()
Clears the transaction.
|
@NotNull Contexts |
getContexts()
Returns the Scope's contexts
|
@Nullable SentryLevel |
getLevel()
Returns the Scope's SentryLevel
|
@Nullable Request |
getRequest()
Returns the Scope's request
|
@Nullable ISpan |
getSpan()
Returns current active Span or Transaction.
|
@NotNull java.util.Map<java.lang.String,java.lang.String> |
getTags()
Returns the Scope's tags
|
@Nullable ITransaction |
getTransaction()
Returns active transaction or null if there is no active transaction.
|
@Nullable java.lang.String |
getTransactionName()
Returns the Scope's transaction name.
|
@Nullable User |
getUser()
Returns the Scope's user
|
void |
removeContexts(@NotNull java.lang.String key)
Removes a value from the Scope's contexts
|
void |
removeExtra(@NotNull java.lang.String key)
Removes an extra from the Scope's extras
|
void |
removeTag(@NotNull java.lang.String key)
Removes a tag from the Scope's tags
|
void |
setContexts(@NotNull java.lang.String key,
@NotNull java.lang.Boolean value)
Sets the Scope's contexts
|
void |
setContexts(@NotNull java.lang.String key,
@NotNull java.lang.Number value)
Sets the Scope's contexts
|
void |
setContexts(@NotNull java.lang.String key,
@NotNull java.lang.Object value)
Sets the Scope's contexts
|
void |
setContexts(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets the Scope's contexts
|
void |
setExtra(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets an extra to the Scope's extra map
|
void |
setFingerprint(@NotNull java.util.List<java.lang.String> fingerprint)
Sets the Scope's fingerprint list
|
void |
setLevel(@Nullable SentryLevel level)
Sets the Scope's SentryLevel Level from scope exceptionally take precedence over the event
|
void |
setRequest(@Nullable Request request)
Sets the Scope's request
|
void |
setTag(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets a tag to Scope's tags
|
void |
setTransaction(@Nullable ITransaction transaction)
Sets the current active transaction
|
void |
setTransaction(@NotNull java.lang.String transaction)
Sets the Scope's transaction.
|
void |
setUser(@Nullable User user)
Sets the Scope's user
|
void |
withTransaction(@NotNull Scope.IWithTransaction callback)
Mutates the current transaction atomically
|
public Scope(@NotNull
@NotNull SentryOptions options)
options - the options@Nullable public @Nullable SentryLevel getLevel()
public void setLevel(@Nullable
@Nullable SentryLevel level)
level - the SentryLevel@Nullable public @Nullable java.lang.String getTransactionName()
public void setTransaction(@NotNull
@NotNull java.lang.String transaction)
transaction - the transaction@Nullable public @Nullable ISpan getSpan()
public void setTransaction(@Nullable
@Nullable ITransaction transaction)
transaction - the transaction@Nullable public @Nullable User getUser()
public void setUser(@Nullable
@Nullable User user)
user - the user@Nullable public @Nullable Request getRequest()
public void setRequest(@Nullable
@Nullable Request request)
request - the requestpublic void setFingerprint(@NotNull
@NotNull java.util.List<java.lang.String> fingerprint)
fingerprint - the fingerprint listpublic void addBreadcrumb(@NotNull
@NotNull Breadcrumb breadcrumb,
@Nullable
@Nullable java.lang.Object hint)
breadcrumb - the breadcrumbhint - the hintpublic void addBreadcrumb(@NotNull
@NotNull Breadcrumb breadcrumb)
breadcrumb - the breadcrumbpublic void clearBreadcrumbs()
public void clearTransaction()
@Nullable public @Nullable ITransaction getTransaction()
public void clear()
@ApiStatus.Internal @NotNull public @NotNull java.util.Map<java.lang.String,java.lang.String> getTags()
public void setTag(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.String value)
key - the keyvalue - the valuepublic void removeTag(@NotNull
@NotNull java.lang.String key)
key - the keypublic void setExtra(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.String value)
key - the keyvalue - the valuepublic void removeExtra(@NotNull
@NotNull java.lang.String key)
key - the key@NotNull public @NotNull Contexts getContexts()
public void setContexts(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.Object value)
key - the context keyvalue - the context valuepublic void setContexts(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.Boolean value)
key - the context keyvalue - the context valuepublic void setContexts(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.String value)
key - the context keyvalue - the context valuepublic void setContexts(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.Number value)
key - the context keyvalue - the context valuepublic void removeContexts(@NotNull
@NotNull java.lang.String key)
key - the Keypublic void addAttachment(@NotNull
@NotNull Attachment attachment)
attachment - The attachment to add to the Scope's list of attachments.public void clearAttachments()
public void addEventProcessor(@NotNull
@NotNull EventProcessor eventProcessor)
eventProcessor - the event processor@ApiStatus.Internal
public void withTransaction(@NotNull
@NotNull Scope.IWithTransaction callback)
callback - the IWithTransaction callback