public Map<String, Sum> setSumMap() { Map<String, JrdsDocument> nodemap = load.getRepository(ConfigType.SUM); SumBuilder ob = new SumBuilder(); ob.setPm(pm); Map<String, Sum> sumpsMap = getObjectMap(ob, nodemap); logger.debug(jrds.Util.delayedFormatString("Sums configured: %s", sumpsMap.keySet())); return sumpsMap; }
@Override Sum build(JrdsDocument n) throws InvocationTargetException { try { return makeSum(n); } catch (SecurityException | IllegalArgumentException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new InvocationTargetException(e, FilterBuilder.class.getName()); } }
private Sum doSum(JrdsDocument d, HostsList hl) throws Exception { HostInfo host = new HostInfo("SumHost"); SumBuilder sm = new SumBuilder(); sm.setPm(Tools.makePm(testFolder, "security=yes")); Sum sp = sm.makeSum(d); try { sp.configure(hl); } catch (Exception e) { } sp.getProbe().setHost(new HostStarter(host)); hl.addHost(host); hl.addProbe(sp.getProbe()); jrds.GraphNode mg = new MockGraph(); mg.getGraphDesc().add("plot"); hl.addHost(mg.getProbe().getHost()); hl.addProbe(mg.getProbe()); return sp; }
public Sum makeSum(JrdsDocument n) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { JrdsElement root = n.getRootElement(); String name = root.getAttribute("name"); if(name != null && !"".equals(name)) { ArrayList<String> elements = new ArrayList<String>(); for(JrdsElement elemNode: root.getChildElementsByName("element")) { String elemName = elemNode.getAttribute("name"); elements.add(elemName); } Sum sp = new Sum(name, elements); doACL(sp, n, root); return sp; } return null; } }