Examples of OBasicCommandContext


Examples of com.orientechnologies.orient.core.command.OBasicCommandContext

    // given
    ODocument doc1 = new ODocument().field("testField", (Object) null);
    ODocument doc2 = new ODocument().field("testField", (Object) null);

    ODocumentComparator comparator = new ODocumentComparator(
        Collections.singletonList(new OPair<String, String>("testField", "asc")), new OBasicCommandContext());

    Assert.assertEquals(comparator.compare(doc1, doc2), 0);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.command.OBasicCommandContext

      final Object[] args = new String[parts.length - 3];
      for (int i = 3; i < parts.length; ++i)
        args[i - 3] = parts[i];

      // BIND CONTEXT VARIABLES
      final OCommandContext context = new OBasicCommandContext();
      int argIdx = 0;
      for (Object arg : args)
        context.setVariable("arg" + (argIdx++), arg);

      context.setVariable("session", OHttpSessionManager.getInstance().getSession(iRequest.sessionId));
      context.setVariable("request", new OHttpRequestWrapper(iRequest, (String[]) args));
      context.setVariable("response", new OHttpResponseWrapper(iResponse));

      final String debugMode = iRequest.getParameter("debug");
      if (debugMode != null && Boolean.parseBoolean(debugMode))
        context.setVariable("debugMode", Boolean.TRUE);

      final OComposableProcessor processEngine = (OComposableProcessor) OProcessorManager.getInstance().get("composable");
      Object result = processEngine.processFromFile(name, context, iRequest.httpMethod.equals("GET"));

      if (result instanceof ODocument)
View Full Code Here

Examples of com.orientechnologies.orient.core.command.OBasicCommandContext

       final Object[] args = new String[parts.length - 3];
       for (int i = 3; i < parts.length; ++i)
         args[i - 3] = parts[i];

       // BIND CONTEXT VARIABLES
       final OBasicCommandContext context = new OBasicCommandContext();
       context.setVariable("session", OHttpSessionManager.getInstance().getSession(iRequest.sessionId));
       context.setVariable("request", new OHttpRequestWrapper(iRequest, (String[]) args));
       context.setVariable("response", new OHttpResponseWrapper(iResponse));

       handleResult(iRequest, iResponse, f.executeInContext(context, args));

     } catch (OCommandScriptException e) {
       // EXCEPTION
View Full Code Here

Examples of com.orientechnologies.orient.core.command.OBasicCommandContext

    return null;
  }

  private void initContext() {
    if (context == null)
      context = new OBasicCommandContext();

    metricRecorder.setContext(context);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.command.OBasicCommandContext

  public Object process(final String iType, final String iName, final Object... iParameters) {
    final OComposableProcessor process = (OComposableProcessor) OProcessorManager.getInstance().get(iType);
    if (process == null)
      throw new OProcessException("Process type '" + iType + "' is undefined");

    final OBasicCommandContext context = new OBasicCommandContext();
    if (iParameters != null) {
      int argIdx = 0;
      for (Object p : iParameters)
        context.setVariable("arg" + (argIdx++), p);
    }

    Object res;

    try {
View Full Code Here

Examples of com.orientechnologies.orient.core.command.OBasicCommandContext

  }

  @Test
  public void testExecute() throws Exception {
    final List<OrientVertex> result = functionDijkstra.execute(null, null, null, new Object[] { v1, v4, "'weight'" },
        new OBasicCommandContext());

    assertEquals(4, result.size());
    assertEquals(v1, result.get(0));
    assertEquals(v2, result.get(1));
    assertEquals(v3, result.get(2));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.