improving publishable address policy interface, so we can get the actual publish URI

This commit is contained in:
Dejan Bosanac 2013-09-03 18:04:07 +02:00
parent 8320e66b5d
commit a3a22efb25
2 changed files with 9 additions and 2 deletions

View File

@ -60,7 +60,7 @@ public class PublishedAddressPolicy {
* @return a string URI address that a client can use to connect to this Transport.
* @throws Exception
*/
public String getPublishableConnectString(TransportConnector connector) throws Exception {
public URI getPublishableConnectURI(TransportConnector connector) throws Exception {
URI connectorURI = connector.getConnectUri();
@ -79,8 +79,11 @@ public class PublishedAddressPolicy {
String fragment = getPublishedFragmentValue(connectorURI.getFragment());
URI publishedURI = new URI(scheme, userInfo, host, port, path, getClusterClientUriQuery(), fragment);
return publishedURI;
}
return publishedURI.toString();
public String getPublishableConnectString(TransportConnector connector) throws Exception {
return getPublishableConnectURI(connector).toString();
}
/**

View File

@ -262,6 +262,10 @@ public class TransportConnector implements Connector, BrokerServiceAware {
return publishableConnectString;
}
public URI getPublishableConnectURI() throws Exception {
return publishedAddressPolicy.getPublishableConnectURI(this);
}
@Override
public void stop() throws Exception {
ServiceStopper ss = new ServiceStopper();