Search in sources :

Example 16 with ShellTable

use of org.apache.karaf.shell.support.table.ShellTable in project karaf by apache.

the class HistoryCommand method execute.

@Override
public Object execute() throws Exception {
    List<ImageHistory> histories = getDockerService().history(image, url);
    ShellTable table = new ShellTable();
    table.column("ID");
    table.column("Created");
    table.column("Created By");
    table.column("Tags");
    table.column("Size");
    for (ImageHistory history : histories) {
        table.addRow().addContent(history.getId(), history.getCreated(), history.getCreatedBy(), history.getComment(), history.getTags(), history.getSize());
    }
    table.print(System.out);
    return null;
}
Also used : ShellTable(org.apache.karaf.shell.support.table.ShellTable) ImageHistory(org.apache.karaf.docker.ImageHistory)

Example 17 with ShellTable

use of org.apache.karaf.shell.support.table.ShellTable in project karaf by apache.

the class ListCommand method execute.

@Override
public Object execute() throws Exception {
    ShellTable table = new ShellTable();
    table.column("ID");
    table.column("Flight");
    table.column("Customer");
    for (Booking booking : bookingService.list()) {
        table.addRow().addContent(booking.getId(), booking.getFlight(), booking.getCustomer());
    }
    table.print(System.out);
    return null;
}
Also used : ShellTable(org.apache.karaf.shell.support.table.ShellTable) Booking(org.apache.karaf.examples.jdbc.api.Booking)

Example 18 with ShellTable

use of org.apache.karaf.shell.support.table.ShellTable in project karaf by apache.

the class ListCommand method execute.

@Override
public Object execute() throws Exception {
    ShellTable table = new ShellTable();
    table.column("ID");
    table.column("Flight");
    table.column("Customer");
    for (Booking booking : bookingService.list()) {
        table.addRow().addContent(booking.getId(), booking.getFlight(), booking.getCustomer());
    }
    table.print(System.out);
    return null;
}
Also used : ShellTable(org.apache.karaf.shell.support.table.ShellTable) Booking(org.apache.karaf.examples.jpa.Booking)

Example 19 with ShellTable

use of org.apache.karaf.shell.support.table.ShellTable in project karaf by apache.

the class ListCommand method execute.

@Override
public Object execute() throws Exception {
    ShellTable table = new ShellTable();
    table.column("ID");
    table.column("Flight");
    table.column("Customer");
    for (Booking booking : bookingService.list()) {
        table.addRow().addContent(booking.getId(), booking.getFlight(), booking.getCustomer());
    }
    table.print(System.out);
    return null;
}
Also used : ShellTable(org.apache.karaf.shell.support.table.ShellTable) Booking(org.apache.karaf.examples.command.api.Booking)

Example 20 with ShellTable

use of org.apache.karaf.shell.support.table.ShellTable in project karaf by apache.

the class GetLogLevel method execute.

@Override
public Object execute() throws Exception {
    if (logger == null || logger.equalsIgnoreCase("ALL")) {
        Map<String, String> loggers = logService.getLevel("ALL");
        ShellTable table = new ShellTable();
        table.column("Logger");
        table.column("Level");
        loggers.forEach((n, l) -> table.addRow().addContent(n, l));
        table.print(System.out, !noFormat);
    } else {
        Map<String, String> loggers = logService.getLevel(logger);
        String level = loggers.get(logger);
        System.out.println(level);
    }
    return null;
}
Also used : ShellTable(org.apache.karaf.shell.support.table.ShellTable)

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