2 * Copyright (C) 2013 Red Hat, Inc.
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
8 * Authors : Madhu Venugopal
10 package org.opendaylight.ovsdb.plugin.shell;
12 import org.apache.felix.gogo.commands.Argument;
13 import org.apache.felix.gogo.commands.Command;
14 import org.apache.karaf.shell.console.OsgiCommandSupport;
15 import org.opendaylight.controller.sal.core.Node;
16 import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
18 @Command(scope = "ovs", name = "printCache", description="Prints OVSDB Cache")
19 public class PrintCache extends OsgiCommandSupport{
20 private OvsdbInventoryService ovsdbInventory;
22 @Argument(index=0, name="nodeName", description="Node Name", required=true, multiValued=false)
23 String nodeName = null;
26 protected Object doExecute() throws Exception {
27 Node node = Node.fromString(nodeName);
28 ovsdbInventory.printCache(node);
32 public void setOvsdbInventory(OvsdbInventoryService inventoryService){
33 this.ovsdbInventory = inventoryService;