Class ReconnectLocationPool
java.lang.Object
org.apache.qpid.protonj2.client.util.ReconnectLocationPool
Manages the list of available reconnect entries that are used to connect
 and recover a connection.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates an emptyReconnectLocationPool.ReconnectLocationPool(List<ReconnectLocation> backups) Creates a newReconnectLocationPoolwith the providedReconnectLocationvalues.
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(ReconnectLocation entry) Adds a new entry to the pool if not already contained within.voidaddAll(List<ReconnectLocation> additions) Adds a list of newReconnectLocationvalues to the pool if not already contained within.voidaddFirst(ReconnectLocation entry) Adds a newReconnectLocationto the pool if not already contained within.getList()Gets the current list ofReconnectLocationvalues.getNext()Returns the next entry in the pool of entries.booleanisEmpty()booleanremove(ReconnectLocation entry) Remove aReconnectLocationfrom the pool if present, otherwise has no effect.voidRemoves all currently configuredReconnectLocationfrom the pool, no newReconnectLocationvalues will be served from this pool until new ones are added.voidreplaceAll(List<ReconnectLocation> replacements) Removes all currently configuredReconnectLocationvalues from the pool and replaces them with the new set given.voidshuffle()Randomizes the order of the list of entries contained within the pool.intsize()toString()
- 
Constructor Details- 
ReconnectLocationPoolpublic ReconnectLocationPool()Creates an emptyReconnectLocationPool.
- 
ReconnectLocationPoolCreates a newReconnectLocationPoolwith the providedReconnectLocationvalues.- Parameters:
- backups- a list of location where a reconnection attempt should be made.
 
 
- 
- 
Method Details- 
sizepublic int size()- Returns:
- the current size of the entry pool.
 
- 
isEmptypublic boolean isEmpty()- Returns:
- true if the entry pool is empty.
 
- 
getNextReturns the next entry in the pool of entries. The entry will be shifted to the end of the list and not be attempted again until the full list has been returned once.- Returns:
- the next entry that should be used for a connection attempt.
 
- 
shufflepublic void shuffle()Randomizes the order of the list of entries contained within the pool.
- 
addAdds a new entry to the pool if not already contained within.- Parameters:
- entry- The new- ReconnectLocationto add to the pool.
 
- 
addAllAdds a list of newReconnectLocationvalues to the pool if not already contained within.- Parameters:
- additions- The new list of- ReconnectLocationto add to the pool.
 
- 
addFirstAdds a newReconnectLocationto the pool if not already contained within. TheReconnectLocationis added to the head of the pooledReconnectLocationlist and will be the next value that is returned from the pool.- Parameters:
- entry- The new- ReconnectLocationto add to the pool.
 
- 
removeRemove aReconnectLocationfrom the pool if present, otherwise has no effect.- Parameters:
- entry- The- ReconnectLocationto attempt to remove from the pool.
- Returns:
- true if the given ReconnectLocationwas removed from the pool.
 
- 
removeAllpublic void removeAll()Removes all currently configuredReconnectLocationfrom the pool, no newReconnectLocationvalues will be served from this pool until new ones are added.
- 
replaceAllRemoves all currently configuredReconnectLocationvalues from the pool and replaces them with the new set given.- Parameters:
- replacements- The new set of reconnect- ReconnectLocationvalues to serve from this pool.
 
- 
getListGets the current list ofReconnectLocationvalues. The returned list is a copy.- Returns:
- a copy of the current list of ReconnectLocationvalues in the pool.
 
- 
toString
 
-