if(!request.getRemoteAddr().equals("127.0.0.1")) {
log.error("Access denied from " + request.getRemoteAddr());
out.println("false");
return;
}
SOTProxyKeeper pk = new SOTProxyKeeper();
String dn = "";
String proxy_str = "";
Enumeration e = request.getParameterNames();
while (e.hasMoreElements()) {
String name = (String)e.nextElement();
String value = request.getParameter(name);
if(name.equals("dn")) {
dn = value;
}
if(name.equals("sot_method")) {
sot_method = value;
}
if(name.equals("proxy_str")) {
proxy_str = value;
}
// out.println(name + " = " + value);
}
try {
if(sot_method.equals("get")) {
log.debug("Call SOTProxyKeeper.get for " + dn);
proxy_str = pk.get(dn);
/* do not replay when proxy_str is empty */
if(proxy_str.length() != 0) {
out.println(proxy_str);
}
} else if(sot_method.equals("put")){
log.debug("Call SOTProxyKeeper.put");
out.println(pk.put(proxy_str));
} else if(sot_method.equals("destroy")) {
log.debug("Call SOTProxyKeeper.destroy for " + dn);
out.println(pk.destroy(dn));
} else if(sot_method.equals("check")) {
log.debug("Call SOTProxyKeeper.check for " + dn);
out.println(pk.check(dn));
} else {
log.error("Method not found");
out.println("<pre>Unknown Method " + sot_method +"</pre>");
}
} catch (SOTNoDNFoundException nod) {