private void modifyRequisition() throws Exception { Requisition r = JaxbUtils.unmarshal(Requisition.class, getRequisitionFile()); Assert.assertNotNull(r); r.getNode("4243").setNodeLabel("apknd_2"); // Modify existing node RequisitionNode n = new RequisitionNode(); n.setForeignId("R2D2"); n.setNodeLabel("utility-robot"); n.getCategories().add(new RequisitionCategory("StarWars")); n.getCategories().add(new RequisitionCategory("Rebels")); r.getNodes().add(n); // Add a new node JaxbUtils.marshal(r, new FileWriter(getRequisitionFile())); Thread.sleep(2000); // Give enough time to watcher's thread to cache the requisition }
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; } }
requisitionNode.setNodeLabel(managedEntity.getName());
requisitionNode.setNodeLabel(managedEntity.getName());
break; n.setNodeLabel(nodeLabel);
rn.setBuilding(m_foreignSource); rn.setForeignId(node.getForeignId()); rn.setNodeLabel(node.getLabel()); rn.setLocation(locationName); r.putNode(rn);
rn.setBuilding(m_foreignSource); rn.setForeignId(node.getForeignId()); rn.setNodeLabel(node.getLabel()); rn.setLocation(locationName); r.putNode(rn);
requisitionNode.setNodeLabel(minion.getId()); requisitionNode.setForeignId(minion.getLabel() != null ? minion.getLabel()
foreignId1.setNodeLabel("foreign ID 1"); foreignId2.setNodeLabel("foreign ID 2"); duplicateId.setNodeLabel("foreign ID 1 (duplicate)");