/** * Creates new notifier with default Ignite updates URL */ GridUpdateNotifier(String igniteInstanceName, String ver, boolean reportOnlyNew) throws IgniteCheckedException { this(igniteInstanceName, ver, reportOnlyNew, new HttpIgniteUpdatesChecker(DEFAULT_IGNITE_UPDATES_URL, DEFAULT_IGNITE_UPDATES_PARAMS + ver, CHARSET)); }
/** {@inheritDoc} */ @Override protected void body() throws InterruptedException { try { if (!isCancelled()) { try { String updatesRes = updatesChecker.getUpdates(first); String[] lines = updatesRes.split("\n"); for (String line : lines) { if (line.contains("version")) latestVer = obtainVersionFrom(line); else if (line.contains("downloadUrl")) downloadUrl = obtainDownloadUrlFrom(line); } err = null; } catch (IOException e) { err = e; if (log.isDebugEnabled()) log.debug("Failed to connect to Ignite update server. " + e.getMessage()); } } } catch (Exception e) { err = e; if (log.isDebugEnabled()) log.debug("Unexpected exception in update checker. " + e.getMessage()); } }
Mockito.when(updatesCheckerMock.getUpdates(true)) .thenReturn("meta=meta" + "\n" + "version=" + nodeVer + "\n" + "downloadUrl=url");
/** {@inheritDoc} */ @Override protected void body() throws InterruptedException { try { if (!isCancelled()) { try { String updatesRes = updatesChecker.getUpdates(first); String[] lines = updatesRes.split("\n"); for (String line : lines) { if (line.contains("version")) latestVer = obtainVersionFrom(line); else if (line.contains("downloadUrl")) downloadUrl = obtainDownloadUrlFrom(line); } err = null; } catch (IOException e) { err = e; if (log.isDebugEnabled()) log.debug("Failed to connect to Ignite update server. " + e.getMessage()); } } } catch (Exception e) { err = e; if (log.isDebugEnabled()) log.debug("Unexpected exception in update checker. " + e.getMessage()); } }
/** * Creates new notifier with default Ignite updates URL */ GridUpdateNotifier(String igniteInstanceName, String ver, boolean reportOnlyNew) throws IgniteCheckedException { this(igniteInstanceName, ver, reportOnlyNew, new HttpIgniteUpdatesChecker(DEFAULT_IGNITE_UPDATES_URL, DEFAULT_IGNITE_UPDATES_PARAMS + ver, CHARSET)); }