* @throws WSTrustException if a WS-Trust exception is thrown by the STS.
*/
private boolean validateInternal(Element token, int clientIndex) throws WSTrustException {
STSClient client = this.clients[clientIndex];
try {
return client.validateToken(token);
} catch (RuntimeException e) {
// if this was a connection refused exception and we still have clients to try, call the next client.
if (this.isCausedByConnectException(e) && clientIndex < this.clients.length - 1) {
return this.validateInternal(token, ++clientIndex);
}