public interface ServerChooser
HAClient
to pick an initial server, and
then pick a new one on failure.Modifier and Type | Method and Description |
---|---|
Authenticator |
getCurrentAuthenticator()
Returns the Authenticator instance associated with the current URI.
|
java.lang.String |
getCurrentURI()
Returns the current URI.
|
java.lang.String |
getError()
Provides additional detail to be included in an exception thrown when
the AMPS instance(s) are not available.
|
void |
reportFailure(java.lang.Exception exception,
ConnectionInfo info)
Called by the
HAClient when an error occurs connecting to the
current URI, and/or when an error occurs logging on. |
void |
reportSuccess(ConnectionInfo info)
Called by the
HAClient when successfully connected and logged on
to the current instance. |
java.lang.String getCurrentURI()
Authenticator getCurrentAuthenticator() throws java.lang.Exception
Authenticator
or null
if none is required for
logon.java.lang.Exception
- unable to create an authenticator: typically wraps an exception that describes the actual failurevoid reportFailure(java.lang.Exception exception, ConnectionInfo info) throws java.lang.Exception
HAClient
when an error occurs connecting to the
current URI, and/or when an error occurs logging on. Implementors will
likely advance the current URI to the next one in a list, or choose to
stay with the current one, based on the exception type.exception
- The exception associated with this failure.info
- Information about the connection that failed.java.lang.Exception
- indicates that the failure is unrecoverable and stops the connection processjava.lang.String getError()
HAClient
when creating an exception.String
with information about the connection
that failed and the reason for the failure. When no
further information is available, returns an empty string.void reportSuccess(ConnectionInfo info)
HAClient
when successfully connected and logged on
to the current instance.info
- Information about the successful connection.