|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.utils.AddressTester
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.
Constructor Summary | |
AddressTester(int milliSeconds,
java.lang.String urlString)
Constructor |
|
AddressTester(java.lang.String urlString)
Constructor |
|
AddressTester(java.lang.String urlString,
boolean getHead)
Constructor |
|
AddressTester(java.lang.String urlString,
int milliSeconds,
boolean getHead)
Constructor |
Method Summary | |
void |
disconnect()
Shut down the connection |
java.net.URLConnection |
getConnection()
Get the (valid) URL connection |
int |
getResponseCode()
This method returns the response code that was set in checkURL () |
static void |
main(java.lang.String[] args)
This is the main method and is left as a usage sample |
boolean |
URLAvailable()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AddressTester(java.lang.String urlString, int milliSeconds, boolean getHead) throws java.lang.Exception
milliSeconds
- the number of milliseconds to let the connectioon attempt runurlString
- the String representing a URLgetHead
- use setRequestMathod("HEAD")public AddressTester(java.lang.String urlString, boolean getHead) throws java.lang.Exception
urlString
- getHead
-
java.lang.Exception
public AddressTester(int milliSeconds, java.lang.String urlString) throws java.lang.Exception
milliSeconds
- - the number of milliseconds to let the connectioon attempt runurlString
- - the String representing a URLpublic AddressTester(java.lang.String urlString) throws java.lang.Exception
urlString
- the String representing a URLMethod Detail |
public int getResponseCode()
public java.net.URLConnection getConnection()
public void disconnect()
public boolean URLAvailable()
false
if the address is not available. True
otherwisepublic static void main(java.lang.String[] args)
args
-
|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |