Package org.infinispan.cli.interpreter.result

Examples of org.infinispan.cli.interpreter.result.StringResult


            }
         }
      }
      Object value = cache.get(codec.encodeKey(key));
      if (value == null) {
         return new StringResult("null");
      } else {
         Object decoded = codec.decodeValue(value);
         if (decoded instanceof String) {
            return new StringResult((String) decoded);
         } else if (decoded.getClass().isPrimitive()) {
            return new StringResult(decoded.toString());
         } else {
            return new JsonResult(decoded);
         }
      }
   }
View Full Code Here


         cache = (Cache<Object, Object>) session.getCache(cacheName);
      } else {
         cache = (Cache<Object, Object>) session.getCache();
      }
      boolean b = cache.startBatch();
      return b ? EmptyResult.RESULT : new StringResult("Batch for cache already started");
   }
View Full Code Here

         cache = (Cache<Object, Object>) session.getCache();
      }
      DistributionManager distributionManager = cache.getAdvancedCache().getDistributionManager();
      if(distributionManager!=null) {
         List<Address> addresses = distributionManager.locate(keyData.getKey());
         return new StringResult(addresses.toString());
      } else {
         throw new StatementException("Cache is not distributed");
      }
   }
View Full Code Here

   public Result execute(Session session) {
      if(cacheName!=null) {
         session.setCacheName(cacheName);
         return EmptyResult.RESULT;
      } else {
         return new StringResult(session.getCache().getName());
      }
   }
View Full Code Here

      } else {
         cache = (Cache<Object, Object>) session.getCache();
      }
      Object value = cache.get(keyData.key);
      if (value==null) {
         return new StringResult("null");
      } else if (value instanceof String) {
         return new StringResult((String)value);
      } else if (value.getClass().isPrimitive()) {
         return new StringResult(value.toString());
      } else {
         return new JsonResult(value);
      }
   }
View Full Code Here

      } else {
         printCacheStats(pw, session.getCache(cacheName));
      }

      pw.flush();
      return new StringResult(sw.toString());
   }
View Full Code Here

   public Result execute(Session session) throws StatementException {
      Cache<Object, Object> cache = session.getCache(keyData.getCacheName());
      DistributionManager distributionManager = cache.getAdvancedCache().getDistributionManager();
      if(distributionManager!=null) {
         List<Address> addresses = distributionManager.locate(keyData.getKey());
         return new StringResult(addresses.toString());
      } else {
         throw log.cacheNotDistributed();
      }
   }
View Full Code Here

      } else {
         printCacheStats(pw, session.getCache(cacheName));
      }

      pw.flush();
      return new StringResult(sw.toString());
   }
View Full Code Here

   public Result execute(Session session) throws StatementException {
      Cache<Object, Object> cache = session.getCache(keyData.getCacheName());
      DistributionManager distributionManager = cache.getAdvancedCache().getDistributionManager();
      if(distributionManager!=null) {
         List<Address> addresses = distributionManager.locate(keyData.getKey());
         return new StringResult(addresses.toString());
      } else {
         throw new StatementException("Cache is not distributed");
      }
   }
View Full Code Here

   public Result execute(Session session) {
      if (cacheName != null) {
         session.setCurrentCache(cacheName);
         return EmptyResult.RESULT;
      } else {
         return new StringResult(session.getCurrentCache().getName());
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.cli.interpreter.result.StringResult

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.