All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.cli.resources.CounterResource Maven / Gradle / Ivy

package org.infinispan.cli.resources;

import java.io.IOException;

/**
 * @author Tristan Tarrant <[email protected]>
 * @since 10.0
 **/
public class CounterResource extends AbstractResource {
   public CounterResource(CountersResource parent, String name) {
      super(parent, name);
   }

   @Override
   public Iterable getChildrenNames() throws IOException {
      return getConnection().getCounterValue(getParent().getParent().getName(), name);
   }

   @Override
   public boolean isLeaf() {
      return true;
   }

   @Override
   public String describe() throws IOException {
      return getConnection().describeCounter(getParent().getParent().getName(), name);
   }

   public static String counterName(Resource resource) {
      return resource.findAncestor(CounterResource.class).getName();
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy