private ChangeNotificationDto createNotification(ProfileFilterDto profileFilter, HistoryDto historyDto) { LOG.debug("Create notification after profile filter update."); ChangeNotificationDto changeNotificationDto = null; if (historyDto != null) { changeNotificationDto = new ChangeNotificationDto(); changeNotificationDto.setAppId(profileFilter.getApplicationId()); changeNotificationDto.setAppSeqNumber(historyDto.getSequenceNumber()); String endpointGroupId = profileFilter.getEndpointGroupId(); if (isValidId(endpointGroupId)) { EndpointGroup group = endpointGroupDao.findById(endpointGroupId); if (group != null) { changeNotificationDto.setGroupId(group.getId().toString()); changeNotificationDto.setGroupSeqNumber(group.getSequenceNumber()); } else { LOG.debug("Can't find endpoint group by id [{}].", endpointGroupId); } } else { LOG.debug("Incorrect endpoint group id [{}].", endpointGroupId); } } else { LOG.debug("Can't save history information."); } return changeNotificationDto; }
private ChangeNotificationDto createNotification(ConfigurationDto configurationDto, HistoryDto historyDto) { LOG.debug("Create notification after configuration update."); ChangeNotificationDto changeNotificationDto = null; if (historyDto != null) { changeNotificationDto = new ChangeNotificationDto(); changeNotificationDto.setAppId(configurationDto.getApplicationId()); changeNotificationDto.setAppSeqNumber(historyDto.getSequenceNumber()); String endpointGroupId = configurationDto.getEndpointGroupId(); if (isValidId(endpointGroupId)) { EndpointGroup group = endpointGroupDao.findById(endpointGroupId); if (group != null) { changeNotificationDto.setGroupId(idToString(group)); changeNotificationDto.setGroupSeqNumber(group.getSequenceNumber()); } else { LOG.debug("Can't find endpoint group by id [{}].", endpointGroupId); } } else { LOG.debug("Incorrect endpoint group id [{}].", endpointGroupId); } } else { LOG.debug("Can't save history information."); } return changeNotificationDto; }