本文整理汇总了Java中org.apache.karaf.shell.support.table.ShellTable.column方法的典型用法代码示例。如果您正苦于以下问题:Java ShellTable.column方法的具体用法?Java ShellTable.column怎么用?Java ShellTable.column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.karaf.shell.support.table.ShellTable
的用法示例。
在下文中一共展示了ShellTable.column方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
table.column("ID");
table.column("Identifier");
table.column("Options");
getVertxService().deploymentIDs().forEach(id -> {
Deployment deployment = ((VertxInternal)getVertxService()).getDeployment(id);
Row row = table.addRow();
row.addContent(id, deployment.verticleIdentifier(), deployment.deploymentOptions().toJson());
}
);
try {
table.print(System.out);
} catch (Throwable t) {
System.err.println("FAILED to write table");
}
return null;
}
示例2: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
SharedData sharedData = getVertxService().sharedData();
LocalMap<Object, Object> map = sharedData.getLocalMap(this.map);
ShellTable table = new ShellTable();
table.column("Map[" + this.map + "]\nKey");
table.column("\nValue");
if (keys != null) {
keys.forEach(key -> {
renderRow(map, table, key);
});
} else {
map.keySet().forEach(key -> {
renderRow(map, table, (String) key);
});
}
table.print(System.out);
return null;
}
示例3: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
table.column("Name");
table.column("Version");
table.column("Bundle Id");
table.column("State");
for (Factory factory : managerService.getFactories()) {
table.addRow().addContent(factory.getName(), factory.getVersion(), factory.getBundleContext().getBundle().getBundleId(), (factory.getState() == Factory.VALID ? Ansi.ansi().fg(Ansi.Color.GREEN).a("VALID").reset().toString() : Ansi.ansi().fg(Ansi.Color.GREEN).a((factory.getState() == Factory.INVALID ? "INVALID" : "UNKNOWN")).reset().toString()));
}
table.print(System.out);
return null;
}
示例4: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
table.column("Name");
table.column("Bundle Id");
table.column("State");
for (Architecture architecture : managerService.getArchitectures()) {
InstanceDescription instanceDescription = architecture.getInstanceDescription();
if (verbose || instanceDescription.getState() != ComponentInstance.DISPOSED) {
table.addRow().addContent(instanceDescription.getName(), instanceDescription.getBundleId(), IPojoManagerService.instanceDescriptionState(instanceDescription.getState()));
}
}
table.print(System.out);
return null;
}
示例5: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
table.column("Alias");
table.column("Class");
//table.column("Bundle Id");
//table.column("State");
for (RestService restProvider : managerService.getProviders()) {
table.addRow().addContent(restProvider.getAlias(), restProvider.getClass().getName());
}
table.print(System.out);
return null;
}
示例6: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
table.column("Path");
table.column("Bundle Id");
table.column("Bundle");
table.column("UI Class");
table.column("Production Mode");
//table.column("Bundle Id");
//table.column("State");
for (VaadinProvider vaadinProvider : vaadinManager.getProviders()) {
Bundle bundle = FrameworkUtil.getBundle(vaadinProvider.getClass());
table.addRow().addContent(vaadinProvider.getPath(), bundle.getBundleId(), bundle.getSymbolicName(), vaadinProvider.getUIClass().getSimpleName(), vaadinProvider.productionMode());
}
table.print(System.out);
return null;
}
示例7: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
List<Task<?>> tasks = taskExecutorService.getTasks();
ShellTable table = new ShellTable();
table.column("ID");
table.column("Name");
table.column("Description");
table.column("StartTime");
table.column("Pourcentage");
for (Task<?> task : tasks) {
Date startDate = new Date(task.getStartTime());
String pourcentage = Integer.toString((int) (task.getCompletionPourcentage() * 100.0)) + "%";
table.addRow().addContent(task.getIdentifier(),
task.getName(),
task.getDescription(),
startDate.toString(),
pourcentage);
}
table.print(session.getConsole());
return null;
}
示例8: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
final ShellTable table = new ShellTable();
table.column(new Col("Alias"));
table.column(new Col("Reference"));
final CredentialStore credentialStore = CredentialStoreHelper.credentialStoreFromEnvironment();
for (final String alias : credentialStore.getAliases()) {
table.addRow().addContent(alias, CredentialStoreHelper.referenceForAlias(alias));
}
table.print(System.out);
return null;
}
示例9: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
table.column("Provider");
table.column("Mapper");
for (JacksonJaxrsService provider : managerService.getJaxrsProviders()) {
table.addRow().addContent(provider.getProviderClass().getName(), provider.getMapperClass().getName());
}
table.print(System.out);
return null;
}
示例10: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
// ID
Col column = table.column("ID");
column.alignCenter().bold();
// Label
column = table.column("Name");
column.alignCenter().cyan();
// Version
column = table.column("Version");
column.alignCenter().cyan();
// Create Date
column = table.column("Create Date");
column.alignCenter();
// Modify Date
column = table.column("Modify Date");
column.alignCenter();
// Deleted
column = table.column("Deleted");
column.alignCenter();
List<? extends IPolicy> list = policyDao.findAll(IPolicy.class, null);
if (list != null) {
for (IPolicy policy : list) {
Row row = table.addRow();
row.addContent(policy.getId(), policy.getLabel(), policy.getPolicyVersion(), policy.getCreateDate(),
policy.getModifyDate() != null ? policy.getModifyDate() : "", policy.isDeleted() ? "x" : "");
}
}
table.print(System.out);
return null;
}
示例11: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
// ID
Col column = table.column("ID");
column.alignCenter().bold();
// DN List
column = table.column("DN List");
column.alignCenter().cyan().maxSize(100);
// DN Type
column = table.column("DN Type");
column.alignCenter().cyan();
// Owner UID
column = table.column("Owner UID");
column.alignCenter();
// Policy ID
column = table.column("Related Policy ID");
column.alignCenter();
// Task ID
column = table.column("Related Task ID");
column.alignCenter();
List<? extends ICommand> list = commandDao.findAll(ICommand.class, null);
if (list != null) {
for (ICommand command : list) {
Row row = table.addRow();
row.addContent(command.getId(), command.getDnList(), command.getDnType(), command.getCommandOwnerUid(),
command.getPolicy() != null ? command.getPolicy().getId() : null,
command.getTask() != null ? command.getTask().getId() : null);
}
}
table.print(System.out);
return null;
}
示例12: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
// ID
Col column = table.column("ID");
column.alignCenter().bold();
// Label
column = table.column("Label");
column.alignCenter().cyan();
// Plugin
column = table.column("Related Plugin");
column.alignCenter();
// Create Date
column = table.column("Create Date");
column.alignCenter();
// Deleted
column = table.column("Deleted");
column.alignCenter();
List<? extends IProfile> list = profileDao.findAll(IProfile.class, null);
if (list != null) {
for (IProfile profile : list) {
Row row = table.addRow();
row.addContent(profile.getId(), profile.getLabel(),
profile.getPlugin().getName() + "-" + profile.getPlugin().getVersion(), profile.getCreateDate(),
profile.isDeleted() ? "x" : "");
}
}
table.print(System.out);
return null;
}
示例13: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
// ID
Col column = table.column("ID");
column.alignCenter().bold();
// Label
column = table.column("Name");
column.alignCenter().cyan();
// Version
column = table.column("Version");
column.alignCenter().cyan();
// Create Date
column = table.column("Create Date");
column.alignCenter();
// Modify Date
column = table.column("Modify Date");
column.alignCenter();
// Deleted
column = table.column("Deleted");
column.alignCenter();
List<? extends IPlugin> list = pluginDao.findAll(IPlugin.class, null);
if (list != null) {
for (IPlugin plugin : list) {
if (name != null && !name.equalsIgnoreCase(plugin.getName())) {
continue;
}
Row row = table.addRow();
row.addContent(plugin.getId(), plugin.getName(), plugin.getVersion(), plugin.getCreateDate(),
plugin.getModifyDate() != null ? plugin.getModifyDate() : "", plugin.isDeleted() ? "x" : "");
}
}
table.print(System.out);
return null;
}
示例14: execute
import org.apache.karaf.shell.support.table.ShellTable; //导入方法依赖的package包/类
/**
* Performs the creation of Credential store according to the given command line options.
*/
@Override
public Object execute() throws Exception {
final Map<String, String> attributes = attributesFromOptions(storeAttributes);
final Provider providerToUse = ProviderHelper.provider(provider);
final Map<String, String> credentialSourceConfiguration = createCredentialSourceConfiguration(credentialType,
credentialAttributes);
final CredentialSource credential = credentialType.createCredentialSource(credentialSourceConfiguration);
createCredentialStore(storeAlgorithm, attributes, credential, providerToUse);
final ShellTable table = new ShellTable();
table.column(new Col("Variable"));
table.column(new Col("Value"));
final StringBuilder buffy = new StringBuilder();
if (credentialType != Defaults.CREDENTIAL_TYPE) {
appendConfigurationTo(Collections.singletonMap("CREDENTIAL_STORE_PROTECTION_TYPE", credentialType.name()),
table, buffy);
}
appendConfigurationTo(credentialSourceConfiguration, table, buffy);
appendConfigurationTo(attributes.entrySet().stream()
.collect(Collectors.toMap(e -> "CREDENTIAL_STORE_ATTR_" + e.getKey(), Entry::getValue)), table, buffy);
System.out.println("In order to use this credential store set the following environment variables");
table.print(System.out);
System.out.println("Or simply use this:");
System.out.print(buffy.toString());
return null;
}