public Set<DiscoverAgent> getDiscoverAgent() { Set<DiscoverAgent> daSet = new HashSet<DiscoverAgent>(daList.size()); for(Class<? extends DiscoverAgent> daa: daList) { try { daSet.add(daa.newInstance()); } catch (Exception e) { log(Level.ERROR, e, "Error creating discover agent " + daa.getName() + ": " + e); } } return daSet; }
void doCustomTabs(Map<String, Tab> customTabMap, Map<String, GraphTree> treeMap, Set<Tab> tabs) { if(!customTabMap.isEmpty()) { log(Level.DEBUG, "Tabs to add: %s", customTabMap.values()); for(Tab t: customTabMap.values()) { t.setHostlist(this); GraphTree tabtree = t.getGraphTree(); if(tabtree != null) treeMap.put(t.getName(), tabtree); } } }
/** * Generate the list of roles that might view this node, using the filters * * @param gn * @param pathList */ private void checkRoles(GraphNode gn, String root, List<String> pathList) { StringBuilder path = new StringBuilder("/" + root); for(String pathElem: pathList) { path.append('/').append(pathElem); } for(Filter f: filters.values()) { if(f.acceptGraph(gn, path.toString())) { log(Level.TRACE, "Adding ACL %s to %s", f.getACL(), gn); gn.addACL(f.getACL()); } } }
private void addFilter(Filter newFilter) { filters.put(newFilter.getName(), newFilter); ACL acl = newFilter.getACL(); if(acl instanceof RolesACL) { roles.addAll(((RolesACL) acl).getRoles()); } log(Level.DEBUG, "Filter %s added with ACL %s", newFilter.getName(), newFilter.getACL()); }
void doCustomGraphs(Map<String, GraphDesc> graphs, Map<Integer, GraphNode> graphMap, Map<String, GraphTree> treeMap, Set<Tab> tabs) { log(Level.DEBUG, "Parsing graphs configuration"); // Let's build the tab with all the custom graphs if(!graphs.isEmpty()) { Tab customGraphsTab = new Tab.DynamicTree("Custom graphs", PropertiesManager.CUSTOMGRAPHTAB); customGraphsTab.setHostlist(this); for(GraphDesc gd: graphs.values()) { AutonomousGraphNode gn = new AutonomousGraphNode(gd); gn.configure(this); graphMap.put(gn.getQualifiedName().hashCode(), gn); customGraphsTab.add(gn.getQualifiedName(), Arrays.asList(new String[] { gd.getName() })); } GraphTree tree = customGraphsTab.getGraphTree(); treeMap.put(tree.getName(), tree); tabs.add(customGraphsTab); } }
void doSums(Map<String, Sum> sums, Map<Integer, GraphNode> graphMap, Map<String, GraphTree> treeMap, Set<Tab> tabs) { // Let's build the tab with all the sums if(sums.size() > 0) { Tab sumGraphsTab = new Tab.DynamicTree("Sums", PropertiesManager.SUMSTAB); sumGraphsTab.setHostlist(this); for(Sum s: sums.values()) { try { s.configure(this); graphMap.put(s.getQualifiedName().hashCode(), s); sumGraphsTab.add(s.getQualifiedName(), "Sums", s.getName()); } catch (Exception e1) { log(Level.ERROR, e1, "failed sum: %s", e1); } } GraphTree tree = sumGraphsTab.getGraphTree(); treeMap.put(tree.getName(), tree); tabs.add(sumGraphsTab); } }
log(Level.ERROR, "Probes directory not configured, can't configure"); return; log(Level.ERROR, "Configuration directory not configured, can't configure"); return; log(Level.TRACE, "timers to build %s", pm.timers); log(Level.DEBUG, "timers %s", timers); log(Level.DEBUG, "Starting parsing descriptions"); ConfigObjectFactory conf = new ConfigObjectFactory(pm); conf.setArchiveSetMap(); for(ProbeDesc<?> pd: allProbeDesc.values()) { for(ProbeMeta meta: ArgFactory.enumerateAnnotation(pd.getProbeClass(), ProbeMeta.class, StarterNode.class)) { log(Level.TRACE, "new probe meta: %s", meta); daList.add(meta.discoverAgent()); log(Level.DEBUG, "Discover agents classes are %s", daList); conf.setMacroMap(); for(Listener<?, ?> l: conf.setListenerMap().values()) { try { for(ProbeMeta meta: ArgFactory.enumerateAnnotation(p.getClass(), ProbeMeta.class, StarterNode.class)) { log(Level.TRACE, "another probe meta: %s", meta); timerStarterClasses.add(meta.timerStarter()); topStarterClasses.add(meta.topStarter());