private RequisitionInterface createInterface(final String ipAddr, final PrimaryType snmpPrimary) { final RequisitionInterface iface = new RequisitionInterface(); iface.setIpAddr(ipAddr); iface.setStatus(1); iface.setSnmpPrimary(snmpPrimary); return iface; }
protected RequisitionNode createNode(final String id) { RequisitionNode node = new RequisitionNode(); node.setForeignId(id); node.setNodeLabel("node " + id); RequisitionInterface iface = new RequisitionInterface(); iface.setIpAddr("172.16.0." + id); node.putInterface(iface); return node; }
/** trimWhitespace Removes leading and trailing whitespace from fields that should not have any */ private void trimWhitespace(Requisition req) { for (RequisitionNode node : req.getNodes()) { if (node.getForeignId() != null) { node.setForeignId(node.getForeignId().trim()); } if (node.getParentForeignSource() != null) { node.setParentForeignSource(node.getParentForeignSource().trim()); } if (node.getParentForeignId() != null) { node.setParentForeignId(node.getParentForeignId().trim()); } for (RequisitionInterface intf : node.getInterfaces()) { if (intf.getIpAddr() != null) { intf.setIpAddr(intf.getIpAddr().trim()); } } } }