private List<OnmsResource> getDomainResources(ResourcePath parent, Set<String> intfNames) { final List<OnmsResource> resources = Lists.newLinkedList(); for (String intfName : intfNames) { OnmsResource resource = getResourceByParentPathAndInterface(parent, intfName); try { resource.setLink("element/nodeList.htm?listInterfaces=true&snmpParm=ifAlias&snmpParmMatchType=contains&snmpParmValue=" + URLEncoder.encode(intfName, StandardCharsets.UTF_8.name())); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("URLEncoder.encode complained about UTF-8. " + e, e); } resources.add(resource); } return resources; }
if (ipInterfaces.size() > 0) { int id = ipInterfaces.iterator().next().getId(); resource.setLink("element/interface.jsp?ipinterfaceid=" + id); } else { int ifIndex = snmpInterface.getIfIndex(); if(ifIndex > -1) { resource.setLink("element/snmpinterface.jsp?node=" + node.getNodeId() + "&ifindex=" + ifIndex);
private static OnmsResource checkLabelForQuotes(OnmsResource childResource) { String lbl = Util.convertToJsSafeString(childResource.getLabel()); OnmsResource resource = new OnmsResource(childResource.getName(), lbl, childResource.getResourceType(), childResource.getAttributes(), childResource.getPath()); resource.setParent(childResource.getParent()); resource.setEntity(childResource.getEntity()); resource.setLink(childResource.getLink()); return resource; }
private static OnmsResource checkLabelForQuotes(OnmsResource childResource) { String lbl = Util.convertToJsSafeString(childResource.getLabel()); OnmsResource resource = new OnmsResource(childResource.getName(), lbl, childResource.getResourceType(), childResource.getAttributes(), childResource.getPath()); resource.setParent(childResource.getParent()); resource.setEntity(childResource.getEntity()); resource.setLink(childResource.getLink()); return resource; }
/** * Checks a resource label for quotes. * * @param childResource the child resource to check * @return the resource */ private OnmsResource checkLabelForQuotes(OnmsResource childResource) { String lbl = Util.convertToJsSafeString(childResource.getLabel()); OnmsResource resource = new OnmsResource(childResource.getName(), lbl, childResource.getResourceType(), childResource.getAttributes(), childResource.getPath()); resource.setParent(childResource.getParent()); resource.setEntity(childResource.getEntity()); resource.setLink(childResource.getLink()); return resource; }
/** * Checks a label for quotes and returns a safe resource instance. * * @param childResource the resource to check * @return a new constructed resource instance */ private static OnmsResource checkLabelForQuotes(OnmsResource childResource) { String lbl = Util.convertToJsSafeString(childResource.getLabel()); OnmsResource resource = new OnmsResource(childResource.getName(), lbl, childResource.getResourceType(), childResource.getAttributes(), childResource.getPath()); resource.setParent(childResource.getParent()); resource.setEntity(childResource.getEntity()); resource.setLink(childResource.getLink()); return resource; } }
/** * Checks a resource label for quotes. * * @param childResource the child resource to check * @return the resource */ private OnmsResource checkLabelForQuotes(OnmsResource childResource) { String lbl = Util.convertToJsSafeString(childResource.getLabel()); OnmsResource resource = new OnmsResource(childResource.getName(), lbl, childResource.getResourceType(), childResource.getAttributes(), childResource.getPath()); resource.setParent(childResource.getParent()); resource.setEntity(childResource.getEntity()); resource.setLink(childResource.getLink()); return resource; }
/** * Checks a label for quotes and returns a safe resource instance. * * @param childResource the resource to check * @return a new constructed resource instance */ private static OnmsResource checkLabelForQuotes(OnmsResource childResource) { String lbl = Util.convertToJsSafeString(childResource.getLabel()); OnmsResource resource = new OnmsResource(childResource.getName(), lbl, childResource.getResourceType(), childResource.getAttributes(), childResource.getPath()); resource.setParent(childResource.getParent()); resource.setEntity(childResource.getEntity()); resource.setLink(childResource.getLink()); return resource; } }