@@ -47,8 +47,8 @@ public Thread newThread(Runnable runnable) {
4747
4848 private ScheduledThreadPoolExecutor sessionExecutorService =
4949 new ScheduledThreadPoolExecutor (CORE_POOL_SIZE ,
50- new DaemonThreadFactory (),
51- new RejectedExecutionHandler () {
50+ new DaemonThreadFactory (),
51+ new RejectedExecutionHandler () {
5252 @ Override
5353 public void rejectedExecution (Runnable runnable , ThreadPoolExecutor executor ) {
5454 LOGGER .error ("Rejected execution for sessionExecutorService" );
@@ -436,14 +436,14 @@ public boolean notify(Report report, Callback reportCallback) {
436436 // Don't notify if this error class should be ignored
437437 if (config .shouldIgnoreClass (report .getExceptionName ())) {
438438 LOGGER .debug ("Error not reported to Bugsnag - {} is in 'ignoreClasses'" ,
439- report .getExceptionName ());
439+ report .getExceptionName ());
440440 return false ;
441441 }
442442
443443 // Don't notify unless releaseStage is in notifyReleaseStages
444444 if (!config .shouldNotifyForReleaseStage ()) {
445445 LOGGER .debug ("Error not reported to Bugsnag - {} is not in 'notifyReleaseStages'" ,
446- config .releaseStage );
446+ config .releaseStage );
447447 return false ;
448448 }
449449
@@ -456,7 +456,7 @@ public boolean notify(Report report, Callback reportCallback) {
456456 // Check if callback cancelled delivery
457457 if (report .getShouldCancel ()) {
458458 LOGGER .debug ("Error not reported to Bugsnag - "
459- + "cancelled by a client-wide beforeNotify callback" );
459+ + "cancelled by a client-wide beforeNotify callback" );
460460 return false ;
461461 }
462462 } catch (Throwable ex ) {
@@ -476,7 +476,7 @@ public boolean notify(Report report, Callback reportCallback) {
476476 // Check if callback cancelled delivery
477477 if (report .getShouldCancel ()) {
478478 LOGGER .debug (
479- "Error not reported to Bugsnag - cancelled by a report-specific callback" );
479+ "Error not reported to Bugsnag - cancelled by a report-specific callback" );
480480 return false ;
481481 }
482482 } catch (Throwable ex ) {
@@ -514,11 +514,11 @@ public boolean notify(Report report, Callback reportCallback) {
514514
515515 /**
516516 * Manually starts tracking a new session.
517- *
517+ * <p>
518518 * Note: sessions are currently tracked on a per-thread basis. Therefore, if this method were
519519 * called from Thread A then Thread B, two sessions would be considered 'active'. Any custom
520520 * strategy used to track sessions should take this into account.
521- *
521+ * <p>
522522 * Automatic session tracking can be enabled via
523523 * {@link Bugsnag#setAutoCaptureSessions(boolean)}, which will automatically create a new
524524 * session for each request
@@ -542,6 +542,7 @@ public void setAutoCaptureSessions(boolean autoCaptureSessions) {
542542 /**
543543 * Retrieves whether or not Bugsnag should automatically capture
544544 * and report User sessions for each request.
545+ *
545546 * @return whether sessions should be auto captured
546547 */
547548 public boolean shouldAutoCaptureSessions () {
@@ -564,24 +565,29 @@ public void setSessionEndpoint(String endpoint) {
564565 }
565566
566567 /**
567- * Set the endpoints to send data to. By default we'll send error reports to
568- * https://notify.bugsnag.com, and sessions to https://sessions.bugsnag.com, but you can
569- * override this if you are using Bugsnag Enterprise to point to your own Bugsnag endpoint.
570- *
568+ * @deprecated Use {@link #setEndpoints(EndpointConfiguration)} instead.
569+ */
570+ @ Deprecated
571+ public void setEndpoints (String notify , String sessions ) throws IllegalArgumentException {
572+ setEndpoints (new EndpointConfiguration (notify , sessions ));
573+ }
574+
575+ /**
576+ * Set the endpoints to send data to. Use this to override the default endpoints
577+ * if you are using Bugsnag Enterprise to point to your own Bugsnag endpoint.
578+ * <p>
571579 * Please note that it is recommended that you set both endpoints. If the notify endpoint is
572580 * missing, an exception will be thrown. If the session endpoint is missing, a warning will be
573581 * logged and sessions will not be sent automatically.
574- *
582+ * <p>
575583 * Note that if you are setting a custom {@link Delivery}, this method should be called after
576584 * the custom implementation has been set.
577585 *
578- * @param notify the notify endpoint
579- * @param sessions the sessions endpoint
580- *
581- * @throws IllegalArgumentException if the notify endpoint is empty or null
586+ * @param endpointConfiguration the endpoint configuration
587+ * @throws IllegalArgumentException if the endpoint configuration is null or if the notify endpoint is empty or null
582588 */
583- public void setEndpoints (String notify , String sessions ) throws IllegalArgumentException {
584- config .setEndpoints (notify , sessions );
589+ public void setEndpoints (EndpointConfiguration endpointConfiguration ) throws IllegalArgumentException {
590+ config .setEndpoints (endpointConfiguration );
585591 }
586592
587593 /**
0 commit comments