|
uPortal 2.3.2 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 |
Method Summary | |
void |
checkURL()
This method uses an annymous inner thread class and attepmts receving some response codes from the specified URLString |
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(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 void checkURL() throws java.lang.Exception
java.lang.Exception
public int getResponseCode()
public boolean URLAvailable()
false
if the address is not available. True
otherwisepublic static void main(java.lang.String[] args)
args
-
|
uPortal 2.3.2 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |