// This is the biggie - this processes all requests from Monitor
public WOActionResults monitorRequestAction() {
Application theApplication = (Application) WOApplication.application();
MSiteConfig aConfig = theApplication.siteConfig();
WORequest aRequest = request();
WOResponse aResponse = theApplication.createResponseInContext(null);
// Aren't allowed to call this through the Web server.
if (aRequest.isUsingWebServer()) {
NSLog.debug.appendln("Attempt to call DirectAction: monitorRequestAction through Web server");
if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelCritical, NSLog.DebugGroupDeployment))
NSLog.debug.appendln(aRequest.contentString());
aResponse.setStatus(WOMessage.HTTP_STATUS_FORBIDDEN);
aResponse.appendContentString(_accessDenied);
return aResponse;
}
// Checking to see if the password was corrent
theApplication._lock.startReading();
try {
String passwordHeader = aRequest.headerForKey("password");
if (!aConfig.comparePasswordWithPassword(passwordHeader)) {
NSLog.debug.appendln("Attempt to call DirectAction: monitorRequestAction with incorrect password.");
aResponse.setStatus(WOMessage.HTTP_STATUS_FORBIDDEN);
aResponse.appendContentString(_invalidPassword);
// we endReading at the finally block
return aResponse;
}
} finally {
theApplication._lock.endReading();
}
NSDictionary requestDict;
try {
requestDict = (NSDictionary) new _JavaMonitorDecoder().decodeRootObject(aRequest.content());
} catch (WOXMLException wxe) {
NSLog.err.appendln("Wotaskd monitorRequestAction: Error parsing request");
if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelInformational, NSLog.DebugGroupDeployment))
NSLog.debug.appendln("Wotaskd monitorRequestAction: " + aRequest.contentString());
aResponse.appendContentString(_invalidXML);
return aResponse;
}
if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelInformational, NSLog.DebugGroupDeployment))