protected ParamsBean getParamsBean(HttpServletRequest request, String... restPath) { return new ParamsBean(request, getHostsList(), restPath); }
/** * This method add a probe to the current host document * * @param hostElement the host element * @param probe the Name of the probe * @param argsTypes a list of type for the argument * @param argsValues a list of value for the argument * @return the generated element for this probe */ public JrdsElement addProbe(JrdsElement hostElement, String probe, List<String> argsTypes, List<String> argsValues, Map<String, String> beans) { return addProbe(hostElement, probe, null, argsTypes, argsValues, beans); }
@Override public ACL join(ACL acl) { return acl.join(this); }
@Override public ACL join(ACL acl) { if(acl instanceof RolesACL) { Set<String> newRoles = new HashSet<String>(roles); newRoles.addAll(((RolesACL) acl).getRoles()); return new RolesACL(newRoles); } else if(acl instanceof AdminACL) { Set<String> newRoles = new HashSet<String>(roles); newRoles.add(((AdminACL) acl).getAdminRole()); return new RolesACL(newRoles); } else { return this; } }
public ParamsBean(HttpServletRequest req, HostsList hl) { contextPath = req.getContextPath(); params = getReqParamsMap(req); readAuthorization(req, hl); parseReq(hl); }
@Override public List<FieldInfo> getFields() { FieldInfo fi1 = new FieldInfo(); fi1.dojoType = DojoType.TextBox; fi1.id = "discoverMuninPort"; fi1.label = "Munin listening port"; return Arrays.asList(fi1); }
public void doHtmlDiscoverFields(JrdsDocument document) { try { List<FieldInfo> fields = getFields(); log(Level.DEBUG, "Fields: %s", fields); JrdsElement localRoot = document.getRootElement().addElement("div"); for(FieldInfo f: fields) { f.dojoType.doNode(localRoot, f); } } catch (DOMException e) { log(Level.ERROR, e, "Invalid DOM: %s", e); } }
private String resolv(String name, String className) { Class<?> c; try { c = getPropertiesManager().extensionClassLoader.loadClass(className); return resolv(name, c); } catch (ClassNotFoundException e1) { return name + " not found"; } }
protected boolean allowed(ParamsBean params, ACL acl, HttpServletRequest req, HttpServletResponse res) { if (getPropertiesManager().security) { logger.trace(jrds.Util.delayedFormatString("Looking if ACL %s allow access to %s", acl, req.getServletPath())); if (!acl.check(params)) { res.setStatus(HttpServletResponse.SC_FORBIDDEN); return false; } } return true; }
@Override public void discoverPost(String hostname, JrdsElement hostEleme, Map<String, JrdsDocument> probdescs, HttpServletRequest request) { super.discoverPost(hostname, hostEleme, probdescs, request); jrdsHandle.connector.tearDown(); } }
public JrdsJSONWriter doTree(JrdsJSONWriter w, String name, String id, String type, List<String> childsref) { return doTree(w, name, id, type, childsref, null); }
public Iterator<String> iterator() { return keys(); }
private String resolv(String name, Object o) { String retValue; if(o != null) retValue = resolv(name, o.getClass()); else retValue = name + " not found"; return retValue; }
public boolean check(ParamsBean params) { return params.getRoles().contains(adminRole); }
public void addACL(ACL acl) { this.acl = this.acl.join(acl); }
public JrdsJSONWriter doTree(JrdsJSONWriter w, String name, int id, String type, List<String> childsref, Map<String, ?> attributes) { return doTree(w, name, Integer.toString(id), type, childsref, attributes); }
public void addACL(ACL acl) { this.acl = this.acl.join(acl); }
public JrdsJSONWriter doTree(JrdsJSONWriter w, String name, int id, String type, List<String> childsref) { return doTree(w, name, Integer.toString(id), type, childsref, null); }
public void addACL(ACL acl) { this.acl = this.acl.join(acl); }
public void addACL(ACL acl) { this.acl = this.acl.join(acl); }