本文整理汇总了Java中org.apache.karaf.shell.support.completers.StringsCompleter类的典型用法代码示例。如果您正苦于以下问题:Java StringsCompleter类的具体用法?Java StringsCompleter怎么用?Java StringsCompleter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringsCompleter类属于org.apache.karaf.shell.support.completers包,在下文中一共展示了StringsCompleter类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
public int complete(Session session, CommandLine commandLine,
List<String> candidates) {
StringsCompleter delegate = new StringsCompleter();
com.datastax.driver.core.Session cassandraSession = (com.datastax.driver.core.Session) session
.get(SessionParameter.CASSANDRA_SESSION);
if (cassandraSession == null) {
System.err
.println("No active session found--run the connect command first");
return 0;
// return delegate.complete(session, commandLine, candidates);
}
CompleterCommons.completeKeySpace(delegate, cassandraSession);
return delegate.complete(session, commandLine, candidates);
}
开发者ID:ANierbeck,项目名称:Karaf-Cassandra,代码行数:19,代码来源:KeySpaceCompleter.java
示例2: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete( Session session, CommandLine commandLine, List<String> candidates ) {
// Scoped instance path should be the third argument, preceded by an application name.
String applicationName = null;
int position = commandLine.getCursorArgumentIndex();
if( position > 0 )
applicationName = commandLine.getArguments()[ position - 1 ];
// Find the instances...
StringsCompleter delegate = new StringsCompleter( false );
ManagedApplication ma;
if( ! Utils.isEmptyOrWhitespaces( applicationName )
&& ( ma = this.manager.applicationMngr().findManagedApplicationByName( applicationName )) != null ) {
for( Instance inst : InstanceHelpers.findAllScopedInstances( ma.getApplication()))
delegate.getStrings().add( InstanceHelpers.computeInstancePath( inst ));
}
return delegate.complete( session, commandLine, candidates );
}
开发者ID:roboconf,项目名称:roboconf-platform,代码行数:22,代码来源:ScopedInstanceCompleter.java
示例3: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete(Session session, CommandLine commandLine, List<String> candidates) {
StringsCompleter delegate = new StringsCompleter();
for (String entry : enums) {
delegate.getStrings().add(entry);
}
return delegate.complete(session, commandLine, candidates);
}
开发者ID:xipki,项目名称:xitk,代码行数:9,代码来源:AbstractEnumCompleter.java
示例4: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete(Session session, CommandLine commandLine, List<String> candidates) {
StringsCompleter delegate = new StringsCompleter();
for (String s : getEnums()) {
delegate.getStrings().add(s);
}
return delegate.complete(session, commandLine, candidates);
}
开发者ID:xipki,项目名称:xitk,代码行数:11,代码来源:AbstractDynamicEnumCompleter.java
示例5: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete(final Session session, final CommandLine commandLine, final List<String> candidates) {
final String[] algorithms = Arrays.stream(Security.getProviders()).flatMap(p -> p.getServices().stream())
.filter(s -> credentialStoreType.equals(s.getType())).map(Service::getAlgorithm).toArray(String[]::new);
return new StringsCompleter(algorithms).complete(session, commandLine, candidates);
}
开发者ID:jboss-fuse,项目名称:fuse-karaf,代码行数:8,代码来源:CredentialStoreAlgorithmCompletionSupport.java
示例6: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete(final Session session, final CommandLine commandLine, final List<String> candidates) {
final String[] providerNames = Arrays.stream(Security.getProviders()).map(Provider::getName)
.toArray(String[]::new);
return new StringsCompleter(providerNames).complete(session, commandLine, candidates);
}
开发者ID:jboss-fuse,项目名称:fuse-karaf,代码行数:8,代码来源:ProviderCompletionSupport.java
示例7: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete(Session session, CommandLine commandLine, List<String> candidates) {
StringsCompleter delegate = new StringsCompleter();
for (String name : _db.listDbNames()) {
delegate.getStrings().add(name);
}
return delegate.complete(session, commandLine, candidates);
}
开发者ID:kscarr73,项目名称:OsgiDb,代码行数:11,代码来源:DbNameCompleter.java
示例8: completeKeySpace
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
public static void completeKeySpace(StringsCompleter delegate,
com.datastax.driver.core.Session cassandraSession) {
try {
ResultSet execute = cassandraSession
.execute("SELECT keyspace_name FROM system_schema.keyspaces;");
for (Row row : execute) {
String keySpace = row.getString("keyspace_name");
delegate.getStrings().add(keySpace);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
开发者ID:ANierbeck,项目名称:Karaf-Cassandra,代码行数:15,代码来源:CompleterCommons.java
示例9: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete( Session session, CommandLine commandLine, List<String> candidates ) {
StringsCompleter delegate = new StringsCompleter( false );
for( ManagedApplication ma : this.manager.applicationMngr().getManagedApplications())
delegate.getStrings().add( ma.getName());
return delegate.complete( session, commandLine, candidates );
}
开发者ID:roboconf,项目名称:roboconf-platform,代码行数:10,代码来源:ApplicationCompleter.java
示例10: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete( Session session, CommandLine commandLine, List<String> candidates ) {
StringsCompleter delegate = new StringsCompleter( false );
for( Level level : LEVELS )
delegate.getStrings().add( level.toString());
return delegate.complete( session, commandLine, candidates );
}
开发者ID:roboconf,项目名称:roboconf-platform,代码行数:10,代码来源:LogLevelCompleter.java
示例11: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete( Session session, CommandLine commandLine, List<String> candidates ) {
StringsCompleter delegate = new StringsCompleter( false );
delegate.getStrings().addAll( SupportedTarget.allString());
return delegate.complete( session, commandLine, candidates );
}
开发者ID:roboconf,项目名称:roboconf-platform,代码行数:9,代码来源:TargetCompleter.java
示例12: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete( Session session, CommandLine commandLine, List<String> candidates ) {
StringsCompleter delegate = new StringsCompleter( false );
delegate.getStrings().addAll( SupportedPlugin.allString());
return delegate.complete( session, commandLine, candidates );
}
开发者ID:roboconf,项目名称:roboconf-platform,代码行数:9,代码来源:PluginCompleter.java
示例13: complete
import org.apache.karaf.shell.support.completers.StringsCompleter; //导入依赖的package包/类
@Override
public int complete(final Session session, final CommandLine commandLine, final List<String> candidates) {
return new StringsCompleter(logManager.getLoggers().keySet()).complete(session, commandLine, candidates);
}
开发者ID:sonatype,项目名称:nexus-public,代码行数:5,代码来源:LoggerNameCompleter.java
注:本文中的org.apache.karaf.shell.support.completers.StringsCompleter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论