@Test public void testApplyReplicationTokenChanges() throws Exception { System.out.println("applyReplicationTokenChanges"); InputStream fis = getClass().getClassLoader().getResourceAsStream("juddi_install_data/root_replicationConfiguration.xml"); ReplicationConfiguration replicationCfg = (ReplicationConfiguration) XmlUtils.unmarshal(fis, ReplicationConfiguration.class); Properties props = new Properties(); props.put(Property.JUDDI_NODE_ID, "uddi:a_custom_node"); props.put(Property.JUDDI_BASE_URL, "http: props.put(Property.JUDDI_BASE_URL_SECURE, "https: Configuration config = new MapConfiguration(props); String thisnode = "uddi:a_custom_node"; ReplicationConfiguration result = Install.applyReplicationTokenChanges(replicationCfg, config, thisnode); StringWriter sw = new StringWriter(); JAXB.marshal(result, sw); Assert.assertFalse(sw.toString().contains("${juddi.nodeId}")); Assert.assertFalse(sw.toString().contains("${juddi.server.baseurlsecure}")); Assert.assertFalse(sw.toString().contains("${juddi.server.baseurl}")); }
public static org.uddi.repl_v3.ReplicationConfiguration applyReplicationTokenChanges(org.uddi.repl_v3.ReplicationConfiguration replicationCfg, Configuration config, String thisnode) { log.info("replacing tokens on repl config"); if (replicationCfg == null) { return null; } for (Operator op : replicationCfg.getOperator()) { op.setOperatorNodeID(op.getOperatorNodeID().replace("${juddi.nodeId}", thisnode)); op.setSoapReplicationURL(op.getSoapReplicationURL().replace("${juddi.server.baseurlsecure}", config.getString("juddi.server.baseurlsecure"))); op.setSoapReplicationURL(op.getSoapReplicationURL().replace("${juddi.server.baseurl}", config.getString("juddi.server.baseurl"))); } if (replicationCfg.getCommunicationGraph() != null) { for (int i = 0; i < replicationCfg.getCommunicationGraph().getNode().size(); i++) { replicationCfg.getCommunicationGraph().getNode().set(i, replicationCfg.getCommunicationGraph().getNode().get(i).replace("${juddi.nodeId}", thisnode)); } for (int i = 0; i < replicationCfg.getCommunicationGraph().getEdge().size(); i++) { replicationCfg.getCommunicationGraph().getEdge().get(i).setMessageSender(replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageSender().replace("${juddi.nodeId}", thisnode)); replicationCfg.getCommunicationGraph().getEdge().get(i).setMessageReceiver(replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiver().replace("${juddi.nodeId}", thisnode)); for (int k = 0; k < replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().size(); k++) { replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().set(k, replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().get(k).replace("${juddi.nodeId}", thisnode)); } } } for (Operator op : replicationCfg.getOperator()) { op.setOperatorNodeID(op.getOperatorNodeID().replace("${juddi.nodeId}", thisnode)); } log.info("replacing tokens on repl config, done"); return replicationCfg; }
Install { public static org.uddi.repl_v3.ReplicationConfiguration applyReplicationTokenChanges(org.uddi.repl_v3.ReplicationConfiguration replicationCfg, Configuration config, String thisnode) { log.info("replacing tokens on repl config"); if (replicationCfg == null) { return null; } for (Operator op : replicationCfg.getOperator()) { op.setOperatorNodeID(op.getOperatorNodeID().replace("${juddi.nodeId}", thisnode)); op.setSoapReplicationURL(op.getSoapReplicationURL().replace("${juddi.server.baseurlsecure}", config.getString("juddi.server.baseurlsecure"))); op.setSoapReplicationURL(op.getSoapReplicationURL().replace("${juddi.server.baseurl}", config.getString("juddi.server.baseurl"))); } if (replicationCfg.getCommunicationGraph() != null) { for (int i = 0; i < replicationCfg.getCommunicationGraph().getNode().size(); i++) { replicationCfg.getCommunicationGraph().getNode().set(i, replicationCfg.getCommunicationGraph().getNode().get(i).replace("${juddi.nodeId}", thisnode)); } for (int i = 0; i < replicationCfg.getCommunicationGraph().getEdge().size(); i++) { replicationCfg.getCommunicationGraph().getEdge().get(i).setMessageSender(replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageSender().replace("${juddi.nodeId}", thisnode)); replicationCfg.getCommunicationGraph().getEdge().get(i).setMessageReceiver(replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiver().replace("${juddi.nodeId}", thisnode)); for (int k = 0; k < replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().size(); k++) { replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().set(k, replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().get(k).replace("${juddi.nodeId}", thisnode)); } } } for (Operator op : replicationCfg.getOperator()) { op.setOperatorNodeID(op.getOperatorNodeID().replace("${juddi.nodeId}", thisnode)); } log.info("replacing tokens on repl config, done"); return replicationCfg; } }
Install { public static org.uddi.repl_v3.ReplicationConfiguration applyReplicationTokenChanges(org.uddi.repl_v3.ReplicationConfiguration replicationCfg, Configuration config, String thisnode) { log.info("replacing tokens on repl config"); if (replicationCfg == null) { return null; } for (Operator op : replicationCfg.getOperator()) { op.setOperatorNodeID(op.getOperatorNodeID().replace("${juddi.nodeId}", thisnode)); op.setSoapReplicationURL(op.getSoapReplicationURL().replace("${juddi.server.baseurlsecure}", config.getString("juddi.server.baseurlsecure"))); op.setSoapReplicationURL(op.getSoapReplicationURL().replace("${juddi.server.baseurl}", config.getString("juddi.server.baseurl"))); } if (replicationCfg.getCommunicationGraph() != null) { for (int i = 0; i < replicationCfg.getCommunicationGraph().getNode().size(); i++) { replicationCfg.getCommunicationGraph().getNode().set(i, replicationCfg.getCommunicationGraph().getNode().get(i).replace("${juddi.nodeId}", thisnode)); } for (int i = 0; i < replicationCfg.getCommunicationGraph().getEdge().size(); i++) { replicationCfg.getCommunicationGraph().getEdge().get(i).setMessageSender(replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageSender().replace("${juddi.nodeId}", thisnode)); replicationCfg.getCommunicationGraph().getEdge().get(i).setMessageReceiver(replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiver().replace("${juddi.nodeId}", thisnode)); for (int k = 0; k < replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().size(); k++) { replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().set(k, replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().get(k).replace("${juddi.nodeId}", thisnode)); } } } for (Operator op : replicationCfg.getOperator()) { op.setOperatorNodeID(op.getOperatorNodeID().replace("${juddi.nodeId}", thisnode)); } log.info("replacing tokens on repl config, done"); return replicationCfg; }  }
Install { public static org.uddi.repl_v3.ReplicationConfiguration applyReplicationTokenChanges(org.uddi.repl_v3.ReplicationConfiguration replicationCfg, Configuration config, String thisnode) { log.info("replacing tokens on repl config"); if (replicationCfg == null) { return null; } for (Operator op : replicationCfg.getOperator()) { op.setOperatorNodeID(op.getOperatorNodeID().replace("${juddi.nodeId}", thisnode)); op.setSoapReplicationURL(op.getSoapReplicationURL().replace("${juddi.server.baseurlsecure}", config.getString("juddi.server.baseurlsecure"))); op.setSoapReplicationURL(op.getSoapReplicationURL().replace("${juddi.server.baseurl}", config.getString("juddi.server.baseurl"))); } if (replicationCfg.getCommunicationGraph() != null) { for (int i = 0; i < replicationCfg.getCommunicationGraph().getNode().size(); i++) { replicationCfg.getCommunicationGraph().getNode().set(i, replicationCfg.getCommunicationGraph().getNode().get(i).replace("${juddi.nodeId}", thisnode)); } for (int i = 0; i < replicationCfg.getCommunicationGraph().getEdge().size(); i++) { replicationCfg.getCommunicationGraph().getEdge().get(i).setMessageSender(replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageSender().replace("${juddi.nodeId}", thisnode)); replicationCfg.getCommunicationGraph().getEdge().get(i).setMessageReceiver(replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiver().replace("${juddi.nodeId}", thisnode)); for (int k = 0; k < replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().size(); k++) { replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().set(k, replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().get(k).replace("${juddi.nodeId}", thisnode)); } } } for (Operator op : replicationCfg.getOperator()) { op.setOperatorNodeID(op.getOperatorNodeID().replace("${juddi.nodeId}", thisnode)); } log.info("replacing tokens on repl config, done"); return replicationCfg; }  static org.uddi.api_v3.BusinessEntity getNodeBusinessEntity(String businessKey); static void installSaveTModel(EntityManager em, String fileName, UddiEntityPublisher publisher, String nodeId, Configuration config); static UddiEntityPublisher installPublisher(EntityManager em, String fileName, Configuration config); static org.uddi.repl_v3.ReplicationConfiguration applyReplicationTokenChanges(org.uddi.repl_v3.ReplicationConfiguration replicationCfg, Configuration config, String thisnode); }
Install { public static org.uddi.repl_v3.ReplicationConfiguration applyReplicationTokenChanges(org.uddi.repl_v3.ReplicationConfiguration replicationCfg, Configuration config, String thisnode) { log.info("replacing tokens on repl config"); if (replicationCfg == null) { return null; } for (Operator op : replicationCfg.getOperator()) { op.setOperatorNodeID(op.getOperatorNodeID().replace("${juddi.nodeId}", thisnode)); op.setSoapReplicationURL(op.getSoapReplicationURL().replace("${juddi.server.baseurlsecure}", config.getString("juddi.server.baseurlsecure"))); op.setSoapReplicationURL(op.getSoapReplicationURL().replace("${juddi.server.baseurl}", config.getString("juddi.server.baseurl"))); } if (replicationCfg.getCommunicationGraph() != null) { for (int i = 0; i < replicationCfg.getCommunicationGraph().getNode().size(); i++) { replicationCfg.getCommunicationGraph().getNode().set(i, replicationCfg.getCommunicationGraph().getNode().get(i).replace("${juddi.nodeId}", thisnode)); } for (int i = 0; i < replicationCfg.getCommunicationGraph().getEdge().size(); i++) { replicationCfg.getCommunicationGraph().getEdge().get(i).setMessageSender(replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageSender().replace("${juddi.nodeId}", thisnode)); replicationCfg.getCommunicationGraph().getEdge().get(i).setMessageReceiver(replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiver().replace("${juddi.nodeId}", thisnode)); for (int k = 0; k < replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().size(); k++) { replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().set(k, replicationCfg.getCommunicationGraph().getEdge().get(i).getMessageReceiverAlternate().get(k).replace("${juddi.nodeId}", thisnode)); } } } for (Operator op : replicationCfg.getOperator()) { op.setOperatorNodeID(op.getOperatorNodeID().replace("${juddi.nodeId}", thisnode)); } log.info("replacing tokens on repl config, done"); return replicationCfg; }  static org.uddi.api_v3.BusinessEntity getNodeBusinessEntity(String businessKey); static void installSaveTModel(EntityManager em, String fileName, UddiEntityPublisher publisher, String nodeId, Configuration config); static UddiEntityPublisher installPublisher(EntityManager em, String fileName, Configuration config); static org.uddi.repl_v3.ReplicationConfiguration applyReplicationTokenChanges(org.uddi.repl_v3.ReplicationConfiguration replicationCfg, Configuration config, String thisnode); static final String FILE_BUSINESSENTITY; static final String FILE_PUBLISHER; static final String FILE_TMODELKEYGEN; static final String FILE_TMODELS; static final String FILE_PERSISTENCE; static final String JUDDI_INSTALL_DATA_DIR; static final String JUDDI_CUSTOM_INSTALL_DATA_DIR; static final String FILE_REPLICATION_CONFIG; static final Log log; }