Example #1
0
  public Object executeCommand(List args) {
    if (!ShellEnvironment.isInteractive()) {
      throw new AquilaException(ShellError.SHELL_0007, "create");
    }

    if (args.size() == 0) {
      ShellEnvironment.println("Required argument!");
      return null;
    }

    String func = (String) args.get(0);

    if (func.equals("connection")) {
      if (connectionFunction == null) {
        connectionFunction = new CreateConnectionFunction();
      }
      return connectionFunction.execute(args);
    }
    if (func.equals("datatypemap")) {
      if (createDataTypeMapFunction == null) {
        createDataTypeMapFunction = new CreateDataTypeMapFunction();
      }
      return createDataTypeMapFunction.execute(args);
    } else {
      ShellEnvironment.println("The specified function " + func + " is not recognized.");
      return null;
    }
  }