@Override
public WOActionResults defaultAction() {
// KH - make this faster as well :)
Application theApplication = (Application) WOApplication.application();
WOResponse aResponse = theApplication.createResponseInContext(null);
WORequest aRequest = request();
MSiteConfig aConfig = theApplication.siteConfig();
theApplication._lock.startReading();
try {
// Check for correct password
String passwordHeader = aRequest.headerForKey("password");
if (!aConfig.comparePasswordWithPassword(passwordHeader)) {
NSLog.debug.appendln("Attempt to call Direct Action: defaultAction with incorrect password.");
aResponse.setStatus(WOMessage.HTTP_STATUS_FORBIDDEN);
aResponse.appendContentString("Attempt to call Direct Action: defaultAction on wotaskd with incorrect password.");
// we endReading at the finally block
return aResponse;
}
aResponse.appendContentString("<html><head><title>Wotaskd for WebObjects 5</title></head><body>");
aResponse.appendContentString("<center><b>Wotaskd for WebObjects 5: " + _hostName + "</b></center>");
aResponse.appendContentString("<br><br><hr><br>Site Config as written to disk<br><hr><br><pre>");
aResponse.appendContentString(WOMessage.stringByEscapingHTMLString(aConfig.generateSiteConfigXML()));
aResponse.appendContentString("</pre><br><br><hr><br>Adaptor Config as sent to Local WOAdaptors - All Running Applications and Instances<br><hr><br><pre>");
aResponse.appendContentString(WOMessage.stringByEscapingHTMLString(aConfig.generateAdaptorConfigXML(true, true)));
aResponse.appendContentString("</pre><br><br><br><br>Adaptor Config as sent to remote WOAdaptors - All Registered and Running Applications and Instances<br><hr><br><pre>");
aResponse.appendContentString(WOMessage.stringByEscapingHTMLString(aConfig.generateAdaptorConfigXML(true, false)));
aResponse.appendContentString("</pre><br><br><hr><br>Adaptor Config as written to disk - All Registered Applications and Instances<br><hr><br><pre>");
aResponse.appendContentString(WOMessage.stringByEscapingHTMLString(aConfig.generateAdaptorConfigXML(false, false)));
aResponse.appendContentString("</pre><br><br><hr><br>Properties of this wotaskd<br><hr><br><pre>");
aResponse.appendContentString("The Configuration Directory is: " + MSiteConfig.configDirectoryPath());
aResponse.appendContentString("<br>");
if (((Application)WOApplication.application()).shouldWriteAdaptorConfig()) {
aResponse.appendContentString("Wotaskd is writing WOConfig.xml to disk");
} else {
aResponse.appendContentString("Wotaskd is NOT writing WOConfig.xml to disk");
}
aResponse.appendContentString("<br>");
aResponse.appendContentString("The multicast address is: " + ((Application)WOApplication.application()).multicastAddress());
aResponse.appendContentString("<br>");
aResponse.appendContentString("This wotaskd is running on Port: " + WOApplication.application().port());
aResponse.appendContentString("<br>");
if (((Application)WOApplication.application()).shouldRespondToMulticast()) {
aResponse.appendContentString("Wotaskd is responding to Multicast");
} else {
aResponse.appendContentString("Wotaskd is NOT responding to Multicast");
}
aResponse.appendContentString("<br>");
aResponse.appendContentString("WOAssumeApplicationIsDeadMultiplier is " + (aConfig._appIsDeadMultiplier / 1000));
aResponse.appendContentString("<br>");
aResponse.appendContentString("The System Properties are: ");
aResponse.appendContentString(WOMessage.stringByEscapingHTMLString(System.getProperties().toString()));
aResponse.appendContentString("</pre><br><br></body></html>");
} finally {
theApplication._lock.endReading();
}
return aResponse;