Package io.sentry

Interface ISentryClient

  • All Known Implementing Classes:
    SentryClient

    public interface ISentryClient
    Sentry Client interface
    • Method Detail

      • isEnabled

        boolean isEnabled()
        Whether the client is enabled or not
        Returns:
        true if its enabled or false otherwise.
      • captureEvent

        @NotNull
        @NotNull SentryId captureEvent​(@NotNull
                                       @NotNull SentryEvent event,
                                       @Nullable
                                       @Nullable Scope scope,
                                       @Nullable
                                       @Nullable java.lang.Object hint)
        Capture the event
        Parameters:
        event - the event
        scope - An optional scope to be applied to the event.
        hint - SDK specific but provides high level information about the origin of the event.
        Returns:
        The Id (SentryId object) of the event.
      • close

        void close()
        Flushes out the queue for up to timeout seconds and disable the client.
      • flush

        void flush​(long timeoutMillis)
        Flushes events queued up, but keeps the client enabled. Not implemented yet.
        Parameters:
        timeoutMillis - time in milliseconds
      • captureEvent

        @NotNull
        default @NotNull SentryId captureEvent​(@NotNull
                                               @NotNull SentryEvent event)
        Captures the event.
        Parameters:
        event - the event
        Returns:
        The Id (SentryId object) of the event
      • captureEvent

        @NotNull
        default @NotNull SentryId captureEvent​(@NotNull
                                               @NotNull SentryEvent event,
                                               @Nullable
                                               @Nullable Scope scope)
        Captures the event.
        Parameters:
        event - the event
        scope - An optional scope to be applied to the event.
        Returns:
        The Id (SentryId object) of the event
      • captureEvent

        @NotNull
        default @NotNull SentryId captureEvent​(@NotNull
                                               @NotNull SentryEvent event,
                                               @Nullable
                                               @Nullable java.lang.Object hint)
        Capture the event
        Parameters:
        event - the event
        hint - SDK specific but provides high level information about the origin of the event.
        Returns:
        The Id (SentryId object) of the event.
      • captureMessage

        @NotNull
        default @NotNull SentryId captureMessage​(@NotNull
                                                 @NotNull java.lang.String message,
                                                 @NotNull
                                                 @NotNull SentryLevel level,
                                                 @Nullable
                                                 @Nullable Scope scope)
        Captures the message.
        Parameters:
        message - The message to send.
        level - The message level.
        scope - An optional scope to be applied to the event.
        Returns:
        The Id (SentryId object) of the event
      • captureMessage

        @NotNull
        default @NotNull SentryId captureMessage​(@NotNull
                                                 @NotNull java.lang.String message,
                                                 @NotNull
                                                 @NotNull SentryLevel level)
        Captures the message.
        Parameters:
        message - The message to send.
        level - The message level.
        Returns:
        The Id (SentryId object) of the event
      • captureException

        @NotNull
        default @NotNull SentryId captureException​(@NotNull
                                                   @NotNull java.lang.Throwable throwable)
        Captures the exception.
        Parameters:
        throwable - The exception.
        Returns:
        The Id (SentryId object) of the event
      • captureException

        @NotNull
        default @NotNull SentryId captureException​(@NotNull
                                                   @NotNull java.lang.Throwable throwable,
                                                   @Nullable
                                                   @Nullable Scope scope,
                                                   @Nullable
                                                   @Nullable java.lang.Object hint)
        Captures the exception.
        Parameters:
        throwable - The exception.
        hint - SDK specific but provides high level information about the origin of the event
        scope - An optional scope to be applied to the event.
        Returns:
        The Id (SentryId object) of the event
      • captureException

        @NotNull
        default @NotNull SentryId captureException​(@NotNull
                                                   @NotNull java.lang.Throwable throwable,
                                                   @Nullable
                                                   @Nullable java.lang.Object hint)
        Captures the exception.
        Parameters:
        throwable - The exception.
        hint - SDK specific but provides high level information about the origin of the event
        Returns:
        The Id (SentryId object) of the event
      • captureException

        @NotNull
        default @NotNull SentryId captureException​(@NotNull
                                                   @NotNull java.lang.Throwable throwable,
                                                   @Nullable
                                                   @Nullable Scope scope)
        Captures the exception.
        Parameters:
        throwable - The exception.
        scope - An optional scope to be applied to the event.
        Returns:
        The Id (SentryId object) of the event
      • captureUserFeedback

        void captureUserFeedback​(@NotNull
                                 @NotNull UserFeedback userFeedback)
        Captures a manually created user feedback and sends it to Sentry.
        Parameters:
        userFeedback - The user feedback to send to Sentry.
      • captureSession

        void captureSession​(@NotNull
                            @NotNull Session session,
                            @Nullable
                            @Nullable java.lang.Object hint)
        Captures a session. This method transform a session to an envelope and forwards to captureEnvelope
        Parameters:
        hint - SDK specific but provides high level information about the origin of the event
        session - the Session
      • captureSession

        default void captureSession​(@NotNull
                                    @NotNull Session session)
        Captures a session. This method transform a session to an envelope and forwards to captureEnvelope
        Parameters:
        session - the Session
      • captureEnvelope

        @Nullable
        @Nullable SentryId captureEnvelope​(@NotNull
                                           @NotNull SentryEnvelope envelope,
                                           @Nullable
                                           @Nullable java.lang.Object hint)
        Captures an envelope.
        Parameters:
        envelope - the SentryEnvelope to send.
        hint - SDK specific but provides high level information about the origin of the event
        Returns:
        The Id (SentryId object) of the event
      • captureEnvelope

        @Nullable
        default @Nullable SentryId captureEnvelope​(@NotNull
                                                   @NotNull SentryEnvelope envelope)
        Captures an envelope.
        Parameters:
        envelope - the SentryEnvelope to send.
        Returns:
        The Id (SentryId object) of the event
      • captureTransaction

        @NotNull
        default @NotNull SentryId captureTransaction​(@NotNull
                                                     @NotNull SentryTransaction transaction,
                                                     @Nullable
                                                     @Nullable Scope scope,
                                                     @Nullable
                                                     @Nullable java.lang.Object hint)
        Captures a transaction.
        Parameters:
        transaction - the ITransaction to send
        scope - An optional scope to be applied to the event.
        hint - SDK specific but provides high level information about the origin of the event
        Returns:
        The Id (SentryId object) of the event
      • captureTransaction

        @NotNull
        @Experimental
        @NotNull SentryId captureTransaction​(@NotNull
                                             @NotNull SentryTransaction transaction,
                                             @Nullable
                                             @Nullable TraceState traceState,
                                             @Nullable
                                             @Nullable Scope scope,
                                             @Nullable
                                             @Nullable java.lang.Object hint)
        Captures a transaction.
        Parameters:
        transaction - the ITransaction to send
        traceState - the trace state
        scope - An optional scope to be applied to the event.
        hint - SDK specific but provides high level information about the origin of the event
        Returns:
        The Id (SentryId object) of the event
      • captureTransaction

        @Experimental
        @NotNull
        default @NotNull SentryId captureTransaction​(@NotNull
                                                     @NotNull SentryTransaction transaction,
                                                     @Nullable
                                                     @Nullable TraceState traceState)
        Captures a transaction without scope nor hint.
        Parameters:
        transaction - the ITransaction to send
        traceState - the trace state
        Returns:
        The Id (SentryId object) of the event
      • captureTransaction

        @NotNull
        default @NotNull SentryId captureTransaction​(@NotNull
                                                     @NotNull SentryTransaction transaction)
        Captures a transaction without scope nor hint.
        Parameters:
        transaction - the ITransaction to send
        Returns:
        The Id (SentryId object) of the event