Examples of StringsCompleter


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

    @Override
    public int complete(final String buffer,
                        final int cursor,
                        @SuppressWarnings("rawtypes") final List candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            List<Bus> busses = cxfController.getBusses();
          
            for (Bus bus : busses) {
                delegate.getStrings().add(bus.getId());
            }
           
        } catch (Exception e) {
            // Ignore
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

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

    @Override
    public int complete(final String buffer,
                        final int cursor,
                        @SuppressWarnings("rawtypes") final List candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            List<Bus> busses = cxfController.getBusses();
          
            for (Bus b : busses) {
                ServerRegistry reg = b.getExtension(ServerRegistry.class);
                List<Server> servers = reg.getServers();
               
                for (Server serv : servers) {
                    if (acceptsFeature(serv)) {
                        String qname = serv.getEndpoint().getEndpointInfo().getName().getLocalPart();
                        delegate.getStrings().add(qname);
                    }
                }
            }
           
        } catch (Exception e) {
            // Ignore
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

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

public class DataSourcesFileNameCompleter implements Completer {

    private JdbcService jdbcService;

    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            for (String datasourceFileName : jdbcService.datasourceFileNames()) {
                delegate.getStrings().add(datasourceFileName.replace("datasource-", "").replace(".xml", ""));
            }
        } catch (Exception e) {
            // nothing to do
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

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

public class DataSourcesNameCompleter implements Completer {

    private JdbcService jdbcService;

    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            for (String datasource : jdbcService.datasources()) {
                delegate.getStrings().add(datasource);
            }
        } catch (Exception e) {
            // nothing to do
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

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

    public void setFeatureFinder(FeatureFinder featureFinder) {
        this.featureFinder = featureFinder;
    }

    public int complete(final String buffer, final int cursor, @SuppressWarnings("rawtypes") final List candidates) {
        StringsCompleter delegate = new StringsCompleter(Arrays.asList(featureFinder.getNames()));
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

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

public class RealmCompleter implements Completer {

    private List<JaasRealm> realms;

    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            if (realms != null && !realms.isEmpty())
                for (JaasRealm realm : realms) {
                    delegate.getStrings().add(realm.getName());
                }
        } catch (Exception e) {
            // Ignore
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

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

public class LoginModuleNameCompleter implements Completer {

    private List<JaasRealm> realms;

    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            if (realms != null && !realms.isEmpty())
                for (JaasRealm realm : realms) {
                    List<String> moduleClassNames = findLoginModuleClassNames(realm);
                    if (moduleClassNames != null && !moduleClassNames.isEmpty())
                    delegate.getStrings().addAll(moduleClassNames);
                }
        } catch (Exception e) {
            // Ignore
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

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

public class ConnectionFactoriesFileNameCompleter implements Completer {

    private JmsService jmsService;

    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            for (String connectionFactory : jmsService.connectionFactoryFileNames()) {
                delegate.getStrings().add(connectionFactory.replace("connectionfactory-", "").replace(".xml", ""));
            }
        } catch (Exception e) {
            // nothing to do
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

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

public class ConnectionFactoriesNameCompleter implements Completer {

    private JmsService jmsService;

    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            for (String connectionFactory : jmsService.connectionFactories()) {
                delegate.getStrings().add(connectionFactory);
            }
        } catch (Exception e) {
            // nothing to do
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here

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

     *
     * @see org.apache.karaf.shell.console.Completer#complete(java.lang.String,
     *      int, java.util.List)
     */
    public int complete(String buffer, int cursor, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            for (Component component : scrService.getComponents()) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Component Name to work on: " + component.getName());
                }
                if (ScrActionSupport.showHiddenComponent(component)) {
                    // We display all because we are overridden
                    if (availableComponent(component)) {
                        delegate.getStrings().add(component.getName());
                    }
                } else {
                    if (ScrActionSupport.isHiddenComponent(component)) {
                        // do nothing
                    } else {
                        // We aren't hidden so print it
                        if (availableComponent(component)) {
                            delegate.getStrings().add(component.getName());
                        }
                    }
                }
            }
        } catch (Exception e) {
            logger.warn("Exception completing the command request: " + e.getLocalizedMessage());
        }
        return delegate.complete(buffer, cursor, candidates);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.