private void handleReset() { // This posts the reset event to any classes that need to take action, // avoiding coupling this class to those classes. Events.eventBus().post(new ResetEvent()); if (LanternClientConstants.DEFAULT_MODEL_FILE.isFile()) { try { FileUtils.forceDelete(LanternClientConstants.DEFAULT_MODEL_FILE); } catch (final IOException e) { log.warn("Could not delete model file?"); } } final Model base = new Model(model.getCountryService()); model.setEverGetMode(false); model.setLaunchd(base.isLaunchd()); model.setModal(base.getModal()); model.setNodeId(base.getNodeId()); model.setProfile(base.getProfile()); model.setNproxiedSitesMax(base.getNproxiedSitesMax()); // we need to keep clientID and clientSecret, because they are application-level settings String clientID = model.getSettings().getClientID(); String clientSecret = model.getSettings().getClientSecret(); model.setSettings(base.getSettings()); model.getSettings().setClientID(clientID); model.getSettings().setClientSecret(clientSecret); model.setSetupComplete(base.isSetupComplete()); model.setShowVis(base.isShowVis()); // model.setFriends(base.getFriends()); model.clearNotifications(); modelIo.write(); }
public void submit(String json) { String reporterId = "(" + model.getInstanceId() + ")"; String email = model.getProfile().getEmail(); if (!StringUtils.isBlank(email)) { reporterId = email + " " + reporterId; } LogglyMessage msg = new LogglyMessage(reporterId, "Lantern Feedback", new Date()) .setExtraFromJson(json) .sanitized(false); loggly.log(msg); LOG.info("submitted to Loggly: %s", json); }