public void setVersion(String version) { this.version = version; extractVersionComponents(version); }
private void displayVersionInfo() { ProductInfo prodInfo = getProductInfoInstance(); if (prodInfo.getVersion() == null) { // The only case I know of where this happens is the development one. // In this case just return the title. LOGGER.info(prodInfo.getTitle()); } else { LOGGER.info(prodInfo.getTitle() + " (" + prodInfo.getVersion() + ")"); } }
public UpdateCheckService() { ProductInfo productInfo = getProductInfoInstance(); productName = productInfo.getTitle().replaceAll("\\s+", ""); try { String version = productInfo.getMajor() +"."+ productInfo.getMinor() +"."+ productInfo.getPatch(); currentVersion = parseGatewayVersion(version); } catch (Exception e) { throw new RuntimeException("Could not locate a product version associated with the jars on the classpath", e); } final String productEdition = productInfo.getEdition().replaceAll("\\s+", ""); versionServiceUrl = (productEdition.toLowerCase().contains("enterprise")) ? "https://version.kaazing.com" : "https://version.kaazing.org"; }
ProductInfo result = new ProductInfo(); boolean foundJar = false; String[] pathEntries = System.getProperty("java.class.path").split(System.getProperty("path.separator")); result.setTitle(attrs.getValue(IMPLEMENTATION_TITLE)); result.setVersion(attrs.getValue(IMPLEMENTATION_VERSION)); result.setEdition(attrs.getValue(KAAZING_PRODUCT)); result.setDependencies(attrs.getValue(KAAZING_DEPENDENCIES));
@Override public void newVersionAvailable(GatewayVersion currentVersion, GatewayVersion latestGatewayVersion) { logger.info(format( "Update Check: New release available for download: %s %s (you are currently running %s)", getProductInfoInstance().getTitle(), latestGatewayVersion, currentVersion)); } }
@Override public void startingGateway(GatewayContext gatewayContext) { Map<String, Object> injectables = gatewayContext.getInjectables(); Properties properties = (Properties) injectables.get("configuration"); if (!InternalSystemProperty.UPDATE_CHECK.getBooleanProperty(properties)) { return; } ProductInfo productInfo = getProductInfoInstance(); productName = productInfo.getTitle().replaceAll("\\s+", ""); String version = productInfo.getMajor() +"."+ productInfo.getMinor() +"."+ productInfo.getPatch(); currentVersion = parseGatewayVersion(version); String serviceUrl = InternalSystemProperty.UPDATE_CHECK_SERVICE_URL.getProperty(properties); if (serviceUrl != null) { versionServiceUrl = serviceUrl; } else { versionServiceUrl = productInfo.getEdition().toLowerCase().contains("enterprise") ? ENTERPRISE_URL : COMMUNITY_URL; } SchedulerProvider provider = (SchedulerProvider) injectables.get("schedulerProvider"); ScheduledExecutorService scheduler = provider.getScheduler("update_check", false); UpdateCheckTask updateCheckTask = new UpdateCheckTask(this, versionServiceUrl, productName); scheduler.scheduleAtFixedRate(updateCheckTask, 0, 7, DAYS); } }
@Override public void newVersionAvailable(GatewayVersion currentVersion, GatewayVersion latestGatewayVersion) { logger.info(format( "Update Check Service: New release available for download: %s %s (you are currently running %s)", getProductInfoInstance().getTitle(), latestGatewayVersion, currentVersion)); }