private String getVersion() { String version = ""; AboutResource aboutResource = this.aboutOperations.get(); if(aboutResource != null) { version = aboutResource.getVersionInfo().getCore().getVersion(); } return version; }
private void updateDependency(Dependency dependency, VersionInfoProperties.DependencyAboutInfo dependencyAboutInfo) { dependency.setName(dependencyAboutInfo.getName()); if (dependencyAboutInfo.getUrl() != null) { dependency.setUrl(constructUrl(dependencyAboutInfo.getUrl(), dependencyAboutInfo.getVersion())); } dependency.setVersion(dependencyAboutInfo.getVersion()); }
private DataFlowMode getServerDataFlowMode() { if (shell.getDataFlowOperations() == null || shell.getDataFlowOperations().aboutOperation() == null) { throw new IllegalStateException("If the server is available the about operation should be present"); } if (shell.getDataFlowOperations().aboutOperation().get().getFeatureInfo().isSkipperEnabled()) { return DataFlowMode.skipper; } return DataFlowMode.classic; }
@ResponseStatus(HttpStatus.OK) public AboutResource getAboutResource() { final AboutResource aboutResource = new AboutResource(); final FeatureInfo featureInfo = new FeatureInfo(); featureInfo.setAnalyticsEnabled(featuresProperties.isAnalyticsEnabled()); featureInfo.setStreamsEnabled(featuresProperties.isStreamsEnabled()); featureInfo.setTasksEnabled(featuresProperties.isTasksEnabled()); featureInfo.setSchedulerEnabled(featuresProperties.isSchedulesEnabled()); featureInfo.setGrafanaEnabled(this.grafanaProperties.isGrafanaEnabled()); aboutResource.setFeatureInfo(featureInfo); aboutResource.setVersionInfo(versionInfo); final SecurityInfo securityInfo = new SecurityInfo(); securityInfo.setAuthenticationEnabled(authenticationEnabled); securityInfo.setAuthenticated(authentication.isAuthenticated()); securityInfo.setUsername(authentication.getName()); securityInfo.addRole(grantedAuthority.getAuthority()); securityInfo.setFormLogin(true); securityInfo.setFormLogin(false); aboutResource.setSecurityInfo(securityInfo); final RuntimeEnvironment runtimeEnvironment = new RuntimeEnvironment();
@ResponseStatus(HttpStatus.OK) public AboutResource getAboutResource() { final AboutResource aboutResource = new AboutResource(); final FeatureInfo featureInfo = new FeatureInfo(); featureInfo.setAnalyticsEnabled(featuresProperties.isAnalyticsEnabled()); featureInfo.setStreamsEnabled(featuresProperties.isStreamsEnabled()); featureInfo.setTasksEnabled(featuresProperties.isTasksEnabled()); featureInfo.setSkipperEnabled(featuresProperties.isSkipperEnabled()); featureInfo.setSchedulerEnabled(featuresProperties.isSchedulesEnabled()); aboutResource.setFeatureInfo(featureInfo); aboutResource.setVersionInfo(versionInfo); final SecurityInfo securityInfo = new SecurityInfo(); securityInfo.setAuthenticationEnabled(authenticationEnabled); securityInfo.setAuthorizationEnabled(authorizationEnabled); securityInfo.setAuthenticated(authentication.isAuthenticated()); securityInfo.setUsername(authentication.getName()); securityInfo.addRole(authority.getAuthority()); securityInfo.setFormLogin(true); securityInfo.setFormLogin(false); aboutResource.setSecurityInfo(securityInfo); final RuntimeEnvironment runtimeEnvironment = new RuntimeEnvironment();
modelBuilder.addRow().addValue("Features").addValue(about.getFeatureInfo()); rowIndex++; modelBuilder.addRow().addValue("Versions").addValue(versions); rowIndex++; versions.compute(about.getVersionInfo().getImplementation().getName(), (k, v) -> about.getVersionInfo().getImplementation().getVersion()); versions.compute(about.getVersionInfo().getCore().getName(), (k, v) -> about.getVersionInfo().getCore().getVersion()); versions.compute(about.getVersionInfo().getDashboard().getName(), (k, v) -> about.getVersionInfo().getDashboard().getVersion()); versions.compute(about.getVersionInfo().getShell().getName(), (k, v) -> about.getVersionInfo().getShell().getVersion()); SecurityInfo securityInfo = about.getSecurityInfo(); modelBuilder.addRow().addValue("Security").addValue(securityInfo); rowIndex++; if (securityInfo.isAuthenticated()) { modelBuilder.addRow().addValue("Roles").addValue(securityInfo.getRoles()); rowsWithThinSeparators.add(rowIndex++); RuntimeEnvironmentDetails appDeployer = about.getRuntimeEnvironment().getAppDeployer(); List<RuntimeEnvironmentDetails> taskLaunchers = about.getRuntimeEnvironment().getTaskLaunchers(); String deployerColumnName = "Skipper Deployer"; modelBuilder.addRow().addValue(deployerColumnName).addValue(appDeployer); rowIndex++; if (!appDeployer.getPlatformSpecificInfo().isEmpty()) { modelBuilder.addRow().addValue("Platform Specific").addValue(appDeployer.getPlatformSpecificInfo());
private VersionInfo getVersionInfo() { final VersionInfo versionInfo = new VersionInfo(); updateDependency(versionInfo.getDashboard(), versionInfoProperties.getDependencies().getSpringCloudDataflowDashboard()); updateDependency(versionInfo.getImplementation(), versionInfoProperties.getDependencies().getSpringCloudDataflowImplementation()); updateDependency(versionInfo.getCore(), versionInfoProperties.getDependencies().getSpringCloudDataflowCore()); updateDependency(versionInfo.getShell(), versionInfoProperties.getDependencies().getSpringCloudDataflowShell()); if (versionInfoProperties.getDependencyFetch().isEnabled()) { versionInfo.getShell().setChecksumSha1(getChecksum( versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getChecksumSha1(), versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getChecksumSha1Url(), versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getVersion())); versionInfo.getShell().setChecksumSha256(getChecksum( versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getChecksumSha256(), versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getChecksumSha256Url(), versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getVersion())); } return versionInfo; }
modelBuilder.addRow().addValue("Features").addValue(about.getFeatureInfo()); rowIndex++; modelBuilder.addRow().addValue("Versions").addValue(versions); rowIndex++; versions.compute(about.getVersionInfo().getImplementation().getName(), (k, v) -> about.getVersionInfo().getImplementation().getVersion()); versions.compute(about.getVersionInfo().getCore().getName(), (k, v) -> about.getVersionInfo().getCore().getVersion()); versions.compute(about.getVersionInfo().getDashboard().getName(), (k, v) -> about.getVersionInfo().getDashboard().getVersion()); versions.compute(about.getVersionInfo().getShell().getName(), (k, v) -> about.getVersionInfo().getShell().getVersion()); SecurityInfo securityInfo = about.getSecurityInfo(); modelBuilder.addRow().addValue("Security").addValue(securityInfo); rowIndex++; if (securityInfo.isAuthorizationEnabled()) { modelBuilder.addRow().addValue("Roles").addValue(securityInfo.getRoles()); rowsWithThinSeparators.add(rowIndex++); RuntimeEnvironmentDetails appDeployer = about.getRuntimeEnvironment().getAppDeployer(); RuntimeEnvironmentDetails taskLauncher = about.getRuntimeEnvironment().getTaskLauncher(); String deployerColumnName = this.shellDataflowMode == DataFlowMode.skipper ? "Skipper Deployer" : "App Deployer"; modelBuilder.addRow().addValue(deployerColumnName).addValue(appDeployer); rowIndex++; if (!appDeployer.getPlatformSpecificInfo().isEmpty()) { modelBuilder.addRow().addValue("Platform Specific").addValue(appDeployer.getPlatformSpecificInfo());
private VersionInfo getVersionInfo() { final VersionInfo versionInfo = new VersionInfo(); updateDependency(versionInfo.getDashboard(), versionInfoProperties.getDependencies().getSpringCloudDataflowDashboard()); updateDependency(versionInfo.getImplementation(), versionInfoProperties.getDependencies().getSpringCloudDataflowImplementation()); updateDependency(versionInfo.getCore(), versionInfoProperties.getDependencies().getSpringCloudDataflowCore()); updateDependency(versionInfo.getShell(), versionInfoProperties.getDependencies().getSpringCloudDataflowShell()); if (versionInfoProperties.getDependencyFetch().isEnabled()) { versionInfo.getShell().setChecksumSha1(getChecksum( versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getChecksumSha1(), versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getChecksumSha1Url(), versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getVersion())); versionInfo.getShell().setChecksumSha256(getChecksum( versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getChecksumSha256(), versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getChecksumSha256Url(), versionInfoProperties.getDependencies().getSpringCloudDataflowShell().getVersion())); } return versionInfo; }
private String getVersion() { String version = ""; AboutResource aboutResource = this.aboutOperations.get(); if(aboutResource != null) { version = aboutResource.getVersionInfo().getCore().getVersion(); } return version; }
private void updateDependency(Dependency dependency, VersionInfoProperties.DependencyAboutInfo dependencyAboutInfo) { dependency.setName(dependencyAboutInfo.getName()); if (dependencyAboutInfo.getUrl() != null) { dependency.setUrl(constructUrl(dependencyAboutInfo.getUrl(), dependencyAboutInfo.getVersion())); } dependency.setVersion(dependencyAboutInfo.getVersion()); }