// Possible use cases in future? If so, the intialize method will
// need to be changed to bring the server up even if the HTTP server
// fails to start up for whatever reason.
if (!this.enabled) {
throw new MetadataServerException("metadata server not enabled");
}
if (!this.listening) {
throw new MetadataServerException(
"metadata server did not initialize correctly, sorry.");
}
logger.debug("considering target: '" + target + "', client: " +
remoteAddress);
try {
return this.dispatch(target, remoteAddress);
} catch (MetadataServerUnauthorizedException e) {
logger.error("UNAUTHORIZED call to metadata server, message: " +
e.getMessage());
throw e;
} catch (MetadataServerException e) {
logger.error("Problem with metadata server, message: " +
e.getMessage() + " ||| Client visible message: " +
e.getClientVisibleMessage());
throw e;
} catch (Throwable t) {
final String err = "Unhandled problem dispatching metadata " +
"request: " + t.getMessage();
if (logger.isDebugEnabled()) {
logger.error(err, t);
} else {
logger.error(err);
}
throw new MetadataServerException(err, t);
}
}