/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: HttpURLConnectionManager.java,v 1.3 2008/10/04 05:28:48 beomsuk Exp $
*
*/
/*
* Portions Copyrighted 2011 ForgeRock AS
*/
/**
* The <code>HttpURLConnectionManager</code> class is used to get
* <code>HttpURLConnection</code> instances and set read as well as connect timeout
*
* @author Bernhard Thalmayr
*/
public class HttpURLConnectionManager {
static {
initialize();
}
private static void initialize() {
if (debug.messageEnabled()) {
}
try {
if (debug.messageEnabled()) {
"Set READTIMEOUT to " + READ_TIMEOUT);
}
} catch (Exception e) {
URL_READ_TIMEOUT + " using default READTIMEOUT " +
READ_TIMEOUT, e);
}
}
try {
if (debug.messageEnabled()) {
"Set CONNECT_TIMEOUT to " + CONNECT_TIMEOUT);
}
URL_CONNECT_TIMEOUT + " using default CONNECT_TIMEOUT " +
}
}
}
/**
* Get the <code>HttpURLConnection</code> and set read and connect timeout
* @param url The <code>URL</code> to open connection with
* @exception IOException when calling <code>URL.openConnection</code> fails
* @return A <code>HttpURLConnection</code>.
*/
}
return conn;
}
public static int getReadTimeout() {
return READ_TIMEOUT;
}
public static int getConnectTimeout() {
return CONNECT_TIMEOUT;
}
}