Search in sources :

Example 1 with OpenstackVtapService

use of org.onosproject.openstackvtap.api.OpenstackVtapService in project onos by opennetworkinglab.

the class VtapIdCompleter method complete.

@Override
public int complete(Session session, CommandLine commandLine, List<String> candidates) {
    OpenstackVtap.Type type = getVtapTypeFromString(VTAP_TYPE);
    // Delegate string completer
    StringsCompleter delegate = new StringsCompleter();
    SortedSet<String> strings = delegate.getStrings();
    OpenstackVtapService service = AbstractShellCommand.get(OpenstackVtapService.class);
    service.getVtaps(type).forEach(t -> {
        strings.add(t.id().toString());
    });
    return delegate.complete(session, commandLine, candidates);
}
Also used : OpenstackVtapService(org.onosproject.openstackvtap.api.OpenstackVtapService) OpenstackVtap(org.onosproject.openstackvtap.api.OpenstackVtap) StringsCompleter(org.apache.karaf.shell.support.completers.StringsCompleter) OpenstackVtapUtil.getVtapTypeFromString(org.onosproject.openstackvtap.util.OpenstackVtapUtil.getVtapTypeFromString)

Aggregations

StringsCompleter (org.apache.karaf.shell.support.completers.StringsCompleter)1 OpenstackVtap (org.onosproject.openstackvtap.api.OpenstackVtap)1 OpenstackVtapService (org.onosproject.openstackvtap.api.OpenstackVtapService)1 OpenstackVtapUtil.getVtapTypeFromString (org.onosproject.openstackvtap.util.OpenstackVtapUtil.getVtapTypeFromString)1