Package io.sentry

Class NoOpScope

java.lang.Object
io.sentry.NoOpScope
All Implemented Interfaces:
IScope

public final class NoOpScope extends Object implements IScope
  • Method Details

    • getInstance

      public static NoOpScope getInstance()
    • getLevel

      @Nullable public @Nullable SentryLevel getLevel()
      Specified by:
      getLevel in interface IScope
    • setLevel

      public void setLevel(@Nullable @Nullable SentryLevel level)
      Description copied from interface: IScope
      Sets the Scope's SentryLevel Level from scope exceptionally take precedence over the event
      Specified by:
      setLevel in interface IScope
      Parameters:
      level - the SentryLevel
    • getTransactionName

      @Nullable public @Nullable String getTransactionName()
      Description copied from interface: IScope
      Returns the Scope's transaction name.
      Specified by:
      getTransactionName in interface IScope
      Returns:
      the transaction
    • setTransaction

      public void setTransaction(@NotNull @NotNull String transaction)
      Description copied from interface: IScope
      Sets the Scope's transaction.
      Specified by:
      setTransaction in interface IScope
      Parameters:
      transaction - the transaction
    • getSpan

      @Nullable public @Nullable ISpan getSpan()
      Description copied from interface: IScope
      Returns current active Span or Transaction.
      Specified by:
      getSpan in interface IScope
      Returns:
      current active Span or Transaction or null if transaction has not been set.
    • setTransaction

      public void setTransaction(@Nullable @Nullable ITransaction transaction)
      Description copied from interface: IScope
      Sets the current active transaction
      Specified by:
      setTransaction in interface IScope
      Parameters:
      transaction - the transaction
    • getUser

      @Nullable public @Nullable User getUser()
      Description copied from interface: IScope
      Returns the Scope's user
      Specified by:
      getUser in interface IScope
      Returns:
      the user
    • setUser

      public void setUser(@Nullable @Nullable User user)
      Description copied from interface: IScope
      Sets the Scope's user
      Specified by:
      setUser in interface IScope
      Parameters:
      user - the user
    • getScreen

      @Internal @Nullable public @Nullable String getScreen()
      Description copied from interface: IScope
      Returns the Scope's current screen, previously set by IScope.setScreen(String)
      Specified by:
      getScreen in interface IScope
      Returns:
      the name of the screen
    • setScreen

      @Internal public void setScreen(@Nullable @Nullable String screen)
      Description copied from interface: IScope
      Sets the Scope's current screen
      Specified by:
      setScreen in interface IScope
      Parameters:
      screen - the name of the screen
    • getReplayId

      @NotNull public @NotNull SentryId getReplayId()
      Description copied from interface: IScope
      Returns the Scope's current replay_id, previously set by IScope.setReplayId(SentryId)
      Specified by:
      getReplayId in interface IScope
      Returns:
      the id of the current session replay
    • setReplayId

      public void setReplayId(@Nullable @Nullable SentryId replayId)
      Description copied from interface: IScope
      Sets the Scope's current replay_id
      Specified by:
      setReplayId in interface IScope
      Parameters:
      replayId - the id of the current session replay
    • getRequest

      @Nullable public @Nullable Request getRequest()
      Description copied from interface: IScope
      Returns the Scope's request
      Specified by:
      getRequest in interface IScope
      Returns:
      the request
    • setRequest

      public void setRequest(@Nullable @Nullable Request request)
      Description copied from interface: IScope
      Sets the Scope's request
      Specified by:
      setRequest in interface IScope
      Parameters:
      request - the request
    • getFingerprint

      @Internal @NotNull public @NotNull List<String> getFingerprint()
      Description copied from interface: IScope
      Returns the Scope's fingerprint list
      Specified by:
      getFingerprint in interface IScope
      Returns:
      the fingerprint list
    • setFingerprint

      public void setFingerprint(@NotNull @NotNull List<String> fingerprint)
      Description copied from interface: IScope
      Sets the Scope's fingerprint list
      Specified by:
      setFingerprint in interface IScope
      Parameters:
      fingerprint - the fingerprint list
    • getBreadcrumbs

      @Internal @NotNull public @NotNull Queue<Breadcrumb> getBreadcrumbs()
      Description copied from interface: IScope
      Returns the Scope's breadcrumbs queue
      Specified by:
      getBreadcrumbs in interface IScope
      Returns:
      the breadcrumbs queue
    • addBreadcrumb

      public void addBreadcrumb(@NotNull @NotNull Breadcrumb breadcrumb, @Nullable @Nullable Hint hint)
      Description copied from interface: IScope
      Adds a breadcrumb to the breadcrumbs queue. It also executes the BeforeBreadcrumb callback if set
      Specified by:
      addBreadcrumb in interface IScope
      Parameters:
      breadcrumb - the breadcrumb
      hint - the hint
    • addBreadcrumb

      public void addBreadcrumb(@NotNull @NotNull Breadcrumb breadcrumb)
      Description copied from interface: IScope
      Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if set
      Specified by:
      addBreadcrumb in interface IScope
      Parameters:
      breadcrumb - the breadcrumb
    • clearBreadcrumbs

      public void clearBreadcrumbs()
      Description copied from interface: IScope
      Clear all the breadcrumbs
      Specified by:
      clearBreadcrumbs in interface IScope
    • clearTransaction

      public void clearTransaction()
      Description copied from interface: IScope
      Clears the transaction.
      Specified by:
      clearTransaction in interface IScope
    • getTransaction

      @Nullable public @Nullable ITransaction getTransaction()
      Description copied from interface: IScope
      Returns active transaction or null if there is no active transaction.
      Specified by:
      getTransaction in interface IScope
      Returns:
      the transaction
    • clear

      public void clear()
      Description copied from interface: IScope
      Resets the Scope to its default state
      Specified by:
      clear in interface IScope
    • getTags

      @Internal @NotNull public @NotNull Map<String,String> getTags()
      Description copied from interface: IScope
      Returns the Scope's tags
      Specified by:
      getTags in interface IScope
      Returns:
      the tags map
    • setTag

      public void setTag(@NotNull @NotNull String key, @NotNull @NotNull String value)
      Description copied from interface: IScope
      Sets a tag to Scope's tags
      Specified by:
      setTag in interface IScope
      Parameters:
      key - the key
      value - the value
    • removeTag

      public void removeTag(@NotNull @NotNull String key)
      Description copied from interface: IScope
      Removes a tag from the Scope's tags
      Specified by:
      removeTag in interface IScope
      Parameters:
      key - the key
    • getExtras

      @Internal @NotNull public @NotNull Map<String,Object> getExtras()
      Description copied from interface: IScope
      Returns the Scope's extra map
      Specified by:
      getExtras in interface IScope
      Returns:
      the extra map
    • setExtra

      public void setExtra(@NotNull @NotNull String key, @NotNull @NotNull String value)
      Description copied from interface: IScope
      Sets an extra to the Scope's extra map
      Specified by:
      setExtra in interface IScope
      Parameters:
      key - the key
      value - the value
    • removeExtra

      public void removeExtra(@NotNull @NotNull String key)
      Description copied from interface: IScope
      Removes an extra from the Scope's extras
      Specified by:
      removeExtra in interface IScope
      Parameters:
      key - the key
    • getContexts

      @NotNull public @NotNull Contexts getContexts()
      Description copied from interface: IScope
      Returns the Scope's contexts
      Specified by:
      getContexts in interface IScope
      Returns:
      the contexts
    • setContexts

      public void setContexts(@NotNull @NotNull String key, @NotNull @NotNull Object value)
      Description copied from interface: IScope
      Sets the Scope's contexts
      Specified by:
      setContexts in interface IScope
      Parameters:
      key - the context key
      value - the context value
    • setContexts

      public void setContexts(@NotNull @NotNull String key, @NotNull @NotNull Boolean value)
      Description copied from interface: IScope
      Sets the Scope's contexts
      Specified by:
      setContexts in interface IScope
      Parameters:
      key - the context key
      value - the context value
    • setContexts

      public void setContexts(@NotNull @NotNull String key, @NotNull @NotNull String value)
      Description copied from interface: IScope
      Sets the Scope's contexts
      Specified by:
      setContexts in interface IScope
      Parameters:
      key - the context key
      value - the context value
    • setContexts

      public void setContexts(@NotNull @NotNull String key, @NotNull @NotNull Number value)
      Description copied from interface: IScope
      Sets the Scope's contexts
      Specified by:
      setContexts in interface IScope
      Parameters:
      key - the context key
      value - the context value
    • setContexts

      public void setContexts(@NotNull @NotNull String key, @NotNull @NotNull Collection<?> value)
      Description copied from interface: IScope
      Sets the Scope's contexts
      Specified by:
      setContexts in interface IScope
      Parameters:
      key - the context key
      value - the context value
    • setContexts

      public void setContexts(@NotNull @NotNull String key, @NotNull @NotNull Object[] value)
      Description copied from interface: IScope
      Sets the Scope's contexts
      Specified by:
      setContexts in interface IScope
      Parameters:
      key - the context key
      value - the context value
    • setContexts

      public void setContexts(@NotNull @NotNull String key, @NotNull @NotNull Character value)
      Description copied from interface: IScope
      Sets the Scope's contexts
      Specified by:
      setContexts in interface IScope
      Parameters:
      key - the context key
      value - the context value
    • removeContexts

      public void removeContexts(@NotNull @NotNull String key)
      Description copied from interface: IScope
      Removes a value from the Scope's contexts
      Specified by:
      removeContexts in interface IScope
      Parameters:
      key - the Key
    • getAttachments

      @Internal @NotNull public @NotNull List<Attachment> getAttachments()
      Description copied from interface: IScope
      Returns the Scopes's attachments
      Specified by:
      getAttachments in interface IScope
      Returns:
      the attachments
    • addAttachment

      public void addAttachment(@NotNull @NotNull Attachment attachment)
      Description copied from interface: IScope
      Adds an attachment to the Scope's list of attachments. The SDK adds the attachment to every event and transaction sent to Sentry.
      Specified by:
      addAttachment in interface IScope
      Parameters:
      attachment - The attachment to add to the Scope's list of attachments.
    • clearAttachments

      public void clearAttachments()
      Description copied from interface: IScope
      Clear all attachments.
      Specified by:
      clearAttachments in interface IScope
    • getEventProcessors

      @Internal @NotNull public @NotNull List<EventProcessor> getEventProcessors()
      Description copied from interface: IScope
      Returns the Scope's event processors
      Specified by:
      getEventProcessors in interface IScope
      Returns:
      the event processors list
    • addEventProcessor

      public void addEventProcessor(@NotNull @NotNull EventProcessor eventProcessor)
      Description copied from interface: IScope
      Adds an event processor to the Scope's event processors list
      Specified by:
      addEventProcessor in interface IScope
      Parameters:
      eventProcessor - the event processor
    • withSession

      @Internal @Nullable public @Nullable Session withSession(@NotNull io.sentry.Scope.IWithSession sessionCallback)
      Description copied from interface: IScope
      Callback to do atomic operations on session
      Specified by:
      withSession in interface IScope
      Parameters:
      sessionCallback - the IWithSession callback
      Returns:
      a clone of the Session after executing the callback and mutating the session
    • startSession

      @Internal @Nullable public io.sentry.Scope.SessionPair startSession()
      Description copied from interface: IScope
      Returns a previous session (now closed) bound to this scope together with the newly created one
      Specified by:
      startSession in interface IScope
      Returns:
      the SessionPair with the previous closed session if exists and the current session
    • endSession

      @Internal @Nullable public @Nullable Session endSession()
      Description copied from interface: IScope
      Ends a session, unbinds it from the scope and returns it.
      Specified by:
      endSession in interface IScope
      Returns:
      the previous session
    • withTransaction

      @Internal public void withTransaction(@NotNull Scope.IWithTransaction callback)
      Description copied from interface: IScope
      Mutates the current transaction atomically
      Specified by:
      withTransaction in interface IScope
      Parameters:
      callback - the IWithTransaction callback
    • getOptions

      @Internal @NotNull public @NotNull SentryOptions getOptions()
      Specified by:
      getOptions in interface IScope
    • getSession

      @Internal @Nullable public @Nullable Session getSession()
      Specified by:
      getSession in interface IScope
    • clearSession

      @Internal public void clearSession()
      Specified by:
      clearSession in interface IScope
    • setPropagationContext

      @Internal public void setPropagationContext(@NotNull @NotNull PropagationContext propagationContext)
      Specified by:
      setPropagationContext in interface IScope
    • getPropagationContext

      @Internal @NotNull public @NotNull PropagationContext getPropagationContext()
      Specified by:
      getPropagationContext in interface IScope
    • withPropagationContext

      @Internal @NotNull public @NotNull PropagationContext withPropagationContext(@NotNull Scope.IWithPropagationContext callback)
      Specified by:
      withPropagationContext in interface IScope
    • clone

      @NotNull public @NotNull IScope clone()
      Clones the Scope
      Specified by:
      clone in interface IScope
      Overrides:
      clone in class Object
      Returns:
      the cloned Scope