diff --git a/README.md b/README.md index c2f7ad7..761f2c9 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ SolaceMessagingInfo solacemessaging = (SolaceMessagingInfo) cloud.getServiceInfo // Setting up the JCSMP Connection final JCSMPProperties props = new JCSMPProperties(); -props.setProperty(JCSMPProperties.HOST, solacemessaging.getSmfUri()); +props.setProperty(JCSMPProperties.HOST, solacemessaging.getSmfHost()); props.setProperty(JCSMPProperties.VPN_NAME, solacemessaging.getMsgVpnName()); props.setProperty(JCSMPProperties.USERNAME, solacemessaging.getClientUsername()); props.setProperty(JCSMPProperties.PASSWORD, solacemessaging.getClientPassword()); diff --git a/pom.xml b/pom.xml index 83e0d4c..bc607a6 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ https://github.com/SolaceLabs/sl-spring-cloud-connectors.git scm:git:git://github.com/SolaceLabs/sl-spring-cloud-connectors.git scm:git:git@github.com:SolaceLabs/sl-spring-cloud-connectors.git - 0.1.0 + HEAD diff --git a/src/main/java/com/solace/labs/spring/cloud/cloudfoundry/SolaceMessagingInfoCreator.java b/src/main/java/com/solace/labs/spring/cloud/cloudfoundry/SolaceMessagingInfoCreator.java index 6f6ad66..a60d44a 100644 --- a/src/main/java/com/solace/labs/spring/cloud/cloudfoundry/SolaceMessagingInfoCreator.java +++ b/src/main/java/com/solace/labs/spring/cloud/cloudfoundry/SolaceMessagingInfoCreator.java @@ -44,12 +44,12 @@ public SolaceMessagingInfo createServiceInfo(Map serviceData) { String clientUsername = null; String clientPassword = null; String msgVpnName = null; - String smfUri = null; - String smfTlsUri = null; - String smfZipUri = null; + String smfHost = null; + String smfTlsHost = null; + String smfZipHost = null; String webMessagingUri = null; - String jmsUri = null; - String jmsTlsUri = null; + String jmsJndiUri = null; + String jmsJndiTlsUri = null; List restUris = null; List restTlsUris = null; List mqttUris = null; @@ -84,23 +84,23 @@ public SolaceMessagingInfo createServiceInfo(Map serviceData) { case "msgVpnName": msgVpnName = (String) value; break; - case "smfUri": - smfUri = (String) value; + case "smfHost": + smfHost = (String) value; break; - case "smfTlsUri": - smfTlsUri = (String) value; + case "smfTlsHost": + smfTlsHost = (String) value; break; - case "smfZipUri": - smfZipUri = (String) value; + case "smfZipHost": + smfZipHost = (String) value; break; case "webMessagingUri": webMessagingUri = (String) value; break; - case "jmsUri": - jmsUri = (String) value; + case "jmsJndiUri": + jmsJndiUri = (String) value; break; - case "jmsTlsUri": - jmsTlsUri = (String) value; + case "jmsJndiTlsUri": + jmsJndiTlsUri = (String) value; break; case "managementUsername": managementUsername = (String) value; @@ -136,7 +136,7 @@ public SolaceMessagingInfo createServiceInfo(Map serviceData) { } SolaceMessagingInfo solMessagingInfo = new SolaceMessagingInfo(id, clientUsername, clientPassword, msgVpnName, - smfUri, smfTlsUri, smfZipUri, webMessagingUri, jmsUri, jmsTlsUri, restUris, restTlsUris, mqttUris, + smfHost, smfTlsHost, smfZipHost, webMessagingUri, jmsJndiUri, jmsJndiTlsUri, restUris, restTlsUris, mqttUris, mqttTlsUris, mqttWsUris, mqttWssUris, managementHttpUris, managementHttpsUris, managementPassword, managementUsername); diff --git a/src/main/java/com/solace/labs/spring/cloud/core/SolaceMessagingInfo.java b/src/main/java/com/solace/labs/spring/cloud/core/SolaceMessagingInfo.java index 87910a0..d5b7767 100644 --- a/src/main/java/com/solace/labs/spring/cloud/core/SolaceMessagingInfo.java +++ b/src/main/java/com/solace/labs/spring/cloud/core/SolaceMessagingInfo.java @@ -39,12 +39,12 @@ public class SolaceMessagingInfo extends BaseServiceInfo { private String clientUsername; private String clientPassword; private String msgVpnName; - private String smfUri; - private String smfTlsUri; - private String smfZipUri; + private String smfHost; + private String smfTlsHost; + private String smfZipHost; private String webMessagingUri; - private String jmsUri; - private String jmsTlsUri; + private String jmsJndiUri; + private String jmsJndiTlsUri; private List restUris; private List restTlsUris; private List mqttUris; @@ -62,7 +62,7 @@ public SolaceMessagingInfo() { } public SolaceMessagingInfo(String id, String clientUsername, String clientPassword, String msgVpnName, - String smfUri, String smfTlsUri, String smfZipUri, String webMessagingUri, String jmsUri, String jmsTlsUri, + String smfHost, String smfTlsHost, String smfZipHost, String webMessagingUri, String jmsJndiUri, String jmsJndiTlsUri, List restUris, List restTlsUris, List mqttUris, List mqttTlsUris, List mqttWsUris, List mqttWssUris, List managementHttpUris, List managementHttpsUris, String managementPassword, String managementUsername) { @@ -70,12 +70,12 @@ public SolaceMessagingInfo(String id, String clientUsername, String clientPasswo this.clientUsername = clientUsername; this.clientPassword = clientPassword; this.msgVpnName = msgVpnName; - this.smfUri = smfUri; - this.smfTlsUri = smfTlsUri; - this.smfZipUri = smfZipUri; + this.smfHost = smfHost; + this.smfTlsHost = smfTlsHost; + this.smfZipHost = smfZipHost; this.webMessagingUri = webMessagingUri; - this.jmsUri = jmsUri; - this.jmsTlsUri = jmsTlsUri; + this.jmsJndiUri = jmsJndiUri; + this.jmsJndiTlsUri = jmsJndiTlsUri; this.restUris = restUris; this.restTlsUris = restTlsUris; this.mqttUris = mqttUris; @@ -115,27 +115,27 @@ public String getMsgVpnName() { } /** - * @return the smfUri + * @return the smfHost */ @ServiceProperty - public String getSmfUri() { - return smfUri; + public String getSmfHost() { + return smfHost; } /** - * @return the smfTlsUri + * @return the smfTlsHost */ @ServiceProperty - public String getSmfTlsUri() { - return smfTlsUri; + public String getSmfTlsHost() { + return smfTlsHost; } /** - * @return the smfZipUri + * @return the smfZipHost */ @ServiceProperty - public String getSmfZipUri() { - return smfZipUri; + public String getSmfZipHost() { + return smfZipHost; } /** @@ -147,19 +147,19 @@ public String getWebMessagingUri() { } /** - * @return the jmsUri + * @return the jmsJndiUri */ @ServiceProperty - public String getJmsUri() { - return jmsUri; + public String getJmsJndiUri() { + return jmsJndiUri; } /** - * @return the jmsTlsUri + * @return the jmsJndiTlsUri */ @ServiceProperty - public String getJmsTlsUri() { - return jmsTlsUri; + public String getJmsJndiTlsUri() { + return jmsJndiTlsUri; } /** @@ -264,8 +264,8 @@ public int hashCode() { result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((clientPassword == null) ? 0 : clientPassword.hashCode()); result = prime * result + ((clientUsername == null) ? 0 : clientUsername.hashCode()); - result = prime * result + ((jmsTlsUri == null) ? 0 : jmsTlsUri.hashCode()); - result = prime * result + ((jmsUri == null) ? 0 : jmsUri.hashCode()); + result = prime * result + ((jmsJndiTlsUri == null) ? 0 : jmsJndiTlsUri.hashCode()); + result = prime * result + ((jmsJndiUri == null) ? 0 : jmsJndiUri.hashCode()); result = prime * result + ((managementHttpUris == null) ? 0 : managementHttpUris.hashCode()); result = prime * result + ((managementHttpsUris == null) ? 0 : managementHttpsUris.hashCode()); result = prime * result + ((managementPassword == null) ? 0 : managementPassword.hashCode()); @@ -277,9 +277,9 @@ public int hashCode() { result = prime * result + ((msgVpnName == null) ? 0 : msgVpnName.hashCode()); result = prime * result + ((restTlsUris == null) ? 0 : restTlsUris.hashCode()); result = prime * result + ((restUris == null) ? 0 : restUris.hashCode()); - result = prime * result + ((smfTlsUri == null) ? 0 : smfTlsUri.hashCode()); - result = prime * result + ((smfUri == null) ? 0 : smfUri.hashCode()); - result = prime * result + ((smfZipUri == null) ? 0 : smfZipUri.hashCode()); + result = prime * result + ((smfTlsHost == null) ? 0 : smfTlsHost.hashCode()); + result = prime * result + ((smfHost == null) ? 0 : smfHost.hashCode()); + result = prime * result + ((smfZipHost == null) ? 0 : smfZipHost.hashCode()); result = prime * result + ((webMessagingUri == null) ? 0 : webMessagingUri.hashCode()); return result; } @@ -313,15 +313,15 @@ public boolean equals(Object obj) { return false; } else if (!clientUsername.equals(other.clientUsername)) return false; - if (jmsTlsUri == null) { - if (other.jmsTlsUri != null) + if (jmsJndiTlsUri == null) { + if (other.jmsJndiTlsUri != null) return false; - } else if (!jmsTlsUri.equals(other.jmsTlsUri)) + } else if (!jmsJndiTlsUri.equals(other.jmsJndiTlsUri)) return false; - if (jmsUri == null) { - if (other.jmsUri != null) + if (jmsJndiUri == null) { + if (other.jmsJndiUri != null) return false; - } else if (!jmsUri.equals(other.jmsUri)) + } else if (!jmsJndiUri.equals(other.jmsJndiUri)) return false; if (managementHttpUris == null) { if (other.managementHttpUris != null) @@ -378,20 +378,20 @@ public boolean equals(Object obj) { return false; } else if (!restUris.equals(other.restUris)) return false; - if (smfTlsUri == null) { - if (other.smfTlsUri != null) + if (smfTlsHost == null) { + if (other.smfTlsHost != null) return false; - } else if (!smfTlsUri.equals(other.smfTlsUri)) + } else if (!smfTlsHost.equals(other.smfTlsHost)) return false; - if (smfUri == null) { - if (other.smfUri != null) + if (smfHost == null) { + if (other.smfHost != null) return false; - } else if (!smfUri.equals(other.smfUri)) + } else if (!smfHost.equals(other.smfHost)) return false; - if (smfZipUri == null) { - if (other.smfZipUri != null) + if (smfZipHost == null) { + if (other.smfZipHost != null) return false; - } else if (!smfZipUri.equals(other.smfZipUri)) + } else if (!smfZipHost.equals(other.smfZipHost)) return false; if (webMessagingUri == null) { if (other.webMessagingUri != null) diff --git a/src/test/java/com/solace/labs/spring/cloud/cloudfoundry/SolaceMessagingServiceInfoCreatorTest.java b/src/test/java/com/solace/labs/spring/cloud/cloudfoundry/SolaceMessagingServiceInfoCreatorTest.java index 7251961..bb14dac 100644 --- a/src/test/java/com/solace/labs/spring/cloud/cloudfoundry/SolaceMessagingServiceInfoCreatorTest.java +++ b/src/test/java/com/solace/labs/spring/cloud/cloudfoundry/SolaceMessagingServiceInfoCreatorTest.java @@ -92,7 +92,7 @@ public void missingKeyValueTest() { @SuppressWarnings("unchecked") Map exCred = (Map) exVcapServices.get("credentials"); - exCred.remove("smfUri"); + exCred.remove("smfHost"); SolaceMessagingInfoCreator smic = new SolaceMessagingInfoCreator(); @@ -102,8 +102,8 @@ public void missingKeyValueTest() { SolaceMessagingInfo smi = smic.createServiceInfo(exVcapServices); // Validate smf is null. Others are not - assertNull(smi.getSmfUri()); - assertEquals("tcps://192.168.1.50:7003", smi.getSmfTlsUri()); + assertNull(smi.getSmfHost()); + assertEquals("tcps://192.168.1.50:7003", smi.getSmfTlsHost()); } @@ -150,12 +150,12 @@ private Map createVcapMap() { exCred.put("clientUsername", "sample-client-username"); exCred.put("clientPassword", "sample-client-password"); exCred.put("msgVpnName", "sample-msg-vpn"); - exCred.put("smfUri", "tcp://192.168.1.50:7000"); - exCred.put("smfTlsUri", "tcps://192.168.1.50:7003"); - exCred.put("smfZipUri", "tcp://192.168.1.50:7001"); + exCred.put("smfHost", "tcp://192.168.1.50:7000"); + exCred.put("smfTlsHost", "tcps://192.168.1.50:7003"); + exCred.put("smfZipHost", "tcp://192.168.1.50:7001"); exCred.put("webMessagingUri", "http://192.168.1.50:80"); - exCred.put("jmsUri", "smf://192.168.1.50:7000"); - exCred.put("jmsTlsUri", "smfs://192.168.1.50:7003"); + exCred.put("jmsJndiUri", "smf://192.168.1.50:7000"); + exCred.put("jmsJndiTlsUri", "smfs://192.168.1.50:7003"); exCred.put("mqttUris", Arrays.asList("tcp://192.168.1.50:7020")); exCred.put("mqttTlsUris", Arrays.asList("ssl://192.168.1.50:7021")); exCred.put("mqttWsUris", Arrays.asList("ws://192.168.1.50:7022")); @@ -187,9 +187,9 @@ private void validateExampleSmi(SolaceMessagingInfo smi) { assertEquals("sample-msg-vpn", smi.getMsgVpnName()); // Check SMF - assertEquals("tcp://192.168.1.50:7000", smi.getSmfUri()); - assertEquals("tcps://192.168.1.50:7003", smi.getSmfTlsUri()); - assertEquals("tcp://192.168.1.50:7001", smi.getSmfZipUri()); + assertEquals("tcp://192.168.1.50:7000", smi.getSmfHost()); + assertEquals("tcps://192.168.1.50:7003", smi.getSmfTlsHost()); + assertEquals("tcp://192.168.1.50:7001", smi.getSmfZipHost()); // Check Web Messsaging assertEquals("http://192.168.1.50:80", smi.getWebMessagingUri()); diff --git a/src/test/java/com/solace/labs/spring/cloud/core/SolaceMessagingServiceInfoTest.java b/src/test/java/com/solace/labs/spring/cloud/core/SolaceMessagingServiceInfoTest.java index 459f9bc..73eb4f0 100644 --- a/src/test/java/com/solace/labs/spring/cloud/core/SolaceMessagingServiceInfoTest.java +++ b/src/test/java/com/solace/labs/spring/cloud/core/SolaceMessagingServiceInfoTest.java @@ -40,12 +40,12 @@ public void fullSetGetCredentialsTest() throws IllegalAccessException, Invocatio String clientUsername = "sample-client-username"; String clientPassword = "sample-client-password"; String msgVpnName = "sample-msg-vpn"; - String smfUri = "tcp://192.168.1.50:7000"; - String smfTlsUri = "tcps://192.168.1.50:7003"; - String smfZipUri = "tcp://192.168.1.50:7001"; + String smfHost = "tcp://192.168.1.50:7000"; + String smfTlsHost = "tcps://192.168.1.50:7003"; + String smfZipHost = "tcp://192.168.1.50:7001"; String webMessagingUri = "http://192.168.1.50:80"; - String jmsUri = "smf://192.168.1.50:7000"; - String jmsTlsUri = "smfs://192.168.1.50:7003"; + String jmsJndiUri = "smf://192.168.1.50:7000"; + String jmsJndiTlsUri = "smfs://192.168.1.50:7003"; List mqttUris = Arrays.asList("tcp://192.168.1.50:7020"); List mqttTlsUris = Arrays.asList("ssl://192.168.1.50:7021"); List mqttWsUris = Arrays.asList("ws://192.168.1.50:7022"); @@ -57,8 +57,8 @@ public void fullSetGetCredentialsTest() throws IllegalAccessException, Invocatio String managementUsername = "sample-mgmt-username"; String managementPassword = "sample-mgmt-password"; - SolaceMessagingInfo smi = new SolaceMessagingInfo(id, clientUsername, clientPassword, msgVpnName, smfUri, - smfTlsUri, smfZipUri, webMessagingUri, jmsUri, jmsTlsUri, restUris, restTlsUris, mqttUris, mqttTlsUris, + SolaceMessagingInfo smi = new SolaceMessagingInfo(id, clientUsername, clientPassword, msgVpnName, smfHost, + smfTlsHost, smfZipHost, webMessagingUri, jmsJndiUri, jmsJndiTlsUri, restUris, restTlsUris, mqttUris, mqttTlsUris, mqttWsUris, mqttWssUris, managementHttpUris, managementHttpsUris, managementPassword, managementUsername); @@ -69,16 +69,16 @@ public void fullSetGetCredentialsTest() throws IllegalAccessException, Invocatio assertEquals(msgVpnName, smi.getMsgVpnName()); // Check SMF - assertEquals(smfUri, smi.getSmfUri()); - assertEquals(smfTlsUri, smi.getSmfTlsUri()); - assertEquals(smfZipUri, smi.getSmfZipUri()); + assertEquals(smfHost, smi.getSmfHost()); + assertEquals(smfTlsHost, smi.getSmfTlsHost()); + assertEquals(smfZipHost, smi.getSmfZipHost()); // Check Web Messsaging assertEquals(webMessagingUri, smi.getWebMessagingUri()); // Check JMS - assertEquals(jmsUri, smi.getJmsUri()); - assertEquals(jmsTlsUri, smi.getJmsTlsUri()); + assertEquals(jmsJndiUri, smi.getJmsJndiUri()); + assertEquals(jmsJndiTlsUri, smi.getJmsJndiTlsUri()); // Check MQTT assertThat(smi.getMqttUris(), is(mqttUris));