Package org.apache.karaf.shell.console.completer

Examples of org.apache.karaf.shell.console.completer.StringsCompleter


        return "--version";
    }

    @Override
    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        ProfileService profileService = fabricService.adapt(ProfileService.class);
        List<String> versions = profileService.getVersions();
        for (String version : versions) {
            delegate.getStrings().add(version);
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here


        return "--container";
    }

    @Override
    public int complete(String buffer, int cursor, List<String> candidates) {
            StringsCompleter delegate = new StringsCompleter();
            for (Container container : getFabricService().getContainers()) {
                if (apply(container)) {
                    delegate.getStrings().add(container.getId());
                }
            }
            return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

        return "--profile";
    }

    @Override
    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            Version version = fabricService.getRequiredDefaultVersion();
            List<Profile> profiles = version.getProfiles();
            for (Profile profile : profiles) {
                delegate.getStrings().add(profile.getId());
            }
        } catch (Exception ex) {
            //Ignore Exceptions
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

        }
    }

    @Override
    public int complete(final String buffer, final int cursor, final List candidates) {
        StringsCompleter delegate = new StringsCompleter(kinds);
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

    @Reference
    private ProcessManager processManager;

    @Override
    public int complete(final String buffer, final int cursor, final List candidates) {
        StringsCompleter delegate = new StringsCompleter();

        List<Installation> installations = processManager.listInstallations();
        for (Installation installation : installations) {
            String id = "" + installation.getId();
            delegate.getStrings().add(id);
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

            "org.apache.camel.test.blueprint.Main"
    };

    @Override
    public int complete(final String buffer, final int cursor, final List candidates) {
        StringsCompleter delegate = new StringsCompleter(mainClasses);
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

    private List<String> archetypes = new ArrayList<String>();

    @Override
    public int complete(final String buffer, final int cursor, final List candidates) {
        StringsCompleter delegate = new StringsCompleter(archetypes);
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

        this.uninstalled = true;
    }

    @Override
    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        for (Patch patch : service.getPatches()) {
            if (isInstalled() && patch.isInstalled()
                    || isUninstalled() && !patch.isInstalled()) {
                delegate.getStrings().add(patch.getId());
            }
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

        return "--pod";
    }

    @Override
    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            Kubernetes kubernetes = kubernetesService.getKubernetes();
            if (kubernetes != null) {
                PodListSchema pods = kubernetes.getPods();
                if (pods != null) {
                    List<PodSchema> items = pods.getItems();
                    if (items != null) {
                        for (PodSchema item : items) {
                            String id = item.getId();
                            delegate.getStrings().add(id);
                        }
                    }
                }
            }
        } catch (Exception ex) {
            LOG.warn("Caught: " + ex, ex);
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

        return "--replicationController";
    }

    @Override
    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            Kubernetes kubernetes = kubernetesService.getKubernetes();
            if (kubernetes != null) {
                ReplicationControllerListSchema list = kubernetes.getReplicationControllers();
                if (list != null) {
                    List<ReplicationControllerSchema> items = list.getItems();
                    if (items != null) {
                        for (ReplicationControllerSchema item : items) {
                            String id = item.getId();
                            delegate.getStrings().add(id);
                        }
                    }
                }
            }
        } catch (Exception ex) {
            LOG.warn("Caught: " + ex, ex);
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.console.completer.StringsCompleter

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.