1 package org.simantics.document.server.request;
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.exception.DatabaseException;
5 import org.simantics.db.layer0.request.VariableRead;
6 import org.simantics.db.layer0.variable.Variable;
7 import org.simantics.document.server.DocumentServerUtils.AttributesRequest;
8 import org.simantics.document.server.JSONObject;
10 public class NodeRequest extends VariableRead<JSONObject> {
12 public static final String ERRORS = "Errors";
13 public static final String PROPERTY_VALUE_EXCEPTIONS = "_PropertyValueExceptions";
15 public NodeRequest(Variable node) {
20 public JSONObject perform(ReadGraph graph) throws DatabaseException {
21 long s = DocumentRequest.PROFILE ? System.nanoTime() : 0L;
23 JSONObject staticContent = graph.syncRequest(new AttributesRequest(variable));
25 if (DocumentRequest.PROFILE) {
26 long dura = System.nanoTime()-s;
27 if (dura > DocumentRequest.PROFILE_THRESHOLD_NODEREQUEST * 1e3) {
28 System.err.println("NodeRequest " + System.identityHashCode(this) + " in " + 1e-6*dura + "ms. " + variable.getURI(graph));