n.setForeignId(computeHashCode(nodeLabel)); LOG.debug("Generating foreignId from hash of nodelabel {}", nodeLabel); break; case IP_ADDRESS: n.setForeignId(computeHashCode(addr)); LOG.debug("Generating foreignId from hash of ipAddress {}", addr); break; case NODE_LABEL_AND_IP_ADDRESS: n.setForeignId(computeHashCode(nodeLabel + addr)); LOG.debug("Generating foreignId from hash of nodelabel+ipAddress {}{}", nodeLabel, addr); break; default: n.setForeignId(computeHashCode(nodeLabel)); LOG.debug("Default case: Generating foreignId from hash of nodelabel {}", nodeLabel); break;
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.setForeignId(managedEntity.getMOR().getVal());
requisitionNode.setForeignId(managedEntity.getMOR().getVal());
rn.setInterfaces(ric.getObjects()); rn.setBuilding(m_foreignSource); rn.setForeignId(node.getForeignId()); rn.setNodeLabel(node.getLabel()); rn.setLocation(locationName);
rn.setInterfaces(ric.getObjects()); rn.setBuilding(m_foreignSource); rn.setForeignId(node.getForeignId()); rn.setNodeLabel(node.getLabel()); rn.setLocation(locationName);
requisitionNode.setForeignId(minion.getLabel() != null ? minion.getLabel() : minion.getId());
foreignId1.setForeignId("foreignId1"); foreignId1.setNodeLabel("foreign ID 1"); foreignId2.setForeignId("foreignId2"); foreignId2.setNodeLabel("foreign ID 2"); duplicateId.setForeignId("foreignId1"); duplicateId.setNodeLabel("foreign ID 1 (duplicate)");