Search in sources :

Example 1 with VplsCommandEnum

use of org.onosproject.vpls.cli.VplsCommandEnum in project onos by opennetworkinglab.

the class VplsOptArgCompleter method choices.

@Override
public List<String> choices() {
    if (vpls == null) {
        vpls = get(Vpls.class);
    }
    String[] argList = commandLine.getArguments();
    if (argList == null) {
        return Collections.emptyList();
    }
    String argOne = argList[1];
    VplsCommandEnum vplsCommandEnum = VplsCommandEnum.enumFromString(argOne);
    if (vplsCommandEnum != null) {
        switch(vplsCommandEnum) {
            case ADD_IFACE:
                return availableIfaces();
            case SET_ENCAP:
                return encap();
            case REMOVE_IFACE:
                return vplsIfaces();
            default:
                return Collections.emptyList();
        }
    }
    return Collections.emptyList();
}
Also used : VplsCommandEnum(org.onosproject.vpls.cli.VplsCommandEnum) Vpls(org.onosproject.vpls.api.Vpls)

Example 2 with VplsCommandEnum

use of org.onosproject.vpls.cli.VplsCommandEnum in project onos by opennetworkinglab.

the class VplsCommandCompleter method choices.

@Override
public List<String> choices() {
    if (commandLine.getArguments() == null) {
        return Collections.emptyList();
    }
    List<String> argList = Lists.newArrayList();
    String argOne = null;
    if (argList.size() > 1) {
        argOne = argList.get(1);
    }
    VplsCommandEnum vplsCommandEnum = VplsCommandEnum.enumFromString(argOne);
    if (vplsCommandEnum != null) {
        switch(vplsCommandEnum) {
            case CREATE:
            case LIST:
                return Collections.emptyList();
            default:
                VplsCommandEnum.toStringList();
        }
    }
    return VplsCommandEnum.toStringList();
}
Also used : VplsCommandEnum(org.onosproject.vpls.cli.VplsCommandEnum)

Aggregations

VplsCommandEnum (org.onosproject.vpls.cli.VplsCommandEnum)2 Vpls (org.onosproject.vpls.api.Vpls)1