Package org.infinispan.cli.interpreter.result

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


         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


            }
         }
      }
      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

      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

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.