metamap iter
This commit is contained in:
snoop 2017-04-27 10:32:24 +09:00
parent eedd15e5fc
commit 21cf01b0c9

View File

@ -14,10 +14,7 @@ import org.snmp4j.smi.Address;
import org.snmp4j.transport.DefaultUdpTransportMapping; import org.snmp4j.transport.DefaultUdpTransportMapping;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/** /**
* Created by insanity on 17. 4. 10. * Created by insanity on 17. 4. 10.
@ -149,9 +146,12 @@ public class SNMPCrawler extends Crawler {
OFResultSet rs = OFResultSet.newInstance(item); OFResultSet rs = OFResultSet.newInstance(item);
List<String> row = new ArrayList<>(); List<String> row = new ArrayList<>(Arrays.asList(new String[map.size()]));
for (String key : map.keySet()) {
row.add(map.get(key)); Map<String, Integer> metaMap = rs.getMeta();
for (Map.Entry<String, Integer> info : metaMap.entrySet()) {
row.set(info.getValue().intValue(), map.get(info.getKey()));
} }
rs.addRow(row); rs.addRow(row);