Use Topology Node in place of Inventory Node
[ovsdb.git] / openstack / net-virt / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / api / Connection.java
1 /*
2  * Copyright (C) 2013 Red Hat, Inc.
3  *
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
7  *
8  * Authors : Madhu Venugopal, Brent Salisbury
9  */
10 package org.opendaylight.ovsdb.openstack.netvirt.api;
11
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;
16
17 public class Connection {
18     private Node node;
19     private String identifier;
20     private OvsdbClient client;
21
22     public Long getIdCounter() {
23         return idCounter;
24     }
25
26     public void setIdCounter(Long idCounter) {
27         this.idCounter = idCounter;
28     }
29
30     private Long idCounter;
31
32     private static final Logger logger = LoggerFactory.getLogger(Connection.class);
33
34     public Connection(String identifier) {
35     }
36
37     public String getIdentifier() {
38         return identifier;
39     }
40
41     public void setIdentifier(String identifier) {
42         this.identifier = identifier;
43     }
44
45     public OvsdbClient getClient() {
46         return this.client;
47     }
48
49     public void setClient(OvsdbClient client) {
50         this.client = client;
51     }
52
53     public Node getNode() {
54         return node;
55     }
56
57     public void setNode(Node node) {
58         this.node = node;
59     }
60
61     public void disconnect() {
62         client.disconnect();
63     }
64
65     @Override
66     public int hashCode() {
67         final int prime = 31;
68         int result = 1;
69         result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
70         return result;
71     }
72
73     @Override
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;
82         return true;
83     }
84 }