@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof ChangeConfigurationNotification)) { return false; } ChangeConfigurationNotification that = (ChangeConfigurationNotification) obj; if (configurationDto != null ? !configurationDto.equals(that.configurationDto) : that.configurationDto != null) { return false; } if (changeNotificationDto != null ? !changeNotificationDto.equals(that.changeNotificationDto) : that.changeNotificationDto != null) { return false; } return true; }
@Override public int hashCode() { int result = profileFilterDto != null ? profileFilterDto.hashCode() : 0; result = 31 * result + (changeNotificationDto != null ? changeNotificationDto.hashCode() : 0); return result; }
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; }
/** * Notify endpoints. * * @param notification the notification * @param profileFilter the profile filter * @param configuration the configuration */ private void notifyEndpoints(ChangeNotificationDto notification, ProfileFilterDto profileFilter, ConfigurationDto configuration) { Notification thriftNotification = new Notification(); thriftNotification.setAppId(notification.getAppId()); thriftNotification.setAppSeqNumber(notification.getAppSeqNumber()); thriftNotification.setGroupId(notification.getGroupId()); thriftNotification.setGroupSeqNumber(notification.getGroupSeqNumber()); if (profileFilter != null) { thriftNotification.setProfileFilterId(profileFilter.getId()); thriftNotification.setProfileFilterSeqNumber(profileFilter.getSequenceNumber()); } if (configuration != null) { thriftNotification.setConfigurationId(configuration.getId()); thriftNotification.setConfigurationSeqNumber(configuration.getSequenceNumber()); } controlZkService.sendEndpointNotification(thriftNotification); }
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; }
EndpointGroupDto groupDto = endpointGroup.toDto(); HistoryDto historyDto = addHistory(groupDto, ChangeType.REMOVE_GROUP); changeDto = new ChangeNotificationDto(); changeDto.setAppId(endpointGroup.getApplicationId()); changeDto.setAppSeqNumber(historyDto.getSequenceNumber()); changeDto.setGroupId(groupDto.getId()); changeDto.setGroupSeqNumber(groupDto.getSequenceNumber()); } else { LOG.warn("Can't remove default endpoint group by id [{}]", id);
@Override public int hashCode() { int result = configurationDto != null ? configurationDto.hashCode() : 0; result = 31 * result + (changeNotificationDto != null ? changeNotificationDto.hashCode() : 0); return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof ChangeProfileFilterNotification)) { return false; } ChangeProfileFilterNotification that = (ChangeProfileFilterNotification) obj; if (changeNotificationDto != null ? !changeNotificationDto.equals(that.changeNotificationDto) : that.changeNotificationDto != null) { return false; } if (profileFilterDto != null ? !profileFilterDto.equals(that.profileFilterDto) : that.profileFilterDto != null) { return false; } return true; }