if (StringUtils.isBlank(requestBulletin.getMessage())) { throw new IllegalArgumentException("The bulletin message must be specified.");
.collect(Collectors.groupingBy(b -> b.getBulletin().getMessage()));
@Override public BulletinEntity createBulletin(final BulletinDTO bulletinDTO, final Boolean canRead){ final Bulletin bulletin = BulletinFactory.createBulletin(bulletinDTO.getCategory(),bulletinDTO.getLevel(),bulletinDTO.getMessage()); bulletinRepository.addBulletin(bulletin); return entityFactory.createBulletinEntity(dtoFactory.createBulletinDto(bulletin),canRead); }
private void printServicesStillDisabling(final FlowClient flowClient, final String pgId) throws NiFiClientException, IOException { final ControllerServicesEntity servicesEntity = flowClient.getControllerServices(pgId); if (servicesEntity == null || servicesEntity.getControllerServices() == null) { return; } println(); println("One or more services appear to be stuck disabling: "); for (final ControllerServiceEntity serviceEntity : servicesEntity.getControllerServices()) { if (ControllerServiceStates.STATE_DISABLING.equals(serviceEntity.getComponent().getState())) { println(); println("Service: " + serviceEntity.getId() + " - " + serviceEntity.getComponent().getName()); if (serviceEntity.getBulletins() != null) { println(); println("Reasons: "); for (final BulletinEntity bulletinEntity : serviceEntity.getBulletins()) { println("- " + bulletinEntity.getBulletin().getMessage()); } } } } }
private void printServicesStillEnabling(final FlowClient flowClient, final String pgId) throws NiFiClientException, IOException { final ControllerServicesEntity servicesEntity = flowClient.getControllerServices(pgId); if (servicesEntity == null || servicesEntity.getControllerServices() == null) { return; } println(); println("One or more services appear to be stuck enabling: "); for (final ControllerServiceEntity serviceEntity : servicesEntity.getControllerServices()) { if (ControllerServiceStates.STATE_ENABLING.equals(serviceEntity.getComponent().getState())) { println(); println("Service: " + serviceEntity.getId() + " - " + serviceEntity.getComponent().getName()); if (serviceEntity.getBulletins() != null) { println(); println("Reasons: "); for (final BulletinEntity bulletinEntity : serviceEntity.getBulletins()) { println("- " + bulletinEntity.getBulletin().getMessage()); } } } } }
public BulletinDTO copy(final BulletinDTO original) { final BulletinDTO copy = new BulletinDTO(); copy.setId(original.getId()); copy.setTimestamp(original.getTimestamp()); copy.setGroupId(original.getGroupId()); copy.setSourceId(original.getSourceId()); copy.setSourceName(original.getSourceName()); copy.setCategory(original.getCategory()); copy.setLevel(original.getLevel()); copy.setMessage(original.getMessage()); copy.setNodeAddress(original.getNodeAddress()); return copy; }