Package org.infinispan.cli.interpreter.result

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


   @Override
   public Result execute(Session session) {
      Cache<Object, Object> cache = session.getCache(keyData.getCacheName());
      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


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

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

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

      }
      DistributionManager distributionManager = cache.getAdvancedCache().getDistributionManager();
      if(distributionManager!=null) {
         Object key = keyData.getKey();
         List<Address> addresses = distributionManager.locate(codec.encodeKey(key));
         return new StringResult(addresses.toString());
      } else {
         throw log.cacheNotDistributed();
      }
   }
View Full Code Here

            Collection<Codec> codecs = session.getCodecs();
            for (Codec codec : codecs) {
               sb.append(codec.getName());
               sb.append("\n");
            }
            return new StringResult(sb.toString());
         }
         }
      }
      if (encoding != null) {
         session.setCodec(encoding);
         return EmptyResult.RESULT;
      } else {
         return new StringResult(session.getCodec().getName());
      }
   }
View Full Code Here

      if (!(gac.principalRoleMapper() instanceof ClusterRoleMapper)) {
         throw log.noClusterPrincipalMapper("ROLES");
      }
      ClusterRoleMapper cpm = (ClusterRoleMapper) gac.principalRoleMapper();
      if (principalName != null) {
         return new StringResult(cpm.list(principalName).toString());
      } else {
         return new StringResult(cpm.listAll());
      }
   }
View Full Code Here

      }
      default: {
         throw log.missingUpgradeAction();
      }
      }
      return new StringResult(sb.toString());
   }
View Full Code Here

   public VersionStatement() {
   }

   @Override
   public Result execute(Session session) {
      return new StringResult("Server Version "+ Version.class.getPackage().getImplementationVersion());
   }
View Full Code Here

   }

   private Result cacheManagerInfo(Session session) {
      EmbeddedCacheManager cacheManager = session.getCacheManager();
      GlobalConfiguration globalConfiguration = cacheManager.getCacheManagerConfiguration();
      return new StringResult(globalConfiguration.toString());
   }
View Full Code Here

   }

   private Result cacheInfo(Session session) {
      Cache<?, ?> cache = session.getCache(cacheName);
      Configuration cacheConfiguration = cache.getCacheConfiguration();
      return new StringResult(cacheConfiguration.toString());
   }
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.