Package org.infinispan.cli.connection

Examples of org.infinispan.cli.connection.Connection


      Getopt g = new Getopt("ispn-cli", args, sopts, lopts);
      int c;
      while ((c = g.getopt()) != -1) {
         switch (c) {
         case 'c':
            Connection connection = ConnectionFactory.getConnection(g.getOptarg());
            String password = null;
            if (connection.needsCredentials()) {
               java.io.Console sysConsole = System.console();
               if (sysConsole != null) {
                  password = new String(sysConsole.readPassword("Password: "));
               } else {
                  exitWithError("Cannot read password non-interactively");
               }
            }
            connection.connect(password);
            context.setConnection(connection);
            break;
         case 'f':
            inputFile = g.getOptarg();
            if ("-".equals(inputFile) || new File(inputFile).isFile()) {
View Full Code Here


      Getopt g = new Getopt("ispn-cli", args, sopts, lopts);
      int c;
      while ((c = g.getopt()) != -1) {
         switch (c) {
         case 'c':
            Connection connection = ConnectionFactory.getConnection(g.getOptarg());
            String password = null;
            if (connection.needsCredentials()) {
               java.io.Console sysConsole = System.console();
               if (sysConsole != null) {
                  password = new String(sysConsole.readPassword("Password: "));
               } else {
                  exitWithError("Cannot read password non-interactively");
               }
            }
            connection.connect(context, password);
            context.setConnection(connection);
            break;
         case 'f':
            inputFile = g.getOptarg();
            if ("-".equals(inputFile) || new File(inputFile).isFile()) {
View Full Code Here

      Getopt g = new Getopt("ispn-cli", args, sopts, lopts);
      int c;
      while ((c = g.getopt()) != -1) {
         switch (c) {
         case 'c':
            Connection connection = ConnectionFactory.getConnection(g.getOptarg());
            String password = null;
            if (connection.needsCredentials()) {
               java.io.Console sysConsole = System.console();
               if (sysConsole != null) {
                  password = new String(sysConsole.readPassword("Password: "));
               } else {
                  exitWithError("Cannot read password non-interactively");
               }
            }
            connection.connect(context, password);
            context.setConnection(connection);
            break;
         case 'f':
            inputFile = g.getOptarg();
            if ("-".equals(inputFile) || new File(inputFile).isFile()) {
View Full Code Here

         context.disconnect();
      }

      try {
         String connectionString = commandLine.getArguments().get(0).getValue();
         Connection connection = ConnectionFactory.getConnection(connectionString);
         String password = null;
         if (connection.needsCredentials()) {
            password = new String(context.getOutputAdapter().secureReadln("Password: "));
         }
         connection.connect(context, password);
         context.setConnection(connection);
      } catch (Exception e) {
         context.error(e);
      }
View Full Code Here

      Getopt g = new Getopt("ispn-cli", args, sopts, lopts);
      int c;
      while ((c = g.getopt()) != -1) {
         switch (c) {
         case 'c':
            Connection connection = ConnectionFactory.getConnection(g.getOptarg());
            String password = null;
            if (connection.needsCredentials()) {
               java.io.Console sysConsole = System.console();
               if (sysConsole != null) {
                  password = new String(sysConsole.readPassword("Password: "));
               } else {
                  exitWithError("Cannot read password non-interactively");
               }
            }
            connection.connect(password);
            context.setConnection(connection);
            break;
         case 'f':
            inputFile = g.getOptarg();
            if ("-".equals(inputFile) || new File(inputFile).isFile()) {
View Full Code Here

      }

      try {
         List<Argument> arguments = commandLine.getArguments();
         String connectionString = arguments.size() > 0 ? arguments.get(0).getValue() : "";
         Connection connection = ConnectionFactory.getConnection(connectionString);
         String password = null;
         if (connection.needsCredentials()) {
            password = new String(context.getOutputAdapter().secureReadln("Password: "));
         }
         connection.connect(password);
         context.setConnection(connection);
      } catch (Exception e) {
         context.error(e);
      }
View Full Code Here

      }

      try {
         List<Argument> arguments = commandLine.getArguments();
         String connectionString = arguments.size() > 0 ? arguments.get(0).getValue() : "";
         Connection connection = ConnectionFactory.getConnection(connectionString);
         String password = null;
         if (connection.needsCredentials()) {
            password = new String(context.getOutputAdapter().secureReadln("Password: "));
         }
         connection.connect(context, password);
         context.setConnection(connection);
      } catch (Exception e) {
         context.error(e);
      }
View Full Code Here

      Getopt g = new Getopt("ispn-cli", args, sopts, lopts);
      int c;
      while ((c = g.getopt()) != -1) {
         switch (c) {
         case 'c':
            Connection connection = ConnectionFactory.getConnection(g.getOptarg());
            String password = null;
            if (connection.needsCredentials()) {
               java.io.Console sysConsole = System.console();
               if (sysConsole != null) {
                  password = new String(sysConsole.readPassword("Password: "));
               } else {
                  exitWithError("Cannot read password non-interactively");
               }
            }
            connection.connect(context, password);
            context.setConnection(connection);
            break;
         case 'f':
            inputFile = g.getOptarg();
            if ("-".equals(inputFile) || new File(inputFile).isFile()) {
View Full Code Here

TOP

Related Classes of org.infinispan.cli.connection.Connection

Copyright © 2018 www.massapicom. 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.