public ServerHealthState success(HealthStateType healthStateType) { ServerHealthState state = ServerHealthState.success(healthStateType); serverHealthService.update(state); return state; }
public ServerHealthState success(HealthStateType healthStateType) { return add(ServerHealthState.success(healthStateType)); }
public ServerHealthState success(HealthStateType healthStateType) { return kickMe(ServerHealthState.success(healthStateType), true); }
private synchronized void saveValidConfigToCache(GoConfigHolder configHolder) { if (configHolder != null) { LOGGER.debug("[Config Save] Saving config to the cache"); this.lastException = null; this.configHolder = configHolder; this.currentConfig = this.configHolder.config; this.currentConfigForEdit = this.configHolder.configForEdit; this.mergedCurrentConfigForEdit = configHolder.mergedConfigForEdit; serverHealthService.update(ServerHealthState.success(HealthStateType.invalidConfig())); } }
private void removeLicenseInvalidFromLog() { serverHealthService.update(ServerHealthState.success( HealthStateType.invalidLicense(HealthStateScope.GLOBAL))); }
private ServerHealthState stageSchedulingSuccessfulState(String pipelineName, String stageName) { return ServerHealthState.success(HealthStateType.general(HealthStateScope.forStage(pipelineName, stageName))); }
public void onConfigChange(CruiseConfig newCruiseConfig) { ServerHealthState serverHealthState; if (isArtifactsDirChanged(newCruiseConfig)) { serverHealthState = ServerHealthState.warning(ARTIFACTS_ROOT_CHANGED_MESSAGE, ARTIFACTS_ROOT_CHANGED_DESC, ARTIFACTS_ROOT_CHANGE_HEALTH_STATE_TYPE); LOGGER.info("[Configuration Changed] Artifacts directory was changed."); } else { serverHealthState = ServerHealthState.success(ARTIFACTS_ROOT_CHANGE_HEALTH_STATE_TYPE); } serverHealthService.update(serverHealthState); }
private void clearServerHealthError() { serverHealthService.update( ServerHealthState.success(HealthStateType.general(HealthStateScope.forBackupCron())) ); }
public CommandSnippets getAllCommandSnippets(String repositoryDirectory) { serverHealthService.update(ServerHealthState.success(HealthStateType.commandRepositoryAccessibilityIssue())); try { File commandRepositoryDirectory = new File(repositoryDirectory); //adding the exists check till packaging command repository with Go story is played. if (commandRepositoryDirectory.isDirectory() && commandRepositoryDirectory.canRead() && commandRepositoryDirectory.canExecute()) { return new CommandSnippets(walk(commandRepositoryDirectory)); } else { throw new IOException("Failed to access command repository located in Go Server Directory at " + repositoryDirectory + ". The directory does not exist or Go does not have sufficient permissions to access it."); } } catch (IOException e) { ServerHealthState serverHealthState = ServerHealthState.warning("Command Repository", e.getMessage(), HealthStateType.commandRepositoryAccessibilityIssue(), systemEnvironment.getCommandRepoWarningTimeout()); serverHealthService.update(serverHealthState); LOGGER.warn(e.getMessage()); } return new CommandSnippets(new ArrayList<>()); }
@Test public void shouldReturntrueForRealSuccess() throws Exception { assertThat(new ServerHealthStates(ServerHealthState.success(HealthStateType.databaseDiskFull())).isRealSuccess(), is(true)); } }
@Test public void shouldRemoveLogWhenUpdateIsFine() throws Exception { serverHealthService.update(ServerHealthState.error("message", "description", globalId)); assertThat(serverHealthService, ServerHealthMatcher.containsState(globalId)); assertThat(serverHealthService.update(ServerHealthState.success(globalId)), is(nullValue())); assertThat(serverHealthService, doesNotContainState(globalId)); }
if (!buildCause.materialsMatch(expandedMaterialConfigs)) { LOGGER.warn("Error while scheduling pipeline: {}. Possible Reasons: (1) Upstream pipelines have not been built yet. (2) Materials do not match between configuration and build-cause.", pipelineName); return ServerHealthState.success(HealthStateType.general(HealthStateScope.forPipeline(pipelineName))); return ServerHealthState.success(HealthStateType.general(HealthStateScope.forPipeline(pipelineName))); } catch (NoCompatibleUpstreamRevisionsException ncure) { String message = "Error while scheduling pipeline: " + pipelineName + " as no compatible revisions were identified."; } catch (NoModificationsPresentForDependentMaterialException e) { LOGGER.error(e.getMessage(), e); return ServerHealthState.success(HealthStateType.general(HealthStateScope.forPipeline(pipelineName))); } catch (Exception e) { String message = "Error while scheduling pipeline: " + pipelineName;