public class FailoverUriPool extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_RANDOMIZE_ENABLED |
Constructor and Description |
---|
FailoverUriPool() |
FailoverUriPool(List<URI> uris,
Map<String,String> nestedOptions) |
Modifier and Type | Method and Description |
---|---|
void |
add(URI uri)
Adds a new URI to the pool if not already contained within.
|
void |
addFirst(URI uri)
Adds a new URI to the pool if not already contained within.
|
void |
connected()
Reports that the Failover Provider connected to the last URI returned from
this pool.
|
Map<String,String> |
getNestedOptions()
Returns the currently set value for nested options which will be added to each
URI that is returned from the pool.
|
URI |
getNext()
Returns the next URI in the pool of URIs.
|
boolean |
isEmpty() |
boolean |
isRandomize() |
boolean |
remove(URI uri)
Remove a URI from the pool if present, otherwise has no effect.
|
void |
setRandomize(boolean random)
Sets whether the URIs that are returned by this pool are returned in random
order or not.
|
int |
size() |
public static final boolean DEFAULT_RANDOMIZE_ENABLED
public int size()
public boolean isEmpty()
public URI getNext()
public void connected()
public boolean isRandomize()
public void setRandomize(boolean random)
random
- true to have the URIs returned in a random order.public void add(URI uri)
uri
- The new URI to add to the pool.public void addFirst(URI uri)
uri
- The new URI to add to the pool.public boolean remove(URI uri)
uri
- The URI to attempt to remove from the pool.Copyright © 2013–2016 The Apache Software Foundation. All rights reserved.