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; }
/** * Creates a BulletinDTO for the specified Bulletin. * * @param bulletin bulletin * @return dto */ public BulletinDTO createBulletinDto(final Bulletin bulletin) { final BulletinDTO dto = new BulletinDTO(); dto.setId(bulletin.getId()); dto.setNodeAddress(bulletin.getNodeAddress()); dto.setTimestamp(bulletin.getTimestamp()); dto.setGroupId(bulletin.getGroupId()); dto.setSourceId(bulletin.getSourceId()); dto.setSourceName(bulletin.getSourceName()); dto.setCategory(bulletin.getCategory()); dto.setLevel(bulletin.getLevel()); dto.setMessage(bulletin.getMessage()); return dto; }
@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); }
if (bulletinEntity.getCanRead() && bulletinEntity.getBulletin() != null && bulletinEntity.getBulletin().getNodeAddress() == null) { bulletinEntity.getBulletin().setNodeAddress(nodeAddress); .collect(Collectors.groupingBy(b -> b.getBulletin().getMessage())); selectedBulletinEntity.getBulletin().setNodeAddress(ALL_NODES_MESSAGE); entities.add(selectedBulletinEntity);
public BulletinEntity createBulletinEntity(final BulletinDTO dto, final boolean canRead) { final BulletinEntity entity = new BulletinEntity(); if (dto != null) { entity.setId(dto.getId()); entity.setSourceId(dto.getSourceId()); entity.setGroupId(dto.getGroupId()); entity.setTimestamp(dto.getTimestamp()); entity.setNodeAddress(dto.getNodeAddress()); entity.setCanRead(canRead); if (canRead) { entity.setBulletin(dto); } } return entity; }
if (requestBulletin.getId() != null) { throw new IllegalArgumentException("A bulletin ID cannot be specified."); if (StringUtils.isBlank(requestBulletin.getMessage())) { throw new IllegalArgumentException("The bulletin message must be specified.");
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()); } } } } }