Package org.jredis.ri.alphazero

Examples of org.jredis.ri.alphazero.JRedisClient.ping()


  }

  private void run(String password) {
    try {
      JRedis  jredis = new JRedisClient("localhost", 6379, "jredis", 0);
      jredis.ping();
     
      if(!jredis.exists(key)) {
        jredis.set(key, "Hello Again!");
        System.out.format("Hello!  You should run me again!\n");
      }
View Full Code Here


            .setDatabase(13);
         
          // finally - use it to create the JRedisClient instance
          //
          JRedisClient jredis = new JRedisClient(connectionSpec);
            jredis.ping();
            Log.log("Sweet success -- we're connected using custom TCP settings");
          }
          catch (RedisException e) {
            Log.error("Failed to connect to Redis using JRedisClient custom ConnectionSpec -- password perhaps? => " + e.getLocalizedMessage());
          }
View Full Code Here

        // Note that if your localhost:6379 redis server expects a password
        // this will fail
        ConnectionSpec connectionSpec = DefaultConnectionSpec.newSpec();
        JRedisClient jredis = new JRedisClient(connectionSpec);
        try {
            jredis.ping();
            Log.log("Sweet success -- we're connected using all default values.");
          }
          catch (RedisException e) {
            Log.error("Failed to connect to Redis using JRedisClient default ConnectionSpec -- password perhaps? => " + e.getLocalizedMessage());
          }
View Full Code Here

          .setCredentials(password.getBytes())
          .setDatabase(database);
       
        JRedisClient jredis = new JRedisClient(connectionSpec);
        try {
            jredis.ping();
            Log.log("Sweet success -- we're connected using %s as password to %d database.", password, database);
          }
          catch (RedisException e) {
            Log.error("Failed to connect to Redis using JRedisClient default ConnectionSpec -- password perhaps? => " + e.getLocalizedMessage());
          }
View Full Code Here

          ConnectionSpec connectionSpec = DefaultConnectionSpec.newSpec(address, port, database, password.getBytes());
         
          // finally - use it to create the JRedisClient instance
          //
          JRedisClient jredis = new JRedisClient(connectionSpec);
            jredis.ping();
            Log.log("Sweet success -- we're connected using default specs and various server info settings.");
          }
          catch (RedisException e) {
            Log.error("Failed to connect to Redis using JRedisClient default ConnectionSpec -- password perhaps? => " + e.getLocalizedMessage());
          }
View Full Code Here

  private void run(String password) {
    try {
      ConnectionSpec spec = DefaultConnectionSpec.newSpec().setCredentials(password);
      JRedis  jredis = new JRedisClient(spec);
      jredis.ping();
     
      if(!jredis.exists(bkey)) {
        jredis.set(bkey, "Hello Again!");
        System.out.format("Hello!  You should run me again!\n");
      }
View Full Code Here

            .setDatabase(13);
         
          // finally - use it to create the JRedisClient instance
          //
          JRedisClient jredis = new JRedisClient(connectionSpec);
            jredis.ping();
            Log.log("Sweet success -- we're connected using custom TCP settings");
          }
          catch (RedisException e) {
            Log.error("Failed to connect to Redis using JRedisClient custom ConnectionSpec -- password perhaps? => " + e.getLocalizedMessage());
          }
View Full Code Here

        // Note that if your localhost:6379 redis server expects a password
        // this will fail
        ConnectionSpec connectionSpec = DefaultConnectionSpec.newSpec();
        JRedisClient jredis = new JRedisClient(connectionSpec);
        try {
            jredis.ping();
            Log.log("Sweet success -- we're connected using all default values.");
          }
          catch (RedisException e) {
            Log.error("Failed to connect to Redis using JRedisClient default ConnectionSpec -- password perhaps? => " + e.getLocalizedMessage());
          }
View Full Code Here

          .setCredentials(password.getBytes())
          .setDatabase(database);
       
        JRedisClient jredis = new JRedisClient(connectionSpec);
        try {
            jredis.ping();
            Log.log("Sweet success -- we're connected using %s as password to %d database.", password, database);
          }
          catch (RedisException e) {
            Log.error("Failed to connect to Redis using JRedisClient default ConnectionSpec -- password perhaps? => " + e.getLocalizedMessage());
          }
View Full Code Here

          ConnectionSpec connectionSpec = DefaultConnectionSpec.newSpec(address, port, database, password.getBytes());
         
          // finally - use it to create the JRedisClient instance
          //
          JRedisClient jredis = new JRedisClient(connectionSpec);
            jredis.ping();
            Log.log("Sweet success -- we're connected using default specs and various server info settings.");
          }
          catch (RedisException e) {
            Log.error("Failed to connect to Redis using JRedisClient default ConnectionSpec -- password perhaps? => " + e.getLocalizedMessage());
          }
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.