public final boolean getKilled() { if (myAccess != null && myAccess.getCompiledScript() != null) { return myAccess.getCompiledScript().getKill(); } else { return false; } }
public void setKilled(boolean b) { if (myAccess.getCompiledScript().getCurrentMap() != null) { Mappable myMap = (Mappable) myAccess.getCompiledScript().getCurrentMap().myObject; if (myMap != null && myMap instanceof com.dexels.navajo.adapter.SQLMap) { ((SQLMap) myMap).setKillConnection(); } } myAccess.getCompiledScript().setKill(b); }
private Message getMessage(Message parent, String name) throws NavajoException { Message m = null; m = NavajoFactory.getInstance().createMessage(callingAccess.getOutputDoc(), name); if (parent != null) { parent.addMessage(m); } else { callingAccess.getOutputDoc().addMessage(m); } return m; }
private void addProperty(Message m, String name, Object value, String type, int length) throws NavajoException, MappingException { MappingUtils.setProperty( false, m, name, value, type, null, Property.DIR_OUT, "", length, callingAccess.getOutputDoc(), callingAccess.getCompiledScript().getInDoc(), false); }
public String getClientToken() { if (myAccess != null) { return myAccess.getClientToken(); } else { return null; } }
public String getRequestId() { if (myAccess != null) { return myAccess.getInDoc().getHeader().getRequestId(); } else { return null; } }
private String getRequestNavajo() { if (requestNavajo == null) { Navajo in = myAccess.getCompiledScript().getInDoc().copy(); in.removeMessage("__globals__"); in.removeMessage("__parms__"); java.io.StringWriter sw = new java.io.StringWriter(); in.write(sw); requestNavajo = sw.toString(); } return requestNavajo; }
private String getMapStack() { StringBuffer stackBuffer = new StringBuffer(); Stack<MappableTreeNode> s = myAccess.getCompiledScript().getTreeNodeStack(); Iterator<MappableTreeNode> iter = s.iterator(); while (iter.hasNext()) { MappableTreeNode o = iter.next(); if (o != null && o.myObject != null) { stackBuffer.append(o.myObject.getClass().getName() + "\n"); } } return stackBuffer.toString(); }
@SuppressWarnings("rawtypes") private String getOutMessageStack() { StringBuffer stackBuffer = new StringBuffer(); Stack s = myAccess.getCompiledScript().getOutMsgStack(); Iterator iter = s.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o != null) { stackBuffer.append(o + "\n"); } } return stackBuffer.toString(); }
private String getResponseNavajo() { if (responseNavajo == null) { Navajo in = myAccess.getOutputDoc().copy(); if (in.getMessage("__globals__") != null) in.removeMessage("__globals__"); if (in.getMessage("__parms__") != null) in.removeMessage("__parms__"); java.io.StringWriter sw = new java.io.StringWriter(); in.write(sw); responseNavajo = sw.toString(); } return responseNavajo; }
@Override public void store() throws MappableException, UserException { if (showDetails) { try { Message user = getMessage(null, "User"); addProperty(user, "Starttime", getCreated(), Property.DATE_PROPERTY, 10); addProperty(user, "Totaltime", new Integer(getTotaltime()), Property.INTEGER_PROPERTY, 10); addProperty(user, "ClientIP", getIpAddress(), Property.STRING_PROPERTY, 50); addProperty(user, "ClientHostname", getHost(), Property.STRING_PROPERTY, 50); addProperty(user, "User", myAccess.rpcUser, Property.STRING_PROPERTY, 50); addProperty(user, "Webservice", myAccess.rpcName, Property.STRING_PROPERTY, 50); addProperty(user, "AccessId", myAccess.accessID, Property.STRING_PROPERTY, 50); addProperty( user, "Stacktrace", myAccess.getCompiledScript().getStackTrace(), Property.MEMO_PROPERTY, 4096); Message currentMap = getMessage(user, "CurrentMap"); MappableTreeNode currentNode = getCurrentMap(); if (currentNode != null) { showMapDetails(currentMap, currentNode); } Message requestNavajo = getMessage(user, "RequestNavajo"); addProperty(requestNavajo, "Document", getRequestNavajo(), Property.MEMO_PROPERTY, -1); Message responseNavajo = getMessage(user, "ResponseNavajo"); addProperty(responseNavajo, "Document", getResponseNavajo(), Property.MEMO_PROPERTY, -1); Message outMessagStack = getMessage(user, "OutMessageStack"); addProperty(outMessagStack, "Stack", getOutMessageStack(), Property.STRING_PROPERTY, -1); Message mapStack = getMessage(user, "MapObjectStack"); addProperty(mapStack, "Stack", getMapStack(), Property.STRING_PROPERTY, -1); } catch (Exception ne) { logger.error("Error: ", ne); } } }
public AccessMap(Access a) { this.myAccess = a; this.myScript = a.getCompiledScript(); }
private MappableTreeNode getCurrentMap() { MappableTreeNode current = myAccess.getCompiledScript().getCurrentMap(); return current; }
public String getWaitingFor() { return myAccess.getWaitingForPreviousResponse(); }
public boolean getWaiting() { return (myAccess.getWaitingForPreviousResponse() != null); }