This patch removes the deprecated connection and configuration services.
Change-Id: I7fb47f6bff838a591fa9405d50a3753815e4b246
Signed-off-by: Sam Hague <shague@redhat.com>
+++ /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, Brent Salisbury
- */
-package org.opendaylight.ovsdb.plugin;
-
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * OVSDB Plugin Connection
- * @deprecated as of release 1.0.0, replaced by {@link org.opendaylight.ovsdb.plugin.api.Connection}
- */
-@Deprecated public class Connection {
- private Node node;
- private String identifier;
- private OvsdbClient client;
-
- public Long getIdCounter() {
- return idCounter;
- }
-
- public void setIdCounter(Long idCounter) {
- this.idCounter = idCounter;
- }
-
- private Long idCounter;
-
- private static final Logger logger = LoggerFactory.getLogger(Connection.class);
-
- public Connection(String identifier, OvsdbClient client) {
-
- super();
-
- this.identifier = identifier;
- this.client = client;
- this.idCounter = 0L;
- try {
- node = new Node("OVS", identifier);
- } catch (ConstructionException e) {
- logger.error("Error creating OVS node with identifier " + identifier, e);
- }
- }
-
- public String getIdentifier() {
- return identifier;
- }
-
- public void setIdentifier(String identifier) {
- this.identifier = identifier;
- }
-
- public OvsdbClient getClient() {
- return this.client;
- }
-
- public void setClient(OvsdbClient client) {
- this.client = client;
- }
-
- public Node getNode() {
- return node;
- }
-
- public void setNode(Node node) {
- this.node = node;
- }
-
- public void disconnect() {
- client.disconnect();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null) return false;
- if (getClass() != obj.getClass()) return false;
- Connection other = (Connection) obj;
- if (identifier == null) {
- if (other.identifier != null) return false;
- } else if (!identifier.equals(other.identifier)) return false;
- return true;
- }
-}
+++ /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, Brent Salisbury
- */
-package org.opendaylight.ovsdb.plugin;
-
-import org.opendaylight.controller.sal.connection.ConnectionConstants;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * OVSDB Plugin Connection Service
- * @deprecated as of release 1.0.0, replaced by {@link org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService}
- */
-@Deprecated public interface IConnectionServiceInternal {
- public Connection getConnection(Node node);
- public List<Node> getNodes();
- public Node connect(String identifier, Map<ConnectionConstants, String> params);
-}
+++ /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, Brent Salisbury
- */
-package org.opendaylight.ovsdb.plugin;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.inventory.IPluginInInventoryService;
-import org.opendaylight.ovsdb.lib.message.TableUpdates;
-import org.opendaylight.ovsdb.lib.notation.Row;
-
-import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * OVSDB Plugin Inventory Service
- * @deprecated as of release 1.0.0, replaced by {@link org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService }
- */
-@Deprecated public interface InventoryServiceInternal extends IPluginInInventoryService {
- public ConcurrentMap<String, ConcurrentMap<String, Row>> getCache(Node n, String databaseName);
- public ConcurrentMap<String, Row> getTableCache(Node n, String databaseName, String tableName);
- public Row getRow (Node n, String databaseName, String tableName, String uuid);
- public void updateRow(Node n, String databaseName, String tableName, String uuid, Row row);
- 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);
- public void removeNode(Node n);
- public void addNodeProperty(Node node, UpdateType type, Set<Property> props);
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (C) 2014 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;
-
-import org.opendaylight.ovsdb.utils.config.ConfigProperties;
-
-import com.google.common.collect.Maps;
-
-import java.util.Map;
-
-/**
- * Open vSwitch Schema Constants
- * @deprecated as of release 1.0.0, replaced by {@link org.opendaylight.ovsdb.plugin.api.OvsVswitchdSchemaConstants }
- */
-@Deprecated public class OvsVswitchdSchemaConstants {
- public static String DATABASE_NAME = "Open_vSwitch";
-
- private static final String OVSDB_AUTOCONFIGURECONTROLLER = "ovsdb.autoconfigurecontroller";
- private static final boolean defaultAutoConfigureController = true;
- private static boolean autoConfigureController = defaultAutoConfigureController;
-
- private static Map<String, String[]> columnToMutate = Maps.newHashMap();
- public static String[] getParentColumnToMutate(String childTabletoInsert) {
- return columnToMutate.get(childTabletoInsert);
- }
- private static void addParentColumnToMutate(String childTable, String parentTable, String columnName) {
- String[] parentColumn = {parentTable, columnName};
- columnToMutate.put(childTable, parentColumn);
- }
-
- static {
- addParentColumnToMutate("Bridge", "Open_vSwitch", "bridges");
- addParentColumnToMutate("Port", "Bridge", "ports");
- addParentColumnToMutate("Interface", "Port", "interfaces");
- addParentColumnToMutate("SSL", "Open_vSwitch", "ssl");
- addParentColumnToMutate("IPFIX", "Bridge", "ipfix");
- addParentColumnToMutate("sFlow", "Bridge", "sflow");
- addParentColumnToMutate("Flow_Table", "Bridge", "flow_tables");
- addParentColumnToMutate("QoS", "Port", "qos");
- addParentColumnToMutate("NetFlow", "Bridge", "netflow");
- addParentColumnToMutate("Mirror", "Bridge", "mirrors");
- addParentColumnToMutate("Manager", "Open_vSwitch", "manager_options");
- addParentColumnToMutate("Controller", "Bridge", "controller");
- // Keep the default value if the property is not set
- final String autoConfigureControllerStr =
- ConfigProperties.getProperty(OvsVswitchdSchemaConstants.class, OVSDB_AUTOCONFIGURECONTROLLER);
- if (autoConfigureControllerStr != null) {
- autoConfigureController = Boolean.getBoolean(autoConfigureControllerStr);
- }
- }
-
- public static boolean shouldConfigureController (String databaseName, String tableName) {
- if (autoConfigureController && databaseName.equals(DATABASE_NAME) && tableName.equals("Bridge")) return true;
- return false;
- }
-
- public enum PortType {
- VLAN("vlan"),
- TUNNEL("Tunnel"),
- BONDING("Bonding"),
- PATCH("patch"),
- INTERNAL("internal");
-
- private PortType(String name) {
- this.name = name;
- }
-
- private String name;
-
- @Override
- public String toString() {
- return name;
- }
- }
-
-}
+++ /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, Brent Salisbury
- */
-package org.opendaylight.ovsdb.plugin;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
-import org.opendaylight.ovsdb.plugin.api.StatusWithUuid;
-
-import java.util.List;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ExecutionException;
-
-/**
- * OVSDB Plugin Configuration Service
- * @deprecated as of release 1.0.0, replaced by {@link org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService }
- */
-@Deprecated public interface OvsdbConfigService {
-
- /**
- * This version of insertRow is a short-term replacement for the older & now deprecated method of the same name.
- * This API assumes an Open_vSwitch database Schema.
- *
- * @param node OVSDB Node
- * @param tableName Table on which the row is inserted
- * @param parentUuid UUID of the parent table to which this operation will result in attaching/mutating.
- * @param row Row of table Content to be inserted
- * @return UUID of the inserted Row
- */
- public StatusWithUuid insertRow(Node node, String tableName, String parentUuid, Row<GenericTableSchema> row);
-
- /**
- * This version of updateRow is a short-term replacement for the older & now deprecated method of the same name.
- * This API assumes an Open_vSwitch database Schema.
- *
- * @param node OVSDB Node
- * @param tableName Table on which the row is Updated
- * @param parentUuid UUID of the parent row on which this operation might result in mutating.
- * @param rowUuid UUID of the row that is being updated
- * @param row Row of table Content to be Updated. Include just those columns that needs to be updated.
- */
- public Status updateRow(Node node, String tableName, String parentUuid, String rowUuid, Row row);
-
- /**
- * This version of deleteRow is a short-term replacement for the older & now deprecated method of the same name.
- * This API assumes an Open_vSwitch database Schema.
- *
- * @param node OVSDB Node
- * @param tableName Table on which the row is Updated
- * @param rowUuid UUID of the row that is being deleted
- */
-
- public Status deleteRow(Node node, String tableName, String rowUUID);
-
- /**
- * This version of getRow is a short-term replacement for the older & now deprecated method of the same name.
- * This API assumes an Open_vSwitch database Schema.
- *
- * @param node OVSDB Node
- * @param tableName Table Name
- * @param rowUuid UUID of the row being queried
- * @return a row with a list of Column data that corresponds to an unique Row-identifier called uuid in a given table.
- */
-
- public Row getRow(Node node, String tableName, String uuid);
-
- /**
- * This version of getRows is a short-term replacement for the older & now deprecated method of the same name.
- * This API assumes an Open_vSwitch database Schema.
- *
- * @param node OVSDB Node
- * @param tableName Table Name
- * @return List of rows that makes the entire Table.
- */
-
- public ConcurrentMap<String, Row> getRows(Node node, String tableName);
-
- /**
- * Returns all the Tables in a given Ndoe.
- * This API assumes an Open_vSwitch database Schema.
- *
- * @param node OVSDB node
- * @return List of Table Names that make up Open_vSwitch schema.
- */
- public List<String> getTables(Node node);
-
- /**
- * setOFController is a convenience method used by existing applications to setup Openflow Controller on
- * a Open_vSwitch Bridge.
- * This API assumes an Open_vSwitch database Schema.
- *
- * @param node Node
- * @param bridgeUUID uuid of the Bridge for which the ip-address of Openflow Controller should be programmed.
- * @return Boolean representing success or failure of the operation.
- *
- * @throws InterruptedException
- * @throws java.util.concurrent.ExecutionException
- */
- public Boolean setOFController(Node node, String bridgeUUID) throws InterruptedException, ExecutionException;
-
- public <T extends TypedBaseTable<?>> String getTableName(Node node, Class<T> typedClass);
- public <T extends TypedBaseTable<?>> T getTypedRow(Node node, Class<T> typedClass, Row row);
- public <T extends TypedBaseTable<?>> T createTypedRow(Node node, Class<T> typedClass);
-}
+++ /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, Brent Salisbury
- */
-package org.opendaylight.ovsdb.plugin;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.ovsdb.lib.notation.Row;
-
-/**
- * OVSDB Plugin Inventory Listener
- * @deprecated as of release 1.0.0, replaced by {@link org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener }
- */
-@Deprecated public interface OvsdbInventoryListener {
- public void nodeAdded(Node node);
- public void nodeRemoved(Node node);
- public void rowAdded(Node node, String tableName, String uuid, Row row);
- public void rowUpdated(Node node, String tableName, String uuid, Row old, Row row);
- public void rowRemoved(Node node, String tableName, String uuid, Row row, Object context);
-}
+++ /dev/null
-/*
- * [[ Authors will Fill in the Copyright header ]]
- *
- * 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 : Hugo Trippaers
- */
-package org.opendaylight.ovsdb.plugin;
-
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.controller.sal.utils.StatusCode;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-
-/**
- * Extends the Status class to allow functions to return a uuid
- * @deprecated as of release 1.0.0, replaced by {@link org.opendaylight.ovsdb.plugin.api.StatusWithUuid }
- */
-@Deprecated public class StatusWithUuid extends Status {
- private static final long serialVersionUID = -5413085099514964003L;
- private UUID uuid;
-
- public StatusWithUuid(StatusCode errorCode) {
- super(errorCode);
- }
-
- public StatusWithUuid(StatusCode errorCode, String description) {
- super(errorCode, description);
- }
-
- public StatusWithUuid(StatusCode errorCode, long requestId) {
- super(errorCode, requestId);
- }
-
- public StatusWithUuid(StatusCode errorCode, UUID uuid) {
- super(errorCode);
- this.uuid = uuid;
- }
-
- public UUID getUuid() {
- return uuid;
- }
-
-}
import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
import org.opendaylight.ovsdb.lib.schema.TableSchema;
import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
-import org.opendaylight.ovsdb.plugin.OvsdbConfigService;
import org.opendaylight.ovsdb.plugin.api.Connection;
import org.opendaylight.ovsdb.plugin.api.OvsVswitchdSchemaConstants;
import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
public class ConfigurationServiceImpl implements IPluginInBridgeDomainConfigService,
OvsdbConfigurationService,
- OvsdbConfigService,
CommandProvider
{
private static final Logger logger = LoggerFactory
import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
import org.opendaylight.ovsdb.lib.schema.TableSchema;
-import org.opendaylight.ovsdb.plugin.IConnectionServiceInternal;
import org.opendaylight.ovsdb.plugin.api.Connection;
import org.opendaylight.ovsdb.plugin.internal.IPAddressProperty;
import org.opendaylight.ovsdb.plugin.internal.L4PortProperty;
*/
public class ConnectionServiceImpl implements IPluginInConnectionService,
OvsdbConnectionService,
- IConnectionServiceInternal,
OvsdbConnectionListener {
protected static final Logger logger = LoggerFactory.getLogger(ConnectionServiceImpl.class);
import org.opendaylight.ovsdb.lib.message.TableUpdates;
import org.opendaylight.ovsdb.lib.notation.Row;
import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.plugin.InventoryServiceInternal;
import org.opendaylight.ovsdb.plugin.internal.NodeDatabase;
import org.opendaylight.ovsdb.plugin.api.OvsVswitchdSchemaConstants;
import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
*
*
*/
-public class InventoryServiceImpl implements OvsdbInventoryService,
- InventoryServiceInternal {
+public class InventoryServiceImpl implements OvsdbInventoryService {
private static final Logger logger = LoggerFactory
.getLogger(InventoryServiceImpl.class);
private final Set<IPluginOutInventoryService> pluginOutInventoryServices =
addNodeProperty(node, UpdateType.ADDED, props);
}
- @Override
- @Deprecated public void notifyNodeAdded(Node node) {
- //noop
- }
-
-
@Override
public void notifyNodeAdded(Node node, InetAddress address, int port) {
if (!ovsdbInventoryListeners.isEmpty()) {
import org.opendaylight.controller.sal.utils.INodeFactory;
import org.opendaylight.ovsdb.lib.OvsdbConnection;
import org.opendaylight.ovsdb.lib.OvsdbConnectionListener;
-import org.opendaylight.ovsdb.plugin.IConnectionServiceInternal;
-import org.opendaylight.ovsdb.plugin.InventoryServiceInternal;
-import org.opendaylight.ovsdb.plugin.OvsdbConfigService;
import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
// by SAL
props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), "OVS");
c.setInterface(new String[] { IPluginInBridgeDomainConfigService.class.getName(),
- OvsdbConfigurationService.class.getName(),
- OvsdbConfigService.class.getName()}, props);
+ OvsdbConfigurationService.class.getName()}, props);
c.add(createServiceDependency()
.setService(OvsdbConnectionService.class)
c.setInterface(
new String[] {IPluginInConnectionService.class.getName(),
OvsdbConnectionService.class.getName(),
- OvsdbConnectionListener.class.getName(),
- IConnectionServiceInternal.class.getName()}, props);
+ OvsdbConnectionListener.class.getName()}, props);
c.add(createServiceDependency()
.setService(OvsdbInventoryService.class)
.setRequired(true));
props.put("scope", "Global");
c.setInterface(
new String[]{IPluginInInventoryService.class.getName(),
- OvsdbInventoryService.class.getName(),
- InventoryServiceInternal.class.getName()}, props);
+ OvsdbInventoryService.class.getName()}, props);
c.add(createServiceDependency()
.setService(IPluginOutInventoryService.class, "(scope=Global)")
.setCallbacks("setPluginOutInventoryServices",