More commands to follow soon.
Change-Id: Iee05b833d8d59394bf4ce09d99a9d85322e110c9
Signed-off-by: Madhu Venugopal <mavenugo@gmail.com>
<!-- OVSB Component Versions -->
<ovsdb.library.version>1.0.0-SNAPSHOT</ovsdb.library.version>
<ovsdb.plugin.version>1.0.0-SNAPSHOT</ovsdb.plugin.version>
+ <plugin.shell.version>1.0.0-SNAPSHOT</plugin.shell.version>
<openstack.netvirt.version>1.0.0-SNAPSHOT</openstack.netvirt.version>
<openstack.netvirt.providers.version>1.0.0-SNAPSHOT</openstack.netvirt.providers.version>
<ovsdb.northbound.version>0.6.0-SNAPSHOT</ovsdb.northbound.version>
<portlet.version>2.0</portlet.version>
<powermock.version>1.5.2</powermock.version>
<httpcomponents.version>4.2.1</httpcomponents.version>
+ <karaf.shell.version>3.0.0</karaf.shell.version>
</properties>
<dependencyManagement>
<feature version="${schema.openvswitch.version}">odl-ovsdb-schema-openvswitch</feature>
<feature version="${schema.hardwarevtep.version}">odl-ovsdb-schema-hardwarevtep</feature>
<bundle>mvn:org.opendaylight.ovsdb/plugin/${ovsdb.plugin.version}</bundle>
+ <bundle>mvn:org.opendaylight.ovsdb/plugin-shell/${plugin.shell.version}</bundle>
</feature>
<feature name="odl-ovsdb-northbound" description="OpenDaylight :: OVSDB :: Northbound" version='${ovsdb.northbound.version}'>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>commons</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <relativePath>../commons/parent</relativePath>
+ </parent>
+
+ <artifactId>plugin-shell</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <name>OpenDaylight OVSDB Plugin Shell</name>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.shell</groupId>
+ <artifactId>org.apache.karaf.shell.console</artifactId>
+ <version>${karaf.shell.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>plugin</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>2.3.6</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Import-Package>org.apache.felix.service.command,
+ org.apache.karaf.shell.commands,
+ org.apache.karaf.shell.console,
+ *</Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
--- /dev/null
+/**
+ * Copyright (C) 2013 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+package org.opendaylight.ovsdb.plugin.shell;
+
+import java.util.Collection;
+import java.util.concurrent.ConcurrentMap;
+
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.ovsdb.lib.notation.Column;
+import org.opendaylight.ovsdb.lib.notation.Row;
+import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
+
+@Command(scope = "ovs", name = "printCache", description="Prints OVSDB Cache")
+public class PrintCache extends OsgiCommandSupport{
+ private OvsdbInventoryService ovsdbInventory;
+
+ @Argument(index=0, name="nodeName", description="Node Name", required=true, multiValued=false)
+ String nodeName = null;
+
+ @Override
+ protected Object doExecute() throws Exception {
+ Node node = Node.fromString(nodeName);
+ ovsdbInventory.printCache(node);
+ return null;
+ }
+
+ public void setOvsdbInventory(OvsdbInventoryService inventoryService){
+ this.ovsdbInventory = inventoryService;
+ }
+}
--- /dev/null
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+ <reference id="ovsdbInventoryRef" interface="org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService"/>
+ <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
+ <command>
+ <action class="org.opendaylight.ovsdb.plugin.shell.PrintCache">
+ <property name="ovsdbInventory" ref="ovsdbInventoryRef"/>
+ </action>
+ </command>
+ </command-bundle>
+</blueprint>
<module>schemas/openvswitch</module>
<module>schemas/hardwarevtep</module>
<module>plugin</module>
+ <module>plugin-shell</module>
<module>plugin-mdsal-adapter</module>
<module>northbound</module>
<module>utils/mdsal-openflow</module>