Search in sources :

Example 21 with ShellTable

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;
}
Also used : ShellTable(org.apache.karaf.shell.support.table.ShellTable)

Example 22 with ShellTable

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;
}
Also used : ShellTable(org.apache.karaf.shell.support.table.ShellTable)

Example 23 with ShellTable

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;
}
Also used : ShellTable(org.apache.karaf.shell.support.table.ShellTable)

Example 24 with ShellTable

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;
}
Also used : ShellTable(org.apache.karaf.shell.support.table.ShellTable)

Example 25 with ShellTable

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;
}
Also used : ShellTable(org.apache.karaf.shell.support.table.ShellTable) ComponentDescriptionDTO(org.osgi.service.component.runtime.dto.ComponentDescriptionDTO) ArrayList(java.util.ArrayList) ComponentConfigurationDTO(org.osgi.service.component.runtime.dto.ComponentConfigurationDTO)

Aggregations

ShellTable (org.apache.karaf.shell.support.table.ShellTable)59 Row (org.apache.karaf.shell.support.table.Row)10 Col (org.apache.karaf.shell.support.table.Col)7 ArrayList (java.util.ArrayList)4 Bundle (org.osgi.framework.Bundle)4 Map (java.util.Map)3 Feature (org.apache.karaf.features.Feature)3 Repository (org.apache.karaf.features.Repository)3 List (java.util.List)2 TreeMap (java.util.TreeMap)2 Bus (org.apache.cxf.Bus)2 Booking (org.apache.karaf.examples.jdbc.api.Booking)2 Booking (org.apache.karaf.examples.jpa.Booking)2 MavenRepositoryURL (org.apache.karaf.maven.core.MavenRepositoryURL)2 Attribute (ddf.catalog.data.Attribute)1 Result (ddf.catalog.data.Result)1 SortByImpl (ddf.catalog.filter.impl.SortByImpl)1 QueryRequest (ddf.catalog.operation.QueryRequest)1 SourceResponse (ddf.catalog.operation.SourceResponse)1 QueryImpl (ddf.catalog.operation.impl.QueryImpl)1