/** * Create new instance of <code>EndpointGroupState</code>. * @param dto data transfer object contain data that * assign on fields of new instance */ public EndpointGroupState(EndpointGroupStateDto dto) { this.endpointGroupId = dto.getEndpointGroupId(); this.profileFilterId = dto.getProfileFilterId(); this.configurationId = dto.getConfigurationId(); }
/** * Create new instance of <code>CassandraEndpointGroupState</code>. * * @param dto data transfer object contain data that * assign on fields of new instance */ public CassandraEndpointGroupState(EndpointGroupStateDto dto) { this.endpointGroupId = dto.getEndpointGroupId(); this.profileFilterId = dto.getProfileFilterId(); this.configurationId = dto.getConfigurationId(); }
/** * Recalculate topic list. * * @param groups endpoint group state list * @return the list */ private List<TopicDto> recalculateTopicList(List<EndpointGroupStateDto> groups) { Set<TopicDto> topicSet = new HashSet<TopicDto>(); for (EndpointGroupStateDto egs : groups) { EndpointGroupDto endpointGroup = cacheService.getEndpointGroupById(egs.getEndpointGroupId()); if (endpointGroup.getTopics() != null) { for (String topicId : endpointGroup.getTopics()) { TopicDto topic = cacheService.getTopicById(topicId); topicSet.add(topic); } } } List<TopicDto> topicList = new ArrayList<>(topicSet); Collections.sort(topicList, new Comparator<TopicDto>() { @Override public int compare(TopicDto o1, TopicDto o2) { return o1.getId().compareTo(o2.getId()); } }); return topicList; }
/** * Specific method for converting list of <code>EndpointGroupStateDto</code> objects * to list of model objects <code>EndpointGroupState</code>. * * @param stateDtoList the state dto list * @return converted list of <code>EndpointGroupState</code> objects */ public static List<EndpointGroupState> convertDtoToModelList( List<EndpointGroupStateDto> stateDtoList) { List<EndpointGroupState> states = null; if (stateDtoList != null && !stateDtoList.isEmpty()) { states = new ArrayList<>(); for (EndpointGroupStateDto dto : stateDtoList) { EndpointGroupState state = new EndpointGroupState(); state.setConfigurationId(dto.getConfigurationId()); state.setEndpointGroupId(dto.getEndpointGroupId()); state.setProfileFilterId(dto.getProfileFilterId()); states.add(state); } } return states; }
/** * Specific method for converting list of <code>EndpointGroupStateDto</code> objects * to list of model objects <code>CassandraEndpointGroupState</code>. * * @param stateDtoList the state dto list * @return converted list of <code>CassandraEndpointGroupState</code> objects */ public static List<CassandraEndpointGroupState> convertDtoToModelList( List<EndpointGroupStateDto> stateDtoList) { List<CassandraEndpointGroupState> states = null; if (stateDtoList != null && !stateDtoList.isEmpty()) { states = new ArrayList<>(); for (EndpointGroupStateDto dto : stateDtoList) { CassandraEndpointGroupState state = new CassandraEndpointGroupState(); state.setConfigurationId(dto.getConfigurationId()); state.setEndpointGroupId(dto.getEndpointGroupId()); state.setProfileFilterId(dto.getProfileFilterId()); states.add(state); } } return states; }
private PageLinkDto getPageLinkDto() { List<EndpointProfileDto> endpointProfileList = new ArrayList<>(); for (int i = 0; i < GENERATED_PROFILES_COUNT; i++) { endpointProfileList.add(generateEndpointProfileWithEndpointGroupId(TEST_APPID)); } String id = endpointProfileList.get(0).getGroupState().get(0).getEndpointGroupId(); return new PageLinkDto(id, TEST_LIMIT, TEST_OFFSET); }
for (EndpointGroupStateDto egs : egsList) { EndpointGroupDto endpointGroup = null; if (!StringUtils.isBlank(egs.getEndpointGroupId())) { endpointGroup = endpointService.findEndpointGroupById(egs.getEndpointGroupId()); if (endpointGroup != null) { endpointGroups.add(endpointGroup);
endpointId, changeType, change.getProfileFilterId(), change.getEndpointGroupId()); groupsMap.remove(egs.getEndpointGroupId()); historyDelta.setAllChanged(); } else if (changeType == ChangeType.ADD_PROF) { + "which means configuration/topic list change", endpointId, change.getProfileFilterId()); groupsMap.remove(egs.getEndpointGroupId()); historyDelta.setAllChanged(); } else {
for (EndpointGroupStateDto endpointGroupState : endpointProfile.getGroupState()) { endpointGroupsSet.add(controlService.getEndpointGroup( endpointGroupState.getEndpointGroupId()));