org.littleshoot.util
Interface ConnectionMaintainer<T>

Type Parameters:
T - The type of the object that identifies a server.
All Known Implementing Classes:
ConnectionMaintainerImpl

public interface ConnectionMaintainer<T>

The interface to an object that robustly maintains connections to a number of servers.


Method Summary
 Collection<T> getConnectedServers()
          Returns a collection of the servers that are currently connected.
 Optional<T> getMostRecentlyActive()
          Returns the most recently active server.
 void start()
          Starts this maintainer.
 

Method Detail

start

void start()
Starts this maintainer.


getMostRecentlyActive

Optional<T> getMostRecentlyActive()
Returns the most recently active server.

Returns:
The most recently active server. If no server has been active yet, a None object is returned. Otherwise, a Some object with map entry of the most recently active server is returned. The type of the server is determined by the types used by the implementation. In the default implementation, the type of the server is determined by the ConnectionEstablisher that is used.

getConnectedServers

Collection<T> getConnectedServers()
Returns a collection of the servers that are currently connected.

Returns:
A collection of the servers that are currently connected. The type of these servers is determined by the types used by the implementation. In the default implementation, the type of the server is determined by the ConnectionEstablisher that is used.


Copyright © 2011-2013 LittleShoot. All Rights Reserved.