| java.lang.Object org.jasig.portal.utils.AddressTester
AddressTester | public class AddressTester (Code) | | This class checks a URL or a webserver hosting a URL. It only allows a specific time allocated for
connecting to the URL rather than waiting for a timeout.
This class uses the java.util.Timer to schedule a task which is cancelling the attempt of calling
httpURLConnection.
author: Kazem Naderi version: $Revision: 36736 $ since: uPortal 2.2HttpClientManager.getNewHTTPClient |
Inner Class :class RemindTask extends TimerTask | |
connectionThread | Thread connectionThread(Code) | | The connection thread inwhich the connection attempt is made
|
defaultTimeToWait | final static int defaultTimeToWait(Code) | | |
timeToWait | int timeToWait(Code) | | The amount of time connection attempt can take, the default is 100 ms
|
AddressTester | public AddressTester(String urlString, int milliSeconds, boolean getHead) throws Exception(Code) | | Constructor
Parameters: milliSeconds - the number of milliseconds to let the connectioon attempt run Parameters: urlString - the String representing a URL Parameters: getHead - use setRequestMathod("HEAD") |
AddressTester | public AddressTester(String urlString, boolean getHead) throws Exception(Code) | | Constructor
Parameters: urlString - Parameters: getHead - throws: java.lang.Exception - HttpClientManager.getNewHTTPClient |
AddressTester | public AddressTester(int milliSeconds, String urlString) throws Exception(Code) | | Constructor
Parameters: milliSeconds - - the number of milliseconds to let the connectioon attempt run Parameters: urlString - - the String representing a URLHttpClientManager.getNewHTTPClient |
AddressTester | public AddressTester(String urlString) throws Exception(Code) | | Constructor
Parameters: urlString - the String representing a URLHttpClientManager.getNewHTTPClient |
URLAvailable | public boolean URLAvailable()(Code) | | false if the address is not available. True otherwise |
disconnect | public void disconnect()(Code) | | Shut down the connection
|
getConnection | public URLConnection getConnection()(Code) | | Get the (valid) URL connection
URL connection |
getResponseCode | public int getResponseCode()(Code) | | This method returns the response code that was set in checkURL ()
the response code |
main | public static void main(String[] args)(Code) | | This is the main method and is left as a usage sample
Parameters: args - |
|
|