activemq-cpp-3.6.0
|
#include <src/main/activemq/transport/failover/URIPool.h>
Public Member Functions | |
URIPool () | |
Create an Empty URI Pool. | |
URIPool (const decaf::util::List< decaf::net::URI > &uris) | |
Creates a new URI Pool using the given list as the initial Free List. | |
URIPool (const URIPool &uris) | |
Creates a new URI Pool which will be a copy of the given URI Pool. | |
URIPool & | operator= (const URIPool &uris) |
Assignment operator, copies the contents of the given URIPool into this one. | |
~URIPool () | |
const decaf::util::List < decaf::net::URI > & | getURIList () const |
Gets a static view of the URI List contained in this URI Pool. | |
bool | isEmpty () const |
const decaf::net::URI & | getPriorityURI () const |
Returns the URI that is considered to be this Pools Priority URI, this is always the first URI in the list of URIs that this pool was created with. | |
void | setPriorityURI (const decaf::net::URI &uri) |
Sets the URI that is considered this Pool's priority URI. | |
decaf::net::URI | getURI () |
Fetches the next available URI from the pool, if there are no more URIs free when this method is called it throws a NoSuchElementException. | |
bool | addURI (const decaf::net::URI &uri) |
Adds a URI to the free list, callers that have previously taken one using the getURI method should always return the URI when they close the resource that was connected to that URI. | |
bool | addURIs (const decaf::util::List< decaf::net::URI > &uris) |
Adds a List of URIs to this Pool, the method checks for duplicates already in the pool and does not add those. | |
bool | removeURI (const decaf::net::URI &uri) |
Remove a given URI from the Free List. | |
bool | isRandomize () const |
Is the URI that is given randomly picked from the pool or is each one taken in sequence. | |
void | setRandomize (bool value) |
Sets if the URI's that are taken from the pool are chosen Randomly or are taken in the order they are in the list. | |
bool | contains (const decaf::net::URI &uri) const |
Returns true if the given URI is contained in this set of URIs. | |
bool | isPriority (const decaf::net::URI &uri) const |
Returns true if the URI given is the first in the list of URIs contained in this pool. | |
void | clear () |
Remove all URIs from the pool. | |
bool | equals (const URIPool &other) const |
Compares the URIs in this set to that of another URIPool. |
activemq::transport::failover::URIPool::URIPool | ( | ) |
Create an Empty URI Pool.
activemq::transport::failover::URIPool::URIPool | ( | const decaf::util::List< decaf::net::URI > & | uris | ) |
Creates a new URI Pool using the given list as the initial Free List.
uris | - List of URI to place in the Pool. |
Creates a new URI Pool which will be a copy of the given URI Pool.
uris | The URIPool instance to copy. |
activemq::transport::failover::URIPool::~URIPool | ( | ) |
bool activemq::transport::failover::URIPool::addURI | ( | const decaf::net::URI & | uri | ) |
Adds a URI to the free list, callers that have previously taken one using the getURI
method should always return the URI when they close the resource that was connected to that URI.
uri | - a URI previously taken from the pool. |
bool activemq::transport::failover::URIPool::addURIs | ( | const decaf::util::List< decaf::net::URI > & | uris | ) |
Adds a List of URIs to this Pool, the method checks for duplicates already in the pool and does not add those.
uris | - List of URIs to add into the Pool. |
void activemq::transport::failover::URIPool::clear | ( | ) |
Remove all URIs from the pool.
bool activemq::transport::failover::URIPool::contains | ( | const decaf::net::URI & | uri | ) | const |
Returns true if the given URI is contained in this set of URIs.
|
inline |
Returns the URI that is considered to be this Pools Priority URI, this is always the first URI in the list of URIs that this pool was created with.
decaf::net::URI activemq::transport::failover::URIPool::getURI | ( | ) |
Fetches the next available URI from the pool, if there are no more URIs free when this method is called it throws a NoSuchElementException.
Receiving the exception is not an indication that a URI won't be available in the future, the caller should react accordingly.
NoSuchElementException | if there are none free currently. |
|
inline |
Gets a static view of the URI List contained in this URI Pool.
bool activemq::transport::failover::URIPool::isEmpty | ( | ) | const |
bool activemq::transport::failover::URIPool::isPriority | ( | const decaf::net::URI & | uri | ) | const |
Returns true if the URI given is the first in the list of URIs contained in this pool.
|
inline |
Is the URI that is given randomly picked from the pool or is each one taken in sequence.
bool activemq::transport::failover::URIPool::removeURI | ( | const decaf::net::URI & | uri | ) |
Remove a given URI from the Free List.
uri | The URI to find and remove from the free list |
|
inline |
Sets the URI that is considered this Pool's priority URI.
uri | The configured priority URI for this pool. |
|
inline |
Sets if the URI's that are taken from the pool are chosen Randomly or are taken in the order they are in the list.
value | - true indicates URI gets are random. |