HttpServletResponse response)
{
// subclass method
- Cache.info("**************REMOVEME about to run initialise()");
initialise(request, response);
- Cache.info("**************REMOVEME about to run checkStatus()");
if (checkStatus(request, response, Status.STARTED))
{
returnStatus(response);
return;
}
- Cache.info(
- "**************REMOVEME about to run getCompletableFuture()");
if (getCompletableFuture() == null)
{
final Map<String, String> finalMap = stringMap;
this.process(request, response, finalMap);
}));
}
- else
- {
- Cache.info(
- "####################REMOVEME CompletableFuture cf is already set cf="
- + cf);
- }
- Cache.info(
- "####################REMOVEME about to run finaliseCompletableFuture()");
finaliseCompletableFuture();
// subclass method
finalise(request, response);
- Cache.info("REMOVEME about to run returnStatus");
returnStatus(response);
- Cache.info("REMOVEME about to change status for id=" + getId());
changeStatus(Status.IN_PROGRESS);
- Cache.info("REMOVEME now changed status for id=" + getId()
- + " to status=" + getStatus());
}
protected void atEnd()
protected String setId(HttpServletRequest request, String extension)
{
String idString = request.getParameter("id");
- Cache.info("REMOVEME setting extension=" + extension);
- Cache.info("REMOVEME idString=" + idString);
if (idString == null)
{
setIdExtension(extension);
- Cache.info("REMOVEME id now " + getId());
}
else
{
if (id != null)
{
writer.write("id=" + id + "\n");
- Cache.info("REMOVEME returnStatus id=" + id);
}
if (api.getRequestMap().get(id) != null)
{
writer.write(
"request=" + api.getRequestMap().get(id).toString() + "\n");
- Cache.info("REMOVEME returnStatus request="
- + api.getRequestMap().get(id).toString());
}
if (getStatus() != null)
{
if (getStatus() == Status.ERROR)
{
response.setStatus(500);
- Cache.info("REMOVEME returnStatus setting HTTP status to " + 500);
}
writer.write("status=" + getStatus().toString() + "\n");
- Cache.info(
- "REMOVEME returnStatus status=" + getStatus().toString());
- }
- if (getCompletableFuture() != null)
- {
- boolean isDone = getCompletableFuture().isDone();
- boolean isError = getCompletableFuture().isCompletedExceptionally();
- writer.write("cf.isDone=" + isDone + "\n");
- writer.write("cf.isError=" + isError + "\n");
- Cache.info("REMOVEME returnStatus cf.isDone=" + isDone);
- Cache.info("REMOVEME returnStatus cf.isError=" + isDone);
}
} catch (IOException e)
{
HttpServletResponse response, Status set)
{
String id = getId();
- Cache.info("REMOVEME checkStatus id=" + id);
Status status = getStatus();
if (status == null)
{
- Cache.info("REMOVEME checkStatus status is " + null);
if (set != null)
changeStatus(set);
api.getRequestMap().put(id, request.getRequestURI());
}
else
{
- Cache.info("REMOVEME checkStatus status=" + status.toString());
return true;
}
}
protected void finaliseCompletableFuture()
{
String id = getId();
- Cache.info("######################REMOVEME setting whenComplete on cf");
cf.whenComplete((Void, e) -> {
if (e != null)
{
urlString = request.getParameter("url");
method = request.getMethod().toLowerCase();
dataString = request.getParameter("data");
- Cache.info("REMOVEME dataString=" + dataString);
body = null;
post = method.equalsIgnoreCase("post");
data = dataString != null;
- Cache.info("REMOVEME urlString=" + urlString);
if (post)
{
access = "post";
protected void process(HttpServletRequest request,
HttpServletResponse response, final Map<String, String> finalMap)
{
- Cache.info("REMOVEME finalMap=" + finalMap);
String content = finalMap.get("content");
if (post || data)
{
- Cache.info("REMOVEME content=" + content);
// Sequence file contents being posted
// use File -> Input Alignment -> from Textbox
CutAndPasteTransfer cap = new CutAndPasteTransfer();
String endpointName = getRequestedEndpointName(request);
- Cache.info("REMOVEME endpointName=" + endpointName);
- Cache.info("REMOVEME endpoints[" + endpointName + "]="
- + endpoints.get(endpointName));
if (!endpoints.containsKey(endpointName)
|| endpoints.get(endpointName) == null)
{
{
endpoints = new HashMap<>();
}
- Cache.info("REMOVEME Adding Endpoint ep=" + ep);
- Cache.info("REMOVEME Adding Endpoint ep.getName()=" + ep.getName());
Endpoint e = (Endpoint) ep;
- Cache.info("REMOVEME Adding Endpoint e.name=" + e.name);
endpoints.put(ep.getName(), ep);
return true;
}