public void reportSchemaRegistryStatus()

in src/main/java/com/amazonaws/schemamanager/reports/SchemaManagerReporterImpl.java [28:114]


	public void reportSchemaRegistryStatus(CheckChangesResponse response) {
		log.info(String.format(
				"Repository Used: %s. Branch: %s",
				config.getAppConfig().getRepoClientProperties().getRepoEndPoint(),
				config.getAppConfig().getRepoClientProperties().getBaseInfo()
				));
		
		final StringBuilder sb = new StringBuilder();
		
		// Print new subjects in repository
		sb.append(String.format(
				"New Subjects Found in Repository: %d\n",
				response.getNewSubjectsInRepo()!=null ? response.getNewSubjectsInRepo().size() : 0));
		if (response.getNewSubjectsInRepo() != null && response.getNewSubjectsInRepo().size() > 0) {
			response.getNewSubjectsInRepo().forEach((s,r) -> {
				sb.append(String.format("\tNew Subject: %s; Path: %s\n", s, r.getPath()));
			});
		}
		log.info(sb.toString());
		
		sb.setLength(0); // reset
		
		// Print Ambiguous issues
		sb.append(String.format(
					"Ambiguous Subjects Found in Repository: %d\n",
					response.getAmbiguousSubjects()!=null ? response.getAmbiguousSubjects().size() : 0));
		if (response.getAmbiguousSubjects() != null && response.getAmbiguousSubjects().size() > 0) {
			response.getAmbiguousSubjects().forEach((s,l) -> {
				sb.append(String.format("Subject: %s; defined in: \n\t%s\n", s, String.join("\n\t\t", l.stream().map(r->r.getPath()).collect(Collectors.toList()))));
			});
		}
		log.info(sb.toString());
		
		sb.setLength(0); // reset
		
		// Updated compatibility levels
		sb.append(String.format(
				"Updated Compatibility Levels Found in Repository: %d\n",
				response.getUpdateCompatibility()!=null ? response.getUpdateCompatibility().size() : 0));
		if (response.getUpdateCompatibility() != null && response.getUpdateCompatibility().size() > 0) {
			response.getUpdateCompatibility().forEach((s,c) -> {
				sb.append(String.format("\tSubject: %s; New Compatibility Level: %s\n", s, c.getRepoSchema().getMetadata().getCompatibilityLevel(s).toString()));
			});
		}
		log.info(sb.toString());
		
		sb.setLength(0); // reset
		
		// Updates in repository
		sb.append(String.format(
				"Updates Subjects Found in Repository: %d\n",
				response.getNewVersionFound()!=null ? response.getNewVersionFound().size() : 0));
		if (response.getNewVersionFound() != null && response.getNewVersionFound().size() > 0) {
			response.getNewVersionFound().forEach((s,scp) -> {
				sb.append(String.format("\tUpdated Subject: %s; Path: %s\n", s, scp.getRepoSchema().getPath()));
			});
		}
		log.info(sb.toString());
		
		sb.setLength(0); // reset
		
		// Updates in repository
		sb.append(String.format(
				"Subject not in the repository: %d\n",
				response.getNotInRepositorySubjects()!=null ? response.getNotInRepositorySubjects().size() : 0));
		if (response.getNotInRepositorySubjects() != null && response.getNotInRepositorySubjects().size() > 0) {
			response.getNotInRepositorySubjects().forEach(s -> {
				sb.append(String.format("\t%s\n", s));
			});
		}
		log.info(sb.toString());
		
		sb.setLength(0); // reset
		
		// Up to date:
		sb.append(String.format(
				"Sychronized subjects: %d\n",
				response.getUnchangedSchemas()!=null ? response.getUnchangedSchemas().size() : 0));
		if (response.getUnchangedSchemas() != null && response.getUnchangedSchemas().size() > 0) {
			response.getUnchangedSchemas().forEach(scp -> {
				sb.append(String.format("\tPath: %s\n", scp.getRepoSchema().getPath()));
			});
		}
		log.info(sb.toString());
		
		sb.setLength(0); // reset
	}