public ConfigObjectFactory(jrds.PropertiesManager pm) { this.pm = pm; this.cl = pm.extensionClassLoader; init(); }
@Override Macro build(JrdsDocument n) { return makeMacro(n); }
public void addUrl(URI ressourceUrl) { load.importUrl(ressourceUrl); }
public Map<String, HostInfo> setHostMap(Map<String, Timer> timers) { Map<String, JrdsDocument> nodemap = load.getRepository(ConfigType.HOSTS); HostBuilder ob = new HostBuilder(); ob.setClassLoader(cl); ob.setMacros(macrosmap); ob.setProbeFactory(pf); ob.setPm(pm); ob.setTimers(timers); ob.setListeners(listenerMap); ob.setGraphDescMap(graphDescMap); ob.setArchivesSetMap(archivessetmap); Map<String, HostInfo> hostsMap = getObjectMap(ob, nodemap); logger.debug(jrds.Util.delayedFormatString("Hosts configured: %s", hostsMap.keySet())); return hostsMap; }
public Map<String, ProbeDesc<? extends Object>> setProbeDescMap() { Map<String, JrdsDocument> nodemap = load.getRepository(ConfigType.PROBEDESC); ProbeDescBuilder ob = new ProbeDescBuilder(); ob.setClassLoader(cl); ob.setPm(pm); ob.setGraphDescMap(graphDescMap); Map<String, ProbeDesc<? extends Object>> probeDescMap = getObjectMap(ob, nodemap); pf = new ProbeFactory(probeDescMap, graphDescMap); logger.debug(jrds.Util.delayedFormatString("Probe description configured: %s", probeDescMap.keySet())); return probeDescMap; }
public Map<String, GraphDesc> setGraphDescMap() { Map<String, JrdsDocument> nodemap = load.getRepository(ConfigType.GRAPHDESC); GraphDescBuilder ob = new GraphDescBuilder(); ob.setPm(pm); graphDescMap = getObjectMap(ob, nodemap); logger.debug(jrds.Util.delayedFormatString("Graph description configured: %s", graphDescMap.keySet())); return graphDescMap; }
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; }
public Map<String, Filter> setFilterMap() { Map<String, JrdsDocument> nodemap = load.getRepository(ConfigType.FILTER); FilterBuilder ob = new FilterBuilder(); ob.setPm(pm); Map<String, Filter> filtersMap = getObjectMap(ob, nodemap); logger.debug(jrds.Util.delayedFormatString("Filters configured: %s", filtersMap.keySet())); return filtersMap; }
static final public <T> ProbeDesc<T> getProbeDesc(JrdsDocument node) throws Exception { ProbeDescBuilder builder = new ProbeDescBuilder(); builder.setPm(new PropertiesManager()); return builder.makeProbeDesc(node); } }
private Filter doFilter(JrdsDocument d) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, IOException { FilterBuilder sm = new FilterBuilder(); sm.setPm(Tools.makePm(testFolder, "security=true")); return sm.makeFilter(d); }
public Map<String, Listener<?, ?>> setListenerMap() { Map<String, JrdsDocument> nodemap = load.getRepository(ConfigType.LISTENER); ListenerBuilder ob = new ListenerBuilder(); ob.setClassLoader(cl); listenerMap = getObjectMap(ob, nodemap); logger.debug(jrds.Util.delayedFormatString("listener configured: %s", listenerMap.keySet())); return listenerMap; }
public Map<String, Tab> setTabMap() { Map<String, JrdsDocument> nodemap = load.getRepository(ConfigType.TAB); TabBuilder ob = new TabBuilder(); Map<String, Tab> tabsMap = getObjectMap(ob, nodemap); logger.debug(jrds.Util.delayedFormatString("Tabs configured: %s", tabsMap.keySet())); return tabsMap; }
public Map<String, Macro> setMacroMap() { Map<String, JrdsDocument> nodemap = load.getRepository(ConfigType.MACRODEF); macrosmap = getObjectMap(new MacroBuilder(), nodemap); logger.debug(jrds.Util.delayedFormatString("Macro configured: %s", macrosmap.keySet())); return macrosmap; }
public Map<String, ArchivesSet> setArchiveSetMap() { Map<String, JrdsDocument> nodemap = load.getRepository(ConfigType.ARCHIVESSET); archivessetmap = getObjectMap(new ArchivesSetBuilder(), nodemap); archivessetmap.put(ArchivesSet.DEFAULT.getName(), ArchivesSet.DEFAULT); logger.debug(jrds.Util.delayedFormatString("Archives set configured: %s", archivessetmap.keySet())); return archivessetmap; }
public Map<String, JrdsDocument> getNodeMap(ConfigType ct) { return load.getRepository(ct); }
@Override GraphDesc build(JrdsDocument n) throws InvocationTargetException { try { return makeGraphDesc(n); } catch (Exception e) { throw new InvocationTargetException(e, GraphDescBuilder.class.getName()); } }
/** * Apply a method on a object with the value found in the XML element If the * element is null, the method does nothing. * * @param e * @param o * @param method * @return * @throws SecurityException * @throws NoSuchMethodException * @throws IllegalArgumentException * @throws IllegalAccessException * @throws InvocationTargetException * @throws InstantiationException */ public boolean setMethod(JrdsElement e, Object o, String method) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { return setMethod(e, o, method, String.class); }
public Map<String, GraphDesc> setGrapMap() { Map<String, JrdsDocument> nodemap = load.getRepository(ConfigType.GRAPH); GraphDescBuilder ob = new GraphDescBuilder(); ob.setPm(pm); Map<String, GraphDesc> graphsMap = getObjectMap(ob, nodemap); logger.debug(jrds.Util.delayedFormatString("Graphs configured: %s", graphsMap.keySet())); return graphsMap; }
public ConfigObjectFactory(jrds.PropertiesManager pm, ClassLoader cl) { this.pm = pm; this.cl = cl; init(); }
/** * Apply a method on a object with the value found in a collection of XML * elements If the element is null, the method does nothing. * * @param e * @param o * @param method * @param argType * @return true if a least one set method succed * @throws SecurityException * @throws NoSuchMethodException * @throws IllegalArgumentException * @throws IllegalAccessException * @throws InvocationTargetException * @throws InstantiationException */ public boolean setMethod(Iterable<JrdsElement> e, Object o, String method, Class<?> argType) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { if(e == null) return false; boolean setted = false; for(JrdsElement elem: e) { setted |= setMethod(elem, o, method, argType); } return setted; }