private OnmsResource createResource(final String location, final OnmsIpInterface ipInterface, final String ipAddr, final ResourcePath path) { final LazyResourceAttributeLoader loader = new LazyResourceAttributeLoader(m_resourceStorageDao, path); final Set<OnmsAttribute> set = new LazySet<OnmsAttribute>(loader); final OnmsResource resource = new OnmsResource(ipAddr, ipAddr, this, set, path); resource.setEntity(ipInterface); return resource; }
resource.setEntity(snmpInterface); } else { LOG.debug("populateResourceList: snmpInterface is null");
protected OnmsResource createResourceForNode(OnmsNode node) { final ResourcePath path = getResourcePathForNode(node); final LazyChildResourceLoader loader = new LazyChildResourceLoader(m_resourceDao); final String resourceName = node.getForeignSource() != null && node.getForeignId() != null ? String.format("%s:%s", node.getForeignSource(), node.getForeignId()) : Integer.toString(node.getId()); final OnmsResource resource = new OnmsResource(resourceName, node.getLabel(), this, s_emptyAttributeSet, new LazyList<OnmsResource>(loader), path); resource.setEntity(node); loader.setParent(resource); 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; }
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; } }