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, Brent Salisbury
10 package org.opendaylight.ovsdb.openstack.netvirt.api;
12 import org.opendaylight.ovsdb.lib.OvsdbClient;
13 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
17 public class Connection {
19 private String identifier;
20 private OvsdbClient client;
22 public Long getIdCounter() {
26 public void setIdCounter(Long idCounter) {
27 this.idCounter = idCounter;
30 private Long idCounter;
32 private static final Logger logger = LoggerFactory.getLogger(Connection.class);
34 public Connection(String identifier) {
37 public String getIdentifier() {
41 public void setIdentifier(String identifier) {
42 this.identifier = identifier;
45 public OvsdbClient getClient() {
49 public void setClient(OvsdbClient client) {
53 public Node getNode() {
57 public void setNode(Node node) {
61 public void disconnect() {
66 public int hashCode() {
69 result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
74 public boolean equals(Object obj) {
75 if (this == obj) return true;
76 if (obj == null) return false;
77 if (getClass() != obj.getClass()) return false;
78 Connection other = (Connection) obj;
79 if (identifier == null) {
80 if (other.identifier != null) return false;
81 } else if (!identifier.equals(other.identifier)) return false;