org.apache.activemq.broker
Class PublishedAddressPolicy

java.lang.Object
  extended by 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.


Nested Class Summary
static class PublishedAddressPolicy.PublishedHostStrategy
          Defines the value of the published host value.
 
Constructor Summary
PublishedAddressPolicy()
           
 
Method Summary
 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.
 String getPublishableConnectString(TransportConnector connector)
           
 URI getPublishableConnectURI(TransportConnector connector)
          Using the supplied TransportConnector this method returns the String that will be used to update clients with this connector's connect address.
protected  String getPublishedFragmentValue(String uriFragmentEntry)
          Subclasses can override what host value is published by implementing alternate logic for this method.
 PublishedAddressPolicy.PublishedHostStrategy getPublishedHostStrategy()
           
protected  String getPublishedHostValue(String uriHostEntry)
          Subclasses can override what host value is published by implementing alternate logic for this method.
protected  String getPublishedPathValue(String uriPathEntry)
          Subclasses can override what path value is published by implementing alternate logic for this method.
protected  String getPublishedUserInfoValue(String uriUserInfoEntry)
          Subclasses can override what user info value is published by implementing alternate logic for this method.
 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.
 void setPortMapping(HashMap<Integer,Integer> portMapping)
           
 void setPublishedHostStrategy(PublishedAddressPolicy.PublishedHostStrategy strategy)
           
 void setPublishedHostStrategy(String strategy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublishedAddressPolicy

public PublishedAddressPolicy()
Method Detail

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:
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:
publishedHostStrategy - the publishedHostStrategy to set

setPublishedHostStrategy

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

setPortMapping

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


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.