class ConfigPropertyServiceImpl implements ConfigPropertyService {

	@Override
	public boolean isAllApplicationsExisting(ConfigPropertyRequest configPropertyRequest) throws Exception {

		List<String> invalidApplications = new ArrayList<>();
		List<ConfigPropertyRelation> configRelationList = configPropertyRelationRepository.findAll();
		Map<String, String> applicationParentMap = new HashMap<>();
		configRelationList.forEach(configRelation -> {
			applicationParentMap.put(configRelation.getApplication(), configRelation.getParent());

		});
		configPropertyRequest.getConfigProperties().forEach(configPropertyItem -> {
			if (!applicationParentMap.containsKey(configPropertyItem.getApplication())) {
				invalidApplications.add(configPropertyItem.getApplication());
			}
		});

		return invalidApplications.isEmpty();
	}

}