org.apache.karaf.shell.api.action.Completion类的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(11.9k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中org.apache.karaf.shell.api.action.Completion类的一些代码示例,展示了Completion类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Completion类的具体详情如下:
包路径:org.apache.karaf.shell.api.action.Completion
类名称:Completion

Completion介绍

暂无

代码示例

代码示例来源:origin: org.apache.camel.karaf/camel-karaf-commands

public abstract class AbstractRouteCommand extends CamelControllerImpl implements Action {

  @Argument(index = 0, name = "context", description = "The Camel context name.", required = true, multiValued = false)
  @Completion(CamelContextCompleter.class)
  String context;

  @Argument(index = 1, name = "route", description = "The Camel route ID or a wildcard expression", required = true, multiValued = false)
  @Completion(RouteCompleter.class)
  String route;

}

代码示例来源:origin: apache/karaf

@Command(scope = "jdbc", name = "execute", description = "Execute a SQL command on a given JDBC datasource")
@Parsing(JdbcParser.class)
@Service
public class ExecuteCommand extends JdbcCommandSupport {

  @Argument(index = 0, name = "datasource", description = "The JDBC datasource name, its JNDI name or service.id", required = true, multiValued = false)
  @Completion(DataSourcesNameCompleter.class)
  String datasource;

  @Argument(index = 1, name = "command", description = "The SQL command to execute", required = true, multiValued = false)
  @Completion(SqlCompleter.class)
  String command;

  @Override
  public Object execute() throws Exception {
    this.getJdbcService().execute(datasource, command);
    return null;
  }

}

代码示例来源:origin: apache/karaf

@Command(scope = "instance", name = "status", description = "Check the current status of an instance.")
@Service
public class StatusCommand extends InstanceCommandSupport {

  @Argument(index = 0, name = "name", description = "The name of the instance", required = true, multiValued = false)
  @Completion(InstanceCompleter.class)
  private String name;

  protected Object doExecute() throws Exception {
    Instance instance = getExistingInstance(name);
    System.out.println(instance.getState());
    return null;
  }

}

代码示例来源:origin: apache/karaf

/**
 * For commands that need a connection factory and authentication information 
 */
public abstract class JmsConnectionCommandSupport extends JmsCommandSupport {

  @Argument(index = 0, name = "connectionFactory", description = "The JMS connection factory name", required = true, multiValued = false)
  @Completion(ConnectionFactoriesNameCompleter.class)
  String connectionFactory;

  @Option(name = "-u", aliases = { "--username" }, description = "Username to connect to the JMS broker", required = false, multiValued = false)
  String username = "karaf";

  @Option(name = "-p", aliases = { "--password" }, description = "Password to connect to the JMS broker", required = false, multiValued = false)
  String password = "karaf";

}

代码示例来源:origin: org.apache.camel.karaf/camel-karaf-commands

@Command(scope = "camel", name = "context-stop", description = "Stop a Camel context. It becomes unavailable and can not be started again.")
@Service
public class ContextStop extends CamelControllerImpl implements Action {

  @Argument(index = 0, name = "context", description = "The name of the Camel context.", required = true, multiValued = false)
  @Completion(CamelContextCompleter.class)
  String context;

  @Override
  public Object execute() throws Exception {
    ContextStopCommand command = new ContextStopCommand(context);
    return command.execute(this, System.out, System.err);
  }

}

代码示例来源:origin: org.apache.camel.karaf/camel-karaf-commands

@Command(scope = "camel", name = "route-list", description = "List Camel routes.")
@Service
public class RouteList extends CamelControllerImpl implements Action {

  @Argument(index = 0, name = "name", description = "The Camel context name where to look for the route", required = false, multiValued = false)
  @Completion(CamelContextCompleter.class)
  String name;

  public Object execute() throws Exception {
    RouteListCommand command = new RouteListCommand(name);
    return command.execute(this, System.out, System.err);
  }

}

代码示例来源:origin: org.apache.camel.karaf/camel-karaf-commands

@Command(scope = "camel", name = "context-resume", description = "Resumes a Camel context.")
@Service
public class ContextResume extends CamelControllerImpl implements Action {

  @Argument(index = 0, name = "context", description = "The name of the Camel context.", required = true, multiValued = false)
  @Completion(CamelContextCompleter.class)
  String context;

  @Override
  public Object execute() throws Exception {
    ContextResumeCommand command = new ContextResumeCommand(context);
    return command.execute(this, System.out, System.err);
  }
}

代码示例来源:origin: apache/karaf

@Command(scope = "jms", name = "delete", description = "Delete a JMS connection factory")
@Service
public class DeleteCommand extends JmsCommandSupport {

  @Argument(index = 0, name = "name", description = "The JMS connection factory name", required = true, multiValued = false)
  @Completion(ConnectionFactoriesFileNameCompleter.class)
  String name;

  @Override
  public Object execute() throws Exception {
    getJmsService().delete(name);
    return null;
  }

}

代码示例来源:origin: apache/karaf

@Command(scope = "jdbc", name = "ds-delete", description = "Delete a JDBC datasource")
@Service
public class DeleteCommand extends JdbcCommandSupport {

  @Argument(index = 0, name = "name", description = "The JDBC datasource name (the one used at creation time)", required = true, multiValued = false)
  @Completion(DataSourcesNameCompleter.class)
  String name;

  @Override
  public Object execute() throws Exception {
    this.getJdbcService().delete(name);
    return null;
  }

}

代码示例来源:origin: apache/karaf

@Command(scope = "jndi", name = "bind", description = "Bind an OSGi service in the JNDI context")
@Service
public class BindCommand implements Action {

  @Argument(index = 0, name = "service", description = "The ID of the OSGi service to bind", required = true, multiValued = false)
  @Completion(ServicesIdCompleter.class)
  Long serviceId;

  @Argument(index = 1, name = "name", description = "The JNDI name to bind the OSGi service", required = true, multiValued = false)
  @Completion(ContextsCompleter.class)
  String name;

  @Reference
  JndiService jndiService;

  @Override
  public Object execute() throws Exception {
    jndiService.bind(serviceId, name);
    return null;
  }

}

代码示例来源:origin: org.apache.camel.karaf/camel-karaf-commands

@Command(scope = "camel", name = "rest-api-doc", description = "List the Camel REST services API documentation (requires camel-swagger-java on classpath)")
@Service
public class RestApiDoc extends CamelControllerImpl implements Action {

  @Argument(index = 0, name = "name", description = "The Camel context name where to look for the REST services", required = true, multiValued = false)
  @Completion(CamelContextCompleter.class)
  String name;

  public Object execute() throws Exception {
    RestApiDocCommand command = new RestApiDocCommand(name);
    return command.execute(this, System.out, System.err);
  }

}

代码示例来源:origin: org.apache.karaf.instance/org.apache.karaf.instance.core

@Command(scope = "instance", name = "status", description = "Check the current status of an instance.")
@Service
public class StatusCommand extends InstanceCommandSupport {

  @Argument(index = 0, name = "name", description = "The name of the instance", required = true, multiValued = false)
  @Completion(InstanceCompleter.class)
  private String name;

  protected Object doExecute() throws Exception {
    Instance instance = getExistingInstance(name);
    System.out.println(instance.getState());
    return null;
  }

}

代码示例来源:origin: org.apache.karaf.jdbc/org.apache.karaf.jdbc.core

@Command(scope = "jdbc", name = "ds-delete", description = "Delete a JDBC datasource")
@Service
public class DeleteCommand extends JdbcCommandSupport {

  @Argument(index = 0, name = "name", description = "The JDBC datasource name (the one used at creation time)", required = true, multiValued = false)
  @Completion(DataSourcesNameCompleter.class)
  String name;

  @Override
  public Object execute() throws Exception {
    this.getJdbcService().delete(name);
    return null;
  }

}

代码示例来源:origin: org.apache.camel.karaf/camel-karaf-commands

@Command(scope = "camel", name = "rest-show", description = "Display the Camel REST definition in XML")
@Service
public class RestShow extends CamelControllerImpl implements Action {

  @Argument(index = 0, name = "name", description = "The name of the Camel context", required = true, multiValued = false)
  @Completion(CamelContextCompleter.class)
  String name;

  public Object execute() throws Exception {
    RestShowCommand command = new RestShowCommand(name);
    return command.execute(this, System.out, System.err);
  }

}

代码示例来源:origin: org.apache.camel.karaf/camel-karaf-commands

@Command(scope = "camel", name = "context-start", description = "Start a Camel context.")
@Service
public class ContextStart extends CamelControllerImpl implements Action {

  @Argument(index = 0, name = "context", description = "The name of the Camel context.", required = true, multiValued = false)
  @Completion(CamelContextCompleter.class)
  String context;

  @Override
  public Object execute() throws Exception {
    ContextStartCommand command = new ContextStartCommand(context);
    return command.execute(this, System.out, System.err);
  }

}

代码示例来源:origin: apache/karaf

@Command(scope = "jndi", name = "alias", description = "Create a JNDI alias on a given name.")
@Service
public class AliasCommand implements Action {

  @Argument(index = 0, name = "name", description = "The JNDI name", required = true, multiValued = false)
  @Completion(NamesCompleter.class)
  String name;

  @Argument(index = 1, name = "alias", description = "The JNDI alias", required = true, multiValued = false)
  @Completion(ContextsCompleter.class)
  String alias;

  @Reference
  JndiService jndiService;

  @Override
  public Object execute() throws Exception {
    jndiService.alias(name, alias);
    return null;
  }

}

代码示例来源:origin: org.apache.karaf.jdbc/org.apache.karaf.jdbc.core

@Command(scope = "jdbc", name = "execute", description = "Execute a SQL command on a given JDBC datasource")
@Parsing(JdbcParser.class)
@Service
public class ExecuteCommand extends JdbcCommandSupport {

  @Argument(index = 0, name = "datasource", description = "The JDBC datasource name, its JNDI name or service.id", required = true, multiValued = false)
  @Completion(DataSourcesNameCompleter.class)
  String datasource;

  @Argument(index = 1, name = "command", description = "The SQL command to execute", required = true, multiValued = false)
  @Completion(SqlCompleter.class)
  String command;

  @Override
  public Object execute() throws Exception {
    this.getJdbcService().execute(datasource, command);
    return null;
  }

}

代码示例来源:origin: apache/karaf-cellar

@Command(scope = "cluster", name = "consumer-status", description = "Status of a cluster event consumer")
@Service
public class ConsumerStatusCommand extends ConsumerSupport {

  @Argument(index = 0, name = "node", description = "The node(s) ID or alias", required = false, multiValued = true)
  @Completion(AllNodeCompleter.class)
  List<String> nodes;

  @Override
  protected Object doExecute() throws Exception {
    return doExecute(nodes, null);
  }

}

代码示例来源:origin: apache/karaf-cellar

@Command(scope = "cluster", name = "producer-status", description = "Status of a cluster event producer")
@Service
public class ProducerStatusCommand extends ProducerSupport {

  @Argument(index = 0, name = "node", description = "The node(s) ID or alias", required = false, multiValued = true)
  @Completion(AllNodeCompleter.class)
  List<String> nodes;

  @Override
  protected Object doExecute() throws Exception {
    return doExecute(nodes, null);
  }

}

代码示例来源:origin: org.apache.camel.karaf/camel-karaf-commands

@Command(scope = "camel", name = "route-reset-stats", description = "Reset route performance stats from a CamelContext")
@Service
public class RouteResetStats extends CamelControllerImpl implements Action {

  @Argument(index = 0, name = "context", description = "The name of the Camel context.", required = true, multiValued = false)
  @Completion(CamelContextCompleter.class)
  String context;

  @Override
  public Object execute() throws Exception {
    RouteResetStatsCommand command = new RouteResetStatsCommand(context);
    return command.execute(this, System.out, System.err);
  }

}

相关文章

Completion类方法