@Override public void visitEntry(Entry entry) { String type = entry.getType(); String status = entry.getStatus(); status = m_aggregationManger.handle(AggregationConfigManager.PROBLEM_TYPE, m_domain, status); m_currentEntry = findOrCreatEntry(m_currentMachine, type, status); super.visitEntry(entry); }
protected Entry findOrCreatEntry(Machine machine, String type, String status) { List<Entry> entries = machine.getEntries(); for (Entry entry : entries) { if (entry.getType().equals(type) && entry.getStatus().equals(status)) { return entry; } } Entry entry = new Entry(); entry.setStatus(status); entry.setType(type); entries.add(entry); return entry; }