class AliveURL extends Authenticator
Usage: java -DproxySet=true -DproxyHost=YourProxyServerHostname -DproxyPort=YourProxyServerPort -DproxyUser=YourProxyUsernameIFNEEDED -DproxyPassword=YourProxyUserPasswordIFNEEDED -DnonProxyHosts=CommaSeperatedlistOfNonProxiedSites ca.bc.webarts.tools.AliveURL [URL location 1] [URL location 2]...
Modifier and Type | Class and Description |
---|---|
class |
AliveURL.Playback
Write data to the OutputChannel.
|
Authenticator.RequestorType
Modifier and Type | Field and Description |
---|---|
private static short |
ACCEPTABLE_NUMBER_ERRORS
A constant that tells us how many sequential errors to accept before
calling the external Script.
|
private static boolean |
areWePlayingMusic |
private static boolean |
areWeSendingEmail_ |
private static boolean |
areWeUsingProxy_ |
(package private) static int |
checkDelay |
static short |
CONSOLE
Constant Specifying that the logging output will go to System.out.
|
Date |
currDate |
static String |
DEFAULT_PROXY_HOST |
static String |
DEFAULT_PROXY_NOPROXY |
static String |
DEFAULT_PROXY_PORT |
static String |
DEFAULT_PROXY_SET |
private static String |
emailTo_
The email addr to send notifications to if a recycle happens
|
private static boolean |
enableExecScript_
This is the supervisor flag that toggles running the external script
execution.
|
private static boolean |
enableJavaX10_ |
private static String |
errorMsg_
A class var to record and error message to print out if any of the
validation checks on the properties fail.
|
private static URL |
errorMusic |
private static File |
errorMusicFile |
private static String |
errorMusicFileStr |
private static String |
errorMusicUrlStr |
private static boolean |
externalScriptWasExecuted_ |
private static int |
EXTRA_DELAY_TIME
An extra Delay after a script execution to wait before checking again.
|
static short |
FILE
Constant Specifying that the logging output will go to a spec'd file.
|
private static File |
logFile_
Description of the Field
|
private static String |
logFileName_
Description of the Field
|
private static PrintStream |
logOut_
The stream that ALL logging ends upo getting directed to.
|
private static short |
numSequentialErrors_
A class varthat tells us how many sequential errors have occured.
|
private static short |
outSpot_
Description of the Field
|
static short |
PIPE
Constant Specifying that the logging output will go to a
spec'd OutputStream.
|
(package private) AliveURL.Playback |
playback |
private static String |
proxyHost_
the Proxy hostname.
|
private static String |
proxyPassword_
the class Proxy Password to authenticate with.
|
private static String |
proxyPort_
the Proxy port.
|
private static String |
proxyUsername_
the class Proxy Username to authenticate with.
|
private static PrintStream |
STD_OUT
The Standard OutputStream.
|
(package private) Toolkit |
tk |
private static boolean |
useProxyAuthentication_ |
private static OutputStream |
userOut_
Description of the Field
|
private static boolean |
useURL |
private static String[] |
x10Cmd1_
The X10 Commands to send to the X10 engine
|
private static String[] |
x10Cmd2_ |
Constructor and Description |
---|
AliveURL(String proxyUser,
String proxyPass)
A simple/useless constructor for the sole purpose of providing the
Authenticator impl to the net authentication mechanism.
|
AliveURL(URL url)
Constructor for the AliveURL object
|
Modifier and Type | Method and Description |
---|---|
private void |
callExternalScript()
Execs an external script/application when an error occurs..
|
private static int |
executeNativeApp(String executableLocation,
Vector appParms)
Executes the Specified Native OS application with the provided commandline
parameters.
|
String |
getEmailTo()
emailTo_ Getter.
|
boolean |
getEnableExecScript()
The public get method to return the enableExecScript_ class field.
|
boolean |
getExternalScriptWasExecuted_() |
protected PasswordAuthentication |
getPasswordAuthentication()
Impl for Authenticator so an authorizing proxy will work.
|
private static void |
initLogOut()
Initializes the logOut_ Stream based on the outSpot specifired by the user.
|
static void |
initProxy()
Does the gruntwork to get the proxy properties set.
|
private static void |
logEntry(String value)
Generic uncategorized log entry.
|
static void |
main(String[] args)
The main program for the AliveURL class
|
private static boolean |
mySleep(long waitTime)
A method to simply abstract the Try/Catch required to put the current
thread to sleep for the specified time in ms.
|
private void |
playErrorMusic()
Plays the error music file
|
private void |
sendAnEmail()
Send a cycle email out to the existing class email addr.
|
private void |
sendAnEmail(String to)
Send a cycle email out.
|
private void |
sendAnEmail(String to,
String subjectToSend,
String msgToSend)
Send a cycle email out.
|
void |
setEmailTo(String emailTo)
Sets the to email address for email notice of the no-connection.
|
void |
setEnableExecScript(boolean enableExecScript)
The public set method to set the enableExecScript_ class field.
|
void |
setExternalScriptWasExecuted_() |
void |
setExternalScriptWasExecuted_(boolean externalScriptWasExecuted_) |
void |
unsetExternalScriptWasExecuted_() |
getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefault
static int checkDelay
private static URL errorMusic
private static File errorMusicFile
private static String errorMusicUrlStr
private static String errorMusicFileStr
private static boolean useURL
AliveURL.Playback playback
public static final String DEFAULT_PROXY_SET
public static final String DEFAULT_PROXY_HOST
public static final String DEFAULT_PROXY_PORT
public static final String DEFAULT_PROXY_NOPROXY
public static final short CONSOLE
public static final short FILE
public static final short PIPE
private static final PrintStream STD_OUT
private static String logFileName_
private static OutputStream userOut_
private static PrintStream logOut_
private static short outSpot_
private static final short ACCEPTABLE_NUMBER_ERRORS
private static final int EXTRA_DELAY_TIME
private static short numSequentialErrors_
private static boolean enableExecScript_
private static boolean enableJavaX10_
private static boolean externalScriptWasExecuted_
private static boolean areWePlayingMusic
private static boolean areWeSendingEmail_
private static boolean areWeUsingProxy_
private static boolean useProxyAuthentication_
private static String errorMsg_
private static String emailTo_
private static String proxyUsername_
private static String proxyPassword_
private static String proxyHost_
private static String proxyPort_
public AliveURL(String proxyUser, String proxyPass)
String
- proxyUser is the usernamer to pass to the proxyString
- proxyPass is the password to pass to the proxypublic void setEmailTo(String emailTo)
emailTo
- the email addr to usepublic String getEmailTo()
public void setEnableExecScript(boolean enableExecScript)
enableExecScript
- is the value to use to set the class field to.public boolean getEnableExecScript()
public void setExternalScriptWasExecuted_()
public void unsetExternalScriptWasExecuted_()
public void setExternalScriptWasExecuted_(boolean externalScriptWasExecuted_)
public boolean getExternalScriptWasExecuted_()
public static void initProxy()
protected PasswordAuthentication getPasswordAuthentication()
getPasswordAuthentication
in class Authenticator
private void callExternalScript()
private static int executeNativeApp(String executableLocation, Vector appParms)
executableLocation
- is the path to the executable to runappParms
- and extra commandline parameters to tag onto the end of the
commandline that gets executed.StreamGobbler
,
Runtime.getRuntime()
private void sendAnEmail()
private void sendAnEmail(String to)
private void sendAnEmail(String to, String subjectToSend, String msgToSend)
private static void initLogOut()
private static void logEntry(String value)
value
- The String to dump into the Log.private void playErrorMusic()
private static boolean mySleep(long waitTime)
waitTime
- the sleep time in milli seconds (ms).WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses