Package com.gmt2001

Class RollbarProvider

java.lang.Object
com.gmt2001.RollbarProvider
All Implemented Interfaces:
AutoCloseable

public final class RollbarProvider extends Object implements AutoCloseable
Provides Rollbar exception reporting

Currently set to only transmit errors at Level.ERROR and Level.CRITICAL

Author:
gmt2001
  • Method Details

    • instance

      public static RollbarProvider instance()
      Instance
      Returns:
      an instance of RollbarProvider
    • localsToCustom

      public static Map<String,Object> localsToCustom(String[] names, Object[] values)
      Creates a new custom map and adds the provided local variables to a sub-object
      Parameters:
      names - a list of variable names
      values - a list of varible values
      Returns:
      a new Map with the varibles/values added as a sub-map
    • getRollbar

      public com.rollbar.notifier.Rollbar getRollbar()
      Returns the underlying Rollbar object
      Returns:
      the Rollbar object
    • isEnabled

      public boolean isEnabled()
      Indicates if sending exceptions is enabled

      NOTE: Only affects methods provided by RollbarProvider, not methods in the underlying Rollbar object

      Returns:
      true if enabled
    • enable

      public void enable()
      Enables sending Rollbar exception reports and prints the disable/GDPR info to the console
    • critical

      public void critical(Throwable error)
      Sends a Level.CRITICAL error
      Parameters:
      error - the error
    • critical

      public void critical(Throwable error, String description)
      Sends a Level.CRITICAL error
      Parameters:
      error - the error
      description - a description of the error
    • critical

      public void critical(Throwable error, Map<String,Object> custom)
      Sends a Level.CRITICAL error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
    • critical

      public void critical(String message)
      Sends a Level.CRITICAL error
      Parameters:
      message - the error message
    • critical

      public void critical(String message, Map<String,Object> custom)
      Sends a Level.CRITICAL error
      Parameters:
      message - the error message
      custom - a Map of custom data to include with the report
    • critical

      public void critical(Throwable error, Map<String,Object> custom, String description)
      Sends a Level.CRITICAL error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
      description - a description of the error
    • critical

      public void critical(Throwable error, Map<String,Object> custom, String description, boolean isUncaught)
      Sends a Level.CRITICAL error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
      description - a description of the error
      isUncaught - true if this error should be reported as an uncaught exception
    • error

      public void error(Throwable error)
      Sends a Level.ERROR error
      Parameters:
      error - the error
    • error

      public void error(Throwable error, String description)
      Sends a Level.ERROR error
      Parameters:
      error - the error
      description - a description of the error
    • error

      public void error(Throwable error, Map<String,Object> custom)
      Sends a Level.ERROR error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
    • error

      public void error(String message)
      Sends a Level.ERROR error
      Parameters:
      message - the error message
    • error

      public void error(String message, Map<String,Object> custom)
      Sends a Level.ERROR error
      Parameters:
      message - the error message
      custom - a Map of custom data to include with the report
    • error

      public void error(Throwable error, Map<String,Object> custom, String description)
      Sends a Level.ERROR error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
      description - a description of the error
    • error

      public void error(Throwable error, Map<String,Object> custom, String description, boolean isUncaught)
      Sends a Level.ERROR error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
      description - a description of the error
      isUncaught - true if this error should be reported as an uncaught exception
    • warning

      public void warning(Throwable error)
      Sends a Level.WARNING error
      Parameters:
      error - the error
    • warning

      public void warning(Throwable error, String description)
      Sends a Level.WARNING error
      Parameters:
      error - the error
      description - a description of the error
    • warning

      public void warning(Throwable error, Map<String,Object> custom)
      Sends a Level.WARNING error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
    • warning

      public void warning(String message)
      Sends a Level.WARNING error
      Parameters:
      message - the error message
    • warning

      public void warning(String message, Map<String,Object> custom)
      Sends a Level.WARNING error
      Parameters:
      message - the error message
      custom - a Map of custom data to include with the report
    • warning

      public void warning(Throwable error, Map<String,Object> custom, String description)
      Sends a Level.WARNING error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
      description - a description of the error
    • info

      public void info(Throwable error)
      Sends a Level.INFO error
      Parameters:
      error - the error
    • info

      public void info(Throwable error, String description)
      Sends a Level.INFO error
      Parameters:
      error - the error
      description - a description of the error
    • info

      public void info(Throwable error, Map<String,Object> custom)
      Sends a Level.INFO error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
    • info

      public void info(String message)
      Sends a Level.INFO error
      Parameters:
      message - the error message
    • info

      public void info(String message, Map<String,Object> custom)
      Sends a Level.INFO error
      Parameters:
      message - the error message
      custom - a Map of custom data to include with the report
    • info

      public void info(Throwable error, Map<String,Object> custom, String description)
      Sends a Level.INFO error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
      description - a description of the error
    • debug

      public void debug(Throwable error)
      Sends a Level.DEBUG error
      Parameters:
      error - the error
    • debug

      public void debug(Throwable error, String description)
      Sends a Level.DEBUG error
      Parameters:
      error - the error
      description - a description of the error
    • debug

      public void debug(Throwable error, Map<String,Object> custom)
      Sends a Level.DEBUG error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
    • debug

      public void debug(String message)
      Sends a Level.DEBUG error
      Parameters:
      message - the error message
    • debug

      public void debug(String message, Map<String,Object> custom)
      Sends a Level.DEBUG error
      Parameters:
      message - the error message
      custom - a Map of custom data to include with the report
    • debug

      public void debug(Throwable error, Map<String,Object> custom, String description)
      Sends a Level.DEBUG error
      Parameters:
      error - the error
      custom - a Map of custom data to include with the report
      description - a description of the error
    • close

      public void close()
      Closes out Rollbar
      Specified by:
      close in interface AutoCloseable