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

org.infinispan.cli.completers.CacheConfigurationAttributeCompleter Maven / Gradle / Ivy

package org.infinispan.cli.completers;

import static org.infinispan.cli.completers.CacheCompleter.getCacheName;

import java.io.IOException;
import java.util.Collection;
import java.util.Collections;

import org.infinispan.cli.Context;
import org.infinispan.cli.connection.Connection;

/**
 * @author Tristan Tarrant <[email protected]>
 * @since 13.0
 **/
public class CacheConfigurationAttributeCompleter extends ListCompleter {
   @Override
   Collection getAvailableItems(Context context) throws IOException {
      throw new UnsupportedOperationException();
   }

   @Override
   protected Collection getAvailableItems(ContextAwareCompleterInvocation invocation) throws IOException {
      Connection connection = invocation.context.getConnection();
      return getCacheName(invocation.context, invocation.getCommand()).map(connection::getCacheConfigurationAttributes).orElse(Collections.emptyList());
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy