Remove final bits if adsal from plugin-shell 30/16730/2
authorSam Hague <shague@redhat.com>
Tue, 17 Mar 2015 17:31:42 +0000 (13:31 -0400)
committerSam Hague <shague@redhat.com>
Wed, 18 Mar 2015 01:02:12 +0000 (21:02 -0400)
Change-Id: I95bfb93cd0fb1ab578f78a4f9dfce9539feae4eb
Signed-off-by: Sam Hague <shague@redhat.com>
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/InventoryServiceImpl.java
plugin-shell/pom.xml
plugin/pom.xml
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbInventoryService.java
plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/ConnectionServiceImpl.java
plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/InventoryServiceImpl.java
plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/IPAddressProperty.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/L4PortProperty.java [deleted file]

index 5e7e7d8d3ca021667b77066910c4fdadf45edb09..b2fd8aaabf9027c876f77459630b4e09d73c2a32 100644 (file)
@@ -130,7 +130,6 @@ public class InventoryServiceImpl implements OvsdbInventoryService,
 
     @Override
     public void addNode(Node node, Set<Property> props) {
-        pluginOvsdbInventoryService.addNode(NodeUtils.getMdsalNode(node), props);
     }
 
     @Override
@@ -140,7 +139,6 @@ public class InventoryServiceImpl implements OvsdbInventoryService,
 
     @Override
     public void addNodeProperty(Node node, UpdateType type, Set<Property> props) {
-        pluginOvsdbInventoryService.addNodeProperty(NodeUtils.getMdsalNode(node), type, props);
     }
 
     @Override
index 3cd6a7290f2cf9b7323987f740a12bf25bf5f0dc..dd610ac9c3939bf320d235a579e4d6c70758aab7 100644 (file)
@@ -65,10 +65,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <groupId>org.opendaylight.ovsdb</groupId>
       <artifactId>plugin</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-    </dependency>
   </dependencies>
 
   <build>
index 1a533e3a70aa76bb194f931f2ac048ebcd5acd5b..d966273ae49572291e553020ebed4240b368fe00 100755 (executable)
@@ -52,10 +52,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <groupId>org.apache.felix</groupId>
       <artifactId>org.apache.felix.dependencymanager</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.ovsdb</groupId>
       <artifactId>library</artifactId>
index 11fb684202447cd0fc0a76ac2f9e786cf9f79bcf..fc855550ed642badc59e7d1f001168258b522d38 100644 (file)
 package org.opendaylight.ovsdb.plugin.api;
 
 import java.net.InetAddress;
-import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
 
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
 import org.opendaylight.ovsdb.lib.message.TableUpdates;
 import org.opendaylight.ovsdb.lib.notation.Row;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
@@ -27,8 +24,6 @@ public interface OvsdbInventoryService {
     public void removeRow(Node n, String databaseName, String tableName, String uuid);
     public void processTableUpdates(Node n, String databaseName,TableUpdates tableUpdates);
     public void printCache(Node n);
-    public void addNode(Node n, Set<Property> props);
     public void notifyNodeAdded(Node n, InetAddress address, int port);
     public void removeNode(Node n);
-    public void addNodeProperty(Node node, UpdateType type, Set<Property> props);
 }
\ No newline at end of file
index a2d8403769e6f379f25b56f1df86d382ac055f14..88aeb4c132e01d96bee09e965e97359af387bf6e 100644 (file)
@@ -15,7 +15,6 @@ import java.io.IOException;
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -23,7 +22,6 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ExecutionException;
 
-import org.opendaylight.controller.sal.core.Property;
 import org.opendaylight.ovsdb.lib.MonitorCallBack;
 import org.opendaylight.ovsdb.lib.OvsdbClient;
 import org.opendaylight.ovsdb.lib.OvsdbConnection;
@@ -40,8 +38,6 @@ import org.opendaylight.ovsdb.plugin.api.Connection;
 import org.opendaylight.ovsdb.plugin.api.ConnectionConstants;
 import org.opendaylight.ovsdb.plugin.api.Status;
 import org.opendaylight.ovsdb.plugin.api.StatusCode;
-import org.opendaylight.ovsdb.plugin.internal.IPAddressProperty;
-import org.opendaylight.ovsdb.plugin.internal.L4PortProperty;
 import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
 import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
 import org.opendaylight.ovsdb.utils.config.ConfigProperties;
@@ -255,13 +251,6 @@ public class ConnectionServiceImpl implements OvsdbConnectionService,
         OvsdbClient client = connection.getClient();
         InetAddress address = client.getConnectionInfo().getRemoteAddress();
         int port = client.getConnectionInfo().getRemotePort();
-        IPAddressProperty addressProp = new IPAddressProperty(address);
-        L4PortProperty l4Port = new L4PortProperty(port);
-        Set<Property> props = new HashSet<Property>();
-        props.add(addressProp);
-        props.add(l4Port);
-        logger.info("Add node to ovsdb inventory service {}", connection.getNode().toString());
-        ovsdbInventoryService.addNode(connection.getNode(), props);
 
         List<String> databases = client.getDatabases().get();
         if (databases == null) {
index b5f6d2ea8c8840c587aa9b36863b97087486cb05..7edee2590a45309f3efce40b9c60aef4f102eefa 100644 (file)
 package org.opendaylight.ovsdb.plugin.impl;
 
 import java.net.InetAddress;
-import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
 import org.opendaylight.ovsdb.lib.message.TableUpdate;
 import org.opendaylight.ovsdb.lib.message.TableUpdates;
 import org.opendaylight.ovsdb.lib.notation.Row;
@@ -46,7 +42,6 @@ import com.google.common.collect.Maps;
 public class InventoryServiceImpl implements OvsdbInventoryService {
     private static final Logger logger = LoggerFactory
             .getLogger(InventoryServiceImpl.class);
-    private ConcurrentMap<Node, Map<String, Property>> nodeProps = new ConcurrentHashMap<Node, Map<String, Property>>();
     private ConcurrentMap<Node, NodeDatabase> dbCache = Maps.newConcurrentMap();
     private ScheduledExecutorService executor;
     private OvsdbConfigurationService ovsdbConfigurationService;
@@ -206,11 +201,6 @@ public class InventoryServiceImpl implements OvsdbInventoryService {
         }
     }
 
-    @Override
-    public void addNode(Node node, Set<Property> props) {
-        addNodeProperty(node, UpdateType.ADDED, props);
-    }
-
     @Override
     public void notifyNodeAdded(Node node, InetAddress address, int port) {
         if (!ovsdbInventoryListeners.isEmpty()) {
@@ -220,24 +210,6 @@ public class InventoryServiceImpl implements OvsdbInventoryService {
         }
     }
 
-    @Override
-    public void addNodeProperty(Node node, UpdateType type, Set<Property> props) {
-        Map<String, Property> nProp = nodeProps.get(node);
-        if (nProp == null) nProp = new HashMap<String, Property>();
-        for (Property prop : props) {
-            nProp.put(prop.getName(), prop);
-        }
-        nodeProps.put(node, nProp);
-        /*
-         * TODO: Remove following code. It updates to sal about newly added node and
-         * it's property. To move this bundle to MD-SAL we need to store this data in
-         * md-sal config/operational data store.
-        for (IPluginOutInventoryService service : pluginOutInventoryServices) {
-            service.updateNode(node, type, props);
-        }
-        */
-    }
-
     @Override
     public void removeNode(Node node) {
         if (!ovsdbInventoryListeners.isEmpty()) {
@@ -246,15 +218,6 @@ public class InventoryServiceImpl implements OvsdbInventoryService {
             }
         }
 
-        /*
-         * TODO: Remove following code. It updates to sal about newly added node and
-         * it's property. To move this bundle to MD-SAL we need to store this data in
-         * md-sal config/operational data store.
-         for (IPluginOutInventoryService service : pluginOutInventoryServices) {
-            service.updateNode(node, UpdateType.REMOVED, null);
-        }
-        */
-        nodeProps.remove(node);
         dbCache.remove(node);
     }
 
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/IPAddressProperty.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/IPAddressProperty.java
deleted file mode 100644 (file)
index 3111df2..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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, Brent Salisbury
- */
-
-package org.opendaylight.ovsdb.plugin.internal;
-import java.net.InetAddress;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.opendaylight.controller.sal.core.Property;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class IPAddressProperty extends Property implements Cloneable {
-    private static final long serialVersionUID = 1L;
-    @XmlElement(name="value")
-    private final InetAddress address;
-    public static final String name = "IPAddress";
-
-    /*
-     * Private constructor used for JAXB mapping
-     */
-    private IPAddressProperty() {
-        super(name);
-        this.address = null;
-    }
-
-    public IPAddressProperty(InetAddress address) {
-        super(name);
-        this.address = address;
-    }
-
-    @Override
-    public String getStringValue() {
-        if (address == null) return null;
-        return this.address.getHostAddress();
-    }
-
-    @Override
-    public Property clone() {
-        return new IPAddressProperty(this.address);
-    }
-
-    public InetAddress getAddress() {
-        return address;
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/L4PortProperty.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/L4PortProperty.java
deleted file mode 100644 (file)
index c31bdee..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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, Brent Salisbury
- */
-
-package org.opendaylight.ovsdb.plugin.internal;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.opendaylight.controller.sal.core.Property;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class L4PortProperty extends Property implements Cloneable {
-    private static final long serialVersionUID = 1L;
-    @XmlElement(name="value")
-    private final int port;
-    public static final String name = "Port";
-
-    /*
-     * Private constructor used for JAXB mapping
-     */
-    private L4PortProperty() {
-        super(name);
-        this.port = 0;
-    }
-
-    public L4PortProperty(int port) {
-        super(name);
-        this.port = port;
-    }
-
-    @Override
-    public String getStringValue() {
-        return port+"";
-    }
-
-    @Override
-    public Property clone() {
-        return new L4PortProperty(port);
-    }
-
-    public int getPort() {
-        return port;
-    }
-}