test_class.declarator: groovysh = new Groovysh()
test_class.modifier: private final
test_class.original_string: private final Groovysh groovysh = new Groovysh();
test_class.type: Groovysh
test_class.var_name: groovysh
test_class.declarator: acceptor
test_class.modifier: private
test_class.original_string: private DriverRemoteAcceptor acceptor;
test_class.type: DriverRemoteAcceptor
test_class.var_name: acceptor
test_class.file: gremlin-console/src/test/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptorTest.java
test_class.identifier: DriverRemoteAcceptorTest
test_case.body: @Test(expected = RemoteException.class)
      public void shouldNotConfigureWithBadCommand() throws Exception {
          acceptor.configure(Arrays.asList("test"));
      }
test_case.class_method_signature: DriverRemoteAcceptorTest.shouldNotConfigureWithBadCommand()
test_case.full_signature: @Test(expected = RemoteException.class) public void shouldNotConfigureWithBadCommand()
test_case.identifier: shouldNotConfigureWithBadCommand
test_case.invocations: configure asList
test_case.modifiers: @Test(expected = RemoteException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldNotConfigureWithBadCommand()
focal_class.declarator: NO_TIMEOUT = 0
focal_class.modifier: public static final
focal_class.original_string: public static final int NO_TIMEOUT = 0;
focal_class.type: int
focal_class.var_name: NO_TIMEOUT
focal_class.declarator: currentCluster
focal_class.modifier: private
focal_class.original_string: private Cluster currentCluster;
focal_class.type: Cluster
focal_class.var_name: currentCluster
focal_class.declarator: currentClient
focal_class.modifier: private
focal_class.original_string: private Client currentClient;
focal_class.type: Client
focal_class.var_name: currentClient
focal_class.declarator: timeout = NO_TIMEOUT
focal_class.modifier: private
focal_class.original_string: private int timeout = NO_TIMEOUT;
focal_class.type: int
focal_class.var_name: timeout
focal_class.declarator: aliases = new HashMap<>()
focal_class.modifier: private
focal_class.original_string: private Map<String,String> aliases = new HashMap<>();
focal_class.type: Map<String,String>
focal_class.var_name: aliases
focal_class.declarator: session = Optional.empty()
focal_class.modifier: private
focal_class.original_string: private Optional<String> session = Optional.empty();
focal_class.type: Optional<String>
focal_class.var_name: session
focal_class.declarator: TOKEN_RESET = "reset"
focal_class.modifier: private static final
focal_class.original_string: private static final String TOKEN_RESET = "reset";
focal_class.type: String
focal_class.var_name: TOKEN_RESET
focal_class.declarator: TOKEN_SHOW = "show"
focal_class.modifier: private static final
focal_class.original_string: private static final String TOKEN_SHOW = "show";
focal_class.type: String
focal_class.var_name: TOKEN_SHOW
focal_class.declarator: TOKEN_MAX = "max"
focal_class.modifier: @Deprecated
      private static final
focal_class.original_string: @Deprecated
      private static final String TOKEN_MAX = "max";
focal_class.type: String
focal_class.var_name: TOKEN_MAX
focal_class.declarator: TOKEN_NONE = "none"
focal_class.modifier: private static final
focal_class.original_string: private static final String TOKEN_NONE = "none";
focal_class.type: String
focal_class.var_name: TOKEN_NONE
focal_class.declarator: TOKEN_TIMEOUT = "timeout"
focal_class.modifier: private static final
focal_class.original_string: private static final String TOKEN_TIMEOUT = "timeout";
focal_class.type: String
focal_class.var_name: TOKEN_TIMEOUT
focal_class.declarator: TOKEN_ALIAS = "alias"
focal_class.modifier: private static final
focal_class.original_string: private static final String TOKEN_ALIAS = "alias";
focal_class.type: String
focal_class.var_name: TOKEN_ALIAS
focal_class.declarator: TOKEN_SESSION = "session"
focal_class.modifier: private static final
focal_class.original_string: private static final String TOKEN_SESSION = "session";
focal_class.type: String
focal_class.var_name: TOKEN_SESSION
focal_class.declarator: TOKEN_SESSION_MANAGED = "session-managed"
focal_class.modifier: private static final
focal_class.original_string: private static final String TOKEN_SESSION_MANAGED = "session-managed";
focal_class.type: String
focal_class.var_name: TOKEN_SESSION_MANAGED
focal_class.declarator: POSSIBLE_TOKENS = Arrays.asList(TOKEN_TIMEOUT, TOKEN_ALIAS)
focal_class.modifier: private static final
focal_class.original_string: private static final List<String> POSSIBLE_TOKENS = Arrays.asList(TOKEN_TIMEOUT, TOKEN_ALIAS);
focal_class.type: List<String>
focal_class.var_name: POSSIBLE_TOKENS
focal_class.declarator: shell
focal_class.modifier: private final
focal_class.original_string: private final Groovysh shell;
focal_class.type: Groovysh
focal_class.var_name: shell
focal_class.file: gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
focal_class.identifier: DriverRemoteAcceptor
focal_class.interfaces: implements RemoteAcceptor
focal_class.class_method_signature: DriverRemoteAcceptor.DriverRemoteAcceptor(final Groovysh shell)
focal_class.full_signature: public  DriverRemoteAcceptor(final Groovysh shell)
focal_class.identifier: DriverRemoteAcceptor
focal_class.modifiers: public
focal_class.parameters: (final Groovysh shell)
focal_class.signature:  DriverRemoteAcceptor(final Groovysh shell)
focal_class.class_method_signature: DriverRemoteAcceptor.connect(final List<String> args)
focal_class.full_signature: @Override public Object connect(final List<String> args)
focal_class.identifier: connect
focal_class.modifiers: @Override public
focal_class.parameters: (final List<String> args)
focal_class.return: Object
focal_class.signature: Object connect(final List<String> args)
focal_class.class_method_signature: DriverRemoteAcceptor.configure(final List<String> args)
focal_class.full_signature: @Override public Object configure(final List<String> args)
focal_class.identifier: configure
focal_class.modifiers: @Override public
focal_class.parameters: (final List<String> args)
focal_class.return: Object
focal_class.signature: Object configure(final List<String> args)
focal_class.class_method_signature: DriverRemoteAcceptor.submit(final List<String> args)
focal_class.full_signature: @Override public Object submit(final List<String> args)
focal_class.identifier: submit
focal_class.modifiers: @Override public
focal_class.parameters: (final List<String> args)
focal_class.return: Object
focal_class.signature: Object submit(final List<String> args)
focal_class.class_method_signature: DriverRemoteAcceptor.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: DriverRemoteAcceptor.getTimeout()
focal_class.full_signature: public int getTimeout()
focal_class.identifier: getTimeout
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getTimeout()
focal_class.class_method_signature: DriverRemoteAcceptor.send(final String gremlin)
focal_class.full_signature: private List<Result> send(final String gremlin)
focal_class.identifier: send
focal_class.modifiers: private
focal_class.parameters: (final String gremlin)
focal_class.return: List<Result>
focal_class.signature: List<Result> send(final String gremlin)
focal_class.class_method_signature: DriverRemoteAcceptor.allowRemoteConsole()
focal_class.full_signature: @Override public boolean allowRemoteConsole()
focal_class.identifier: allowRemoteConsole
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean allowRemoteConsole()
focal_class.class_method_signature: DriverRemoteAcceptor.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: DriverRemoteAcceptor.findResponseException(final Throwable ex)
focal_class.full_signature: private Optional<ResponseException> findResponseException(final Throwable ex)
focal_class.identifier: findResponseException
focal_class.modifiers: private
focal_class.parameters: (final Throwable ex)
focal_class.return: Optional<ResponseException>
focal_class.signature: Optional<ResponseException> findResponseException(final Throwable ex)
focal_class.class_method_signature: DriverRemoteAcceptor.getSessionStringSegment()
focal_class.full_signature: private String getSessionStringSegment()
focal_class.identifier: getSessionStringSegment
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getSessionStringSegment()
focal_method.body: @Override
      public Object configure(final List<String> args) throws RemoteException {
          final String option = args.size() == 0 ? "" : args.get(0);
          if (!POSSIBLE_TOKENS.contains(option))
              throw new RemoteException(String.format("The 'config' option expects one of ['%s'] as an argument", String.join(",", POSSIBLE_TOKENS)));
  
          final List<String> arguments = args.subList(1, args.size());
  
          if (option.equals(TOKEN_TIMEOUT)) {
              final String errorMessage = "The timeout option expects a positive integer representing milliseconds or 'none' as an argument";
              if (arguments.size() != 1) throw new RemoteException(errorMessage);
              try {
                  // first check for MAX timeout then NONE and finally parse the config to int. "max" is now "deprecated"
                  // in the sense that it will no longer be promoted. support for it will be removed at a later date
                  timeout = arguments.get(0).equals(TOKEN_MAX) ? Integer.MAX_VALUE :
                          arguments.get(0).equals(TOKEN_NONE) ? NO_TIMEOUT : Integer.parseInt(arguments.get(0));
                  if (timeout < NO_TIMEOUT) throw new RemoteException("The value for the timeout cannot be less than " + NO_TIMEOUT);
                  return timeout == NO_TIMEOUT ? "Remote timeout is disabled" : "Set remote timeout to " + timeout + "ms";
              } catch (Exception ignored) {
                  throw new RemoteException(errorMessage);
              }
          } else if (option.equals(TOKEN_ALIAS)) {
              if (arguments.size() == 1 && arguments.get(0).equals(TOKEN_RESET)) {
                  aliases.clear();
                  return "Aliases cleared";
              }
  
              if (arguments.size() == 1 && arguments.get(0).equals(TOKEN_SHOW)) {
                  return aliases;
              }
  
              if (arguments.size() % 2 != 0)
                  throw new RemoteException("Arguments to alias must be 'reset' to clear any existing alias settings or key/value alias/binding pairs");
  
              final Map<String,Object> aliasMap = ElementHelper.asMap(arguments.toArray());
              aliases.clear();
              aliasMap.forEach((k,v) -> aliases.put(k, v.toString()));
              return aliases;
          }
  
          return this.toString();
      }
focal_method.class_method_signature: DriverRemoteAcceptor.configure(final List<String> args)
focal_method.full_signature: @Override public Object configure(final List<String> args)
focal_method.identifier: configure
focal_method.invocations: size get contains format join subList size equals size equals get equals get parseInt get equals size equals get clear size equals get size asMap toArray clear forEach put toString toString
focal_method.modifiers: @Override public
focal_method.parameters: (final List<String> args)
focal_method.return: Object
focal_method.signature: Object configure(final List<String> args)