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

org.infinispan.cli.commands.server.AbstractServerCommand Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.cli.commands.server;

import org.infinispan.cli.CommandBuffer;
import org.infinispan.cli.Context;
import org.infinispan.cli.commands.AbstractCommand;
import org.infinispan.cli.commands.ProcessedCommand;
import org.infinispan.cli.commands.ServerCommand;

public abstract class AbstractServerCommand extends AbstractCommand implements ServerCommand {

   @Override
   public boolean isAvailable(Context context) {
      return context.isConnected();
   }

   @Override
   public void execute(Context context, ProcessedCommand commandLine) {
      CommandBuffer commandBuffer = context.getCommandBuffer();
      if(commandBuffer.addCommand(commandLine, nesting())) {
         context.execute();
      }
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy