-
Notifications
You must be signed in to change notification settings - Fork 41
Issue #5 Disable Telemetry #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
|
|
||
| # / | ||
|
|
||
| .DS_Store | ||
| .java-version | ||
| .idea | ||
| **/*.iml | ||
| donkey/donkey-src | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,7 @@ | |
| import org.apache.commons.collections4.CollectionUtils; | ||
| import org.apache.commons.io.FileUtils; | ||
| import org.apache.commons.io.FilenameUtils; | ||
| import org.apache.commons.lang3.NotImplementedException; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Unused imports:
|
||
| import org.apache.commons.lang3.StringUtils; | ||
| import org.apache.commons.lang3.exception.ExceptionUtils; | ||
| import org.apache.http.conn.HttpHostConnectException; | ||
|
|
@@ -1948,68 +1949,6 @@ public User getCurrentUser(Component parentComponent, boolean alertOnFailure) { | |
| return currentUser; | ||
| } | ||
|
|
||
| public void registerUser(final User user) { | ||
| final String workingId = startWorking("Registering user..."); | ||
|
|
||
| SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() { | ||
|
|
||
| public Void doInBackground() { | ||
| try { | ||
| ConnectServiceUtil.registerUser(PlatformUI.SERVER_ID, PlatformUI.SERVER_VERSION, user, PlatformUI.HTTPS_PROTOCOLS, PlatformUI.HTTPS_CIPHER_SUITES); | ||
| } catch (ClientException e) { | ||
| // ignore errors connecting to update/stats server | ||
| } | ||
|
|
||
| return null; | ||
| } | ||
|
|
||
| public void done() { | ||
| stopWorking(workingId); | ||
| } | ||
| }; | ||
|
|
||
| worker.execute(); | ||
| } | ||
|
|
||
| public void sendUsageStatistics() { | ||
| UpdateSettings updateSettings = null; | ||
| try { | ||
| updateSettings = mirthClient.getUpdateSettings(); | ||
| } catch (Exception e) { | ||
| } | ||
|
|
||
| if (updateSettings != null && updateSettings.getStatsEnabled()) { | ||
| final String workingId = startWorking("Sending usage statistics..."); | ||
|
|
||
| SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() { | ||
|
|
||
| public Void doInBackground() { | ||
| try { | ||
| String usageData = mirthClient.getUsageData(getClientStats()); | ||
| if (usageData != null) { | ||
| boolean isSent = ConnectServiceUtil.sendStatistics(PlatformUI.SERVER_ID, PlatformUI.SERVER_VERSION, false, usageData, PlatformUI.HTTPS_PROTOCOLS, PlatformUI.HTTPS_CIPHER_SUITES); | ||
| if (isSent) { | ||
| UpdateSettings settings = new UpdateSettings(); | ||
| settings.setLastStatsTime(System.currentTimeMillis()); | ||
| mirthClient.setUpdateSettings(settings); | ||
| } | ||
| } | ||
| } catch (ClientException e) { | ||
| // ignore errors connecting to update/stats server | ||
| } | ||
|
|
||
| return null; | ||
| } | ||
|
|
||
| public void done() { | ||
| stopWorking(workingId); | ||
| } | ||
| }; | ||
|
|
||
| worker.execute(); | ||
| } | ||
| } | ||
|
|
||
| private Map<String, Object> getClientStats() { | ||
| Map<String, Object> clientStats = new HashMap<String, Object>(); | ||
| clientStats.put("javaVersion", System.getProperty("java.version")); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -399,10 +399,6 @@ public void startup() { | |
| configurationController.setStatus(ConfigurationController.STATUS_OK); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Unused imports
|
||
| eventController.dispatchEvent(new ServerEvent(configurationController.getServerId(), "Server startup complete")); | ||
| printSplashScreen(); | ||
|
|
||
| // schedule usage statistics to be sent at startup and every 24 hours | ||
| Timer timer = new Timer(); | ||
| timer.schedule(new UsageSenderTask(), 0, ConnectServiceUtil.MILLIS_PER_DAY); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -650,19 +646,4 @@ private void initializeLogging() { | |
| } | ||
| } | ||
| } | ||
|
|
||
| private class UsageSenderTask extends TimerTask { | ||
| @Override | ||
| public void run() { | ||
| boolean isSent = ConnectServiceUtil.sendStatistics(configurationController.getServerId(), configurationController.getServerVersion(), true, usageController.createUsageStats(null), configurationController.getHttpsClientProtocols(), configurationController.getHttpsCipherSuites()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the only use of |
||
| if (isSent) { | ||
| UpdateSettings settings = new UpdateSettings(); | ||
| settings.setLastStatsTime(System.currentTimeMillis()); | ||
| try { | ||
| configurationController.setUpdateSettings(settings); | ||
| } catch (ControllerException e) { | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:248 - :265 seems to store user information. Unclear of purpose. Might be removed.