Package org.apache.karaf.shell.table

Examples of org.apache.karaf.shell.table.ShellTable


    public void setWebContainerService(WebContainerService webContainerService) {
        this.webContainerService = webContainerService;
    }
   
    public Object doExecute() throws Exception {
      ShellTable table = new ShellTable();
        table.column(new Col("ID"));
        table.column(new Col("State"));
        table.column(new Col("Web-State"));
        table.column(new Col("Level"));
        table.column(new Col("Web-ContextPath"));
        table.column(new Col("Name"));
       
        java.util.List<WebBundle> webBundles = webContainerService.list();
        if (webBundles != null && !webBundles.isEmpty()) {
            for (WebBundle webBundle : webBundles) {
              table.addRow().addContent(
                        webBundle.getBundleId(),
                        webBundle.getState(),
                        webBundle.getWebState(),
                        webBundle.getLevel(),
                        webBundle.getContextPath(),
                        webBundle.getName());
            }
           
        }
        table.print(System.out);
        return null;
    }
View Full Code Here


@Command(scope = "kar", name = "list", description = "List the installed KAR files.")
public class ListKarCommand extends KarCommandSupport {
   
    public Object doExecute() throws Exception {

        ShellTable table = new ShellTable();
        table.column("KAR Name");

        for (String karName : this.getKarService().list()) {
            table.addRow().addContent(karName);
        }

        table.print(System.out);

        return null;
    }
View Full Code Here

    protected void printMethodList(CommandSession session, PrintStream out, SortedMap<String, String> commands) {
        Terminal term = (Terminal) session.get(".jline.terminal");
        int termWidth = term != null ? term.getWidth() : 80;
        out.println(Ansi.ansi().a(Ansi.Attribute.INTENSITY_BOLD).a("COMMANDS").a(Ansi.Attribute.RESET));
        ShellTable table = new ShellTable().noHeaders().separator(" ").size(termWidth);
        table.column(new Col("Command").maxSize(35));
        table.column(new Col("Description"));
        for (Map.Entry<String,String> entry : commands.entrySet()) {
            String key = NameScoping.getCommandNameWithoutGlobalPrefix(session, entry.getKey());
            table.addRow().addContent(key, entry.getValue());
        }
        table.print(out);
    }
View Full Code Here

        this.servletService = servletService;
    }

    @Override
    protected Object doExecute() throws Exception {
        ShellTable table = new ShellTable();
        table.column(new Col("ID"));
        table.column(new Col("Servlet"));
        table.column(new Col("Servlet-Name"));
        table.column(new Col("State"));
        table.column(new Col("Alias"));
        table.column(new Col("Url"));

        for (ServletInfo info : servletService.getServlets()) {
            table.addRow().addContent(info.getBundle().getBundleId(), info.getClassName(), info.getName(),
                                      info.getStateString(), info.getAlias(), Arrays.toString(info.getUrls()));
        }
        table.print(System.out);
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.table.ShellTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.