Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. public void execute(JobExecutionContext context) throws JobExecutionException {
  2.         long start = printEntry(context);
  3.         StateTracker tracker = Backbone.STATE;
  4.         NotificationManager notification = Backbone.NOTIFICATION;
  5.         tracker.updateAll();
  6.         Set<AccessPoint> failures = tracker.getFailures();
  7.         if (failures != null && failures.size() > 0) {
  8.             printFailureCount(context, failures.size());
  9.             StringBuilder sb = new StringBuilder();
  10.             for (AccessPoint failure : failures) {
  11.                 String identity = failure.getIdentity();
  12.                 if (identity.isEmpty())
  13.                     identity = "No identity";
  14.                 sb.append(
  15.                     String.format(
  16.                             "[%s] %s\n",
  17.                             failure.getMac(),
  18.                             identity
  19.                     ));
  20.             }
  21.             notification.notifyAllSubscribedTelegram("Failure(s) detected", sb.toString());
  22.         }
  23.         tracker.setNotified(failures);
  24.         printExit(context, start);
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement