// Javadoc inherited.
public HttpStatusCode execute() throws IOException {
// Log the time it took to retrieve the object and if the object
// retrieval was successful if debug logging is enabled.
Time startTime = clock.getCurrentTime();
HttpStatusCode code = null;
try {
code = executer.execute(method);
} catch (InterruptedIOException e) {
// Connection timed out.
code = HttpStatusCode.RESPONSE_TIMED_OUT;
if (logger.isErrorEnabled()) {
logger.error("Received exception but assumed timed out", e);
}
}
if (logger.isDebugEnabled()) {
if (code == HttpStatusCode.RESPONSE_TIMED_OUT) {
String message = "Remote request to '" + url +
"' timed-out " +
"at " + connectionTimeout + "milliseconds.";
logger.debug(message);
} else {
Time now = clock.getCurrentTime();
Period retrievalDuration = now.getPeriodSince(startTime);
String message = "Remote request to '" + url +
"' retrieval time was " +
retrievalDuration + ".";
logger.debug(message);
}