Class PublishedAddressPolicy

java.lang.Object
org.apache.activemq.broker.PublishedAddressPolicy

public class PublishedAddressPolicy extends Object
Policy object that controls how a TransportConnector publishes the connector's address to the outside world. By default the connector will publish itself using the resolved host name of the bound server socket.
  • Constructor Details

    • PublishedAddressPolicy

      public PublishedAddressPolicy()
  • Method Details

    • getPublishableConnectURI

      public URI getPublishableConnectURI(TransportConnector connector) throws Exception
      Using the supplied TransportConnector this method returns the String that will be used to update clients with this connector's connect address.
      Parameters:
      connector - The TransportConnector whose address is to be published.
      Returns:
      a string URI address that a client can use to connect to this Transport.
      Throws:
      Exception
    • getPublishableConnectString

      public String getPublishableConnectString(TransportConnector connector) throws Exception
      Throws:
      Exception
    • getPublishedHostValue

      protected String getPublishedHostValue(String uriHostEntry) throws UnknownHostException
      Subclasses can override what host value is published by implementing alternate logic for this method.
      Parameters:
      uriHostEntry -
      Returns:
      the value published for the given host.
      Throws:
      UnknownHostException
    • getPublishedPathValue

      protected String getPublishedPathValue(String uriPathEntry)
      Subclasses can override what path value is published by implementing alternate logic for this method. By default this method simply returns what was already set as the Path value in the original URI.
      Parameters:
      uriPathEntry - The original value of the URI path.
      Returns:
      the desired value for the published URI's path.
    • getPublishedFragmentValue

      protected String getPublishedFragmentValue(String uriFragmentEntry)
      Subclasses can override what host value is published by implementing alternate logic for this method. By default this method simply returns what was already set as the Fragment value in the original URI.
      Parameters:
      uriFragmentEntry - The original value of the URI Fragment.
      Returns:
      the desired value for the published URI's Fragment.
    • getPublishedUserInfoValue

      protected String getPublishedUserInfoValue(String uriUserInfoEntry)
      Subclasses can override what user info value is published by implementing alternate logic for this method. By default this method simply returns what was already set as the UserInfo value in the original URI.
      Parameters:
      uriUserInfoEntry - The original value of the URI user info.
      Returns:
      the desired value for the published URI's user info.
    • getClusterClientUriQuery

      public String getClusterClientUriQuery()
      Gets the URI query that's configured on the published URI that's sent to client's when the cluster info is updated.
      Returns:
      the clusterClientUriQuery
    • setClusterClientUriQuery

      public void setClusterClientUriQuery(String clusterClientUriQuery)
      Sets the URI query that's configured on the published URI that's sent to client's when the cluster info is updated.
      Parameters:
      clusterClientUriQuery - the clusterClientUriQuery to set
    • getPublishedHostStrategy

      public PublishedAddressPolicy.PublishedHostStrategy getPublishedHostStrategy()
      Returns:
      the publishedHostStrategy
    • setPublishedHostStrategy

      public void setPublishedHostStrategy(PublishedAddressPolicy.PublishedHostStrategy strategy)
      Parameters:
      strategy - the publishedHostStrategy to set
    • setPublishedHostStrategy

      public void setPublishedHostStrategy(String strategy)
      Parameters:
      strategy - the publishedHostStrategy to set
    • setPortMapping

      public void setPortMapping(Map<Integer,Integer> portMapping)
      Parameters:
      portMapping - map the ports in restrictive environments
    • getPortMapping

      public Map<Integer,Integer> getPortMapping()
    • setHostMapping

      public void setHostMapping(Map<String,String> hostMapping)
      Parameters:
      hostMapping - map the resolved hosts
    • getHostMapping

      public Map<String,String> getHostMapping()