Eliminate blueprint for drop-test-karaf commands
[openflowplugin.git] / drop-test-karaf / src / main / java / org / opendaylight / openflowplugin / droptestkaraf / DropAllPacketsCompleter.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowplugin.droptestkaraf;
9
10 import java.util.List;
11 import org.apache.karaf.shell.api.action.lifecycle.Service;
12 import org.apache.karaf.shell.api.console.CommandLine;
13 import org.apache.karaf.shell.api.console.Completer;
14 import org.apache.karaf.shell.api.console.Session;
15 import org.apache.karaf.shell.support.completers.StringsCompleter;
16
17 /**
18  * General dropAllPackets on/off argument completer.
19  */
20 @Service
21 public class DropAllPacketsCompleter implements Completer {
22
23     @Override
24     public int complete(final Session session, final CommandLine commandLine, final List<String> candidates) {
25         final var delegate = new StringsCompleter();
26         delegate.getStrings().add("on");
27         delegate.getStrings().add("off");
28         return delegate.complete(session, commandLine, candidates);
29     }
30 }