Package org.infinispan.cli.interpreter.result

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


      XSiteAdminOperations xsiteAdmin = cache.getAdvancedCache().getComponentRegistry().getComponent(XSiteAdminOperations.class);
      for (Option opt : options) {
         switch (opt.toEnum(Options.class)) {
         case STATUS: {
            String status = siteName == null ? xsiteAdmin.status() : xsiteAdmin.siteStatus(siteName);
            return new StringResult(status);
         }
         case ONLINE: {
            if (siteName != null) {
               return new StringResult(xsiteAdmin.bringSiteOnline(siteName));
            } else {
               throw log.siteNameNotSpecified();
            }
         }
         case OFFLINE: {
            if (siteName != null) {
               return new StringResult(xsiteAdmin.takeSiteOffline(siteName));
            } else {
               throw log.siteNameNotSpecified();
            }
         }
         }
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

      }
      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

         session.setCurrentCache(cacheName);
         return EmptyResult.RESULT;
      } else {
         Cache<?, ?> currentCache = session.getCurrentCache();
         if (currentCache != null) {
            return new StringResult(currentCache.getName());
         } else {
            throw log.noCacheSelectedYet();
         }
      }
   }
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.