use of org.apache.karaf.shell.support.table.ShellTable in project karaf by apache.
the class QueuesCommand method execute.
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
table.column("JMS Queues");
for (String queue : getJmsService().queues(connectionFactory, username, password)) {
table.addRow().addContent(queue);
}
table.print(System.out);
return null;
}
use of org.apache.karaf.shell.support.table.ShellTable in project karaf by apache.
the class TopicsCommand method execute.
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
table.column("JMS Topics");
for (String topic : getJmsService().topics(connectionFactory, username, password)) {
table.addRow().addContent(topic);
}
table.print(System.out);
return null;
}
use of org.apache.karaf.shell.support.table.ShellTable in project karaf by apache.
the class ContextsCommand method execute.
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
table.column("JNDI Sub-Context");
List<String> contexts;
if (context == null) {
contexts = jndiService.contexts();
} else {
contexts = jndiService.contexts(context);
}
for (String c : contexts) {
table.addRow().addContent(c);
}
table.print(System.out);
return null;
}
use of org.apache.karaf.shell.support.table.ShellTable in project karaf by apache.
the class ListKarCommand method execute.
@Override
public Object execute() throws Exception {
ShellTable table = new ShellTable();
table.column("KAR Name");
for (String karName : karService.list()) {
table.addRow().addContent(karName);
}
table.print(System.out, !noFormat);
return null;
}
use of org.apache.karaf.shell.support.table.ShellTable in project karaf by apache.
the class ListAction method doScrAction.
@Override
protected Object doScrAction(ServiceComponentRuntime serviceComponentRuntime) throws Exception {
ShellTable table = new ShellTable();
table.column("ID");
table.column("State");
table.column("Component Name");
List<ComponentConfigurationDTO> configs = new ArrayList<>();
for (ComponentDescriptionDTO component : serviceComponentRuntime.getComponentDescriptionDTOs()) {
configs.addAll(serviceComponentRuntime.getComponentConfigurationDTOs(component));
}
Collections.sort(configs, idComparator);
for (ComponentConfigurationDTO config : configs) {
// Display only non hidden components, or all if showHidden is true
if (showHidden || !ScrActionSupport.isHiddenComponent(config)) {
table.addRow().addContent(config.id, ScrUtils.getState(config.state), config.description.name);
}
}
table.print(System.out);
return null;
}
Aggregations