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 |
addAll(List<URI> additions)
Adds a list of new URIs 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.
|
List<URI> |
getList()
Gets the current list of URIs.
|
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 |
removeAll()
Removes all currently configured URIs from the pool, no new URIs will be
served from this pool until new ones are added.
|
void |
replaceAll(List<URI> replacements)
Removes all currently configured URIs from the pool and replaces them with
the new set given.
|
void |
setRandomize(boolean random)
Sets whether the URIs that are returned by this pool are returned in random
order or not.
|
int |
size() |
String |
toString() |
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 addAll(List<URI> additions)
additions - The new list of URIs 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.public void removeAll()
public void replaceAll(List<URI> replacements)
replacements - The new set of failover URIs to serve from this pool.public List<URI> getList()
public Map<String,String> getNestedOptions()
Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.