org.teiid.net.socket
Interface ServerDiscovery

All Known Implementing Classes:
UrlServerDiscovery

public interface ServerDiscovery

Customizable ServerDiscovery interface


Method Summary
 void connectionSuccessful(HostInfo info)
          Indicates that a connection was made successfully to the given host.
 List<HostInfo> getKnownHosts(LogonResult result, SocketServerInstance instance)
          Get the currently known hosts.
 void init(TeiidURL url, Properties p)
          Initialize the ServerDiscovery
 void markInstanceAsBad(HostInfo info)
          Indicates that a connection could not be made to the given host.
 HostInfo selectNextInstance(List<HostInfo> hosts)
          Select the next instance to try.
 void shutdown()
          Shutdown this ServerDiscovery
 

Method Detail

init

void init(TeiidURL url,
          Properties p)
Initialize the ServerDiscovery

Parameters:
url -
p -

getKnownHosts

List<HostInfo> getKnownHosts(LogonResult result,
                             SocketServerInstance instance)
Get the currently known hosts. Will be called prior to connecting and after authentication for each connection.

Parameters:
result, - the current LogonResult - may be null if unauthenticated
instance, - the currently connected instance - may be null if not connected
Returns:

connectionSuccessful

void connectionSuccessful(HostInfo info)
Indicates that a connection was made successfully to the given host.

Parameters:
info -

markInstanceAsBad

void markInstanceAsBad(HostInfo info)
Indicates that a connection could not be made to the given host.

Parameters:
info -

shutdown

void shutdown()
Shutdown this ServerDiscovery


selectNextInstance

HostInfo selectNextInstance(List<HostInfo> hosts)
Select the next instance to try. The entry should be removed from the list when no more attempts are desired. and not return null.

Parameters:
hosts -
Returns:
a non-null HostInfo to try


Copyright © 2011. All Rights Reserved.