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 a60d44a..074ebc5 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 @@ -48,6 +48,7 @@ public SolaceMessagingInfo createServiceInfo(Map serviceData) { String smfTlsHost = null; String smfZipHost = null; String webMessagingUri = null; + String webMessagingTlsUri = null; String jmsJndiUri = null; String jmsJndiTlsUri = null; List restUris = null; @@ -96,6 +97,9 @@ public SolaceMessagingInfo createServiceInfo(Map serviceData) { case "webMessagingUri": webMessagingUri = (String) value; break; + case "webMessagingTlsUri": + webMessagingTlsUri = (String) value; + break; case "jmsJndiUri": jmsJndiUri = (String) value; break; @@ -136,7 +140,7 @@ public SolaceMessagingInfo createServiceInfo(Map serviceData) { } SolaceMessagingInfo solMessagingInfo = new SolaceMessagingInfo(id, clientUsername, clientPassword, msgVpnName, - smfHost, smfTlsHost, smfZipHost, webMessagingUri, jmsJndiUri, jmsJndiTlsUri, restUris, restTlsUris, mqttUris, + smfHost, smfTlsHost, smfZipHost, webMessagingUri, webMessagingTlsUri, 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 d5b7767..8ac9537 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 @@ -55,6 +55,7 @@ public class SolaceMessagingInfo extends BaseServiceInfo { private List managementHttpsUris; private String managementPassword; private String managementUsername; + private String webMessagingTlsUri; // Default constructor to enable bean unit testing. public SolaceMessagingInfo() { @@ -62,7 +63,7 @@ public SolaceMessagingInfo() { } public SolaceMessagingInfo(String id, String clientUsername, String clientPassword, String msgVpnName, - String smfHost, String smfTlsHost, String smfZipHost, String webMessagingUri, String jmsJndiUri, String jmsJndiTlsUri, + String smfHost, String smfTlsHost, String smfZipHost, String webMessagingUri,String webMessagingTlsUri, String jmsJndiUri, String jmsJndiTlsUri, List restUris, List restTlsUris, List mqttUris, List mqttTlsUris, List mqttWsUris, List mqttWssUris, List managementHttpUris, List managementHttpsUris, String managementPassword, String managementUsername) { @@ -74,6 +75,7 @@ public SolaceMessagingInfo(String id, String clientUsername, String clientPasswo this.smfTlsHost = smfTlsHost; this.smfZipHost = smfZipHost; this.webMessagingUri = webMessagingUri; + this.webMessagingTlsUri = webMessagingTlsUri; this.jmsJndiUri = jmsJndiUri; this.jmsJndiTlsUri = jmsJndiTlsUri; this.restUris = restUris; @@ -145,6 +147,14 @@ public String getSmfZipHost() { public String getWebMessagingUri() { return webMessagingUri; } + + /** + * @return the webMessagingTlsUri + */ + @ServiceProperty + public String getWebMessagingTlsUri() { + return webMessagingTlsUri; + } /** * @return the jmsJndiUri @@ -281,6 +291,7 @@ public int 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()); + result = prime * result + ((webMessagingTlsUri == null) ? 0 : webMessagingTlsUri.hashCode()); return result; } @@ -398,6 +409,11 @@ public boolean equals(Object obj) { return false; } else if (!webMessagingUri.equals(other.webMessagingUri)) return false; + if (webMessagingTlsUri == null) { + if (other.webMessagingTlsUri != null) + return false; + } else if (!webMessagingTlsUri.equals(other.webMessagingTlsUri)) + return false; return true; } 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 bb14dac..b14ab2c 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 @@ -154,6 +154,7 @@ private Map createVcapMap() { 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("webMessagingTlsUri", "https://192.168.1.50:80"); 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")); 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 73eb4f0..63bd004 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 @@ -44,6 +44,7 @@ public void fullSetGetCredentialsTest() throws IllegalAccessException, Invocatio 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 webMessagingTlsUri = "https://192.168.1.50:80"; 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"); @@ -58,7 +59,7 @@ public void fullSetGetCredentialsTest() throws IllegalAccessException, Invocatio String managementPassword = "sample-mgmt-password"; SolaceMessagingInfo smi = new SolaceMessagingInfo(id, clientUsername, clientPassword, msgVpnName, smfHost, - smfTlsHost, smfZipHost, webMessagingUri, jmsJndiUri, jmsJndiTlsUri, restUris, restTlsUris, mqttUris, mqttTlsUris, + smfTlsHost, smfZipHost, webMessagingUri, webMessagingTlsUri, jmsJndiUri, jmsJndiTlsUri, restUris, restTlsUris, mqttUris, mqttTlsUris, mqttWsUris, mqttWssUris, managementHttpUris, managementHttpsUris, managementPassword, managementUsername);