[ONOS-2262] - OVSDB -- Create the implementation of HostProvider using
OVSDB prototol.
1.Notify the Host System when the ovsdb vm port is added.
2.Notify the Host System when the ovsdb vm port is removed.

Change-Id: I46355cec84db897360a6eb37190a5bd7a8f3047d
diff --git a/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/DefaultEventSubject.java b/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/DefaultEventSubject.java
new file mode 100644
index 0000000..5d9134b
--- /dev/null
+++ b/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/DefaultEventSubject.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.ovsdb.controller;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.Objects;
+import java.util.Set;
+
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+
+/**
+ * This class is default event subject that implements OvsdbEventSubject.
+ */
+public class DefaultEventSubject implements OvsdbEventSubject {
+    private final MacAddress mac;
+    private final Set<IpAddress> ips;
+    private final OvsdbPortName portname;
+    private final OvsdbPortNumber portnumber;
+    private final OvsdbDatapathId dpid;
+    private final OvsdbPortType portType;
+    private final OvsdbIfaceId ifaceid;
+
+    /**
+     * Creates an end-station event subject using the supplied information.
+     *
+     * @param mac host MAC address
+     * @param ips host MAC ips
+     * @param portname port name
+     * @param portnumber port number
+     * @param dpid ovs dpid
+     * @param portType port type
+     * @param ifaceid  vm ifaceid
+     */
+    public DefaultEventSubject(MacAddress mac, Set<IpAddress> ips,
+                               OvsdbPortName portname, OvsdbPortNumber portnumber, OvsdbDatapathId dpid,
+                               OvsdbPortType portType, OvsdbIfaceId ifaceid) {
+        super();
+        this.mac = mac;
+        this.ips = ips;
+        this.portname = portname;
+        this.portnumber = portnumber;
+        this.dpid = dpid;
+        this.portType = portType;
+        this.ifaceid = ifaceid;
+    }
+
+    @Override
+    public MacAddress hwAddress() {
+        return mac;
+    }
+
+    @Override
+    public Set<IpAddress> ipAddress() {
+        return ips;
+    }
+
+    @Override
+    public OvsdbPortName portName() {
+        return portname;
+    }
+
+    @Override
+    public OvsdbPortNumber portNumber() {
+        return portnumber;
+    }
+
+    @Override
+    public OvsdbPortType portType() {
+        return portType;
+    }
+
+    @Override
+    public OvsdbDatapathId dpid() {
+        return dpid;
+    }
+
+    @Override
+    public OvsdbIfaceId ifaceid() {
+        return ifaceid;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(mac, portname, portnumber, dpid, portType, ifaceid);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof DefaultEventSubject) {
+            final DefaultEventSubject other = (DefaultEventSubject) obj;
+            return Objects.equals(this.mac, other.mac)
+                    && Objects.equals(this.portname, other.portname)
+                    && Objects.equals(this.portnumber, other.portnumber)
+                    && Objects.equals(this.dpid, other.dpid)
+                    && Objects.equals(this.portType, other.portType)
+                    && Objects.equals(this.ifaceid, other.ifaceid);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this).add("mac", mac).add("portname", portname)
+                .add("portnumber", portnumber).add("portType", portType)
+                .add("ipAddresses", ips).add("dpid", dpid).add("ifaceid", ifaceid)
+                .toString();
+    }
+}
diff --git a/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbEventSubject.java b/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbEventSubject.java
new file mode 100644
index 0000000..263027f
--- /dev/null
+++ b/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbEventSubject.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.ovsdb.controller;
+
+import java.util.Set;
+
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+
+/**
+ * Represents for a entity that carry important information for listener.
+ */
+public interface OvsdbEventSubject extends EventSubject {
+    /**
+     * Returns the MAC address associated with this host (NIC).
+     *
+     * @return the MAC address of this host
+     */
+    MacAddress hwAddress();
+
+    /**
+     * Returns the IP address associated with this host's MAC.
+     *
+     * @return host IP address
+     */
+    Set<IpAddress> ipAddress();
+
+    /**
+     * Returns the Port name associated with the host.
+     *
+     * @return port name
+     */
+    OvsdbPortName portName();
+
+    /**
+     * Returns the Port number associated with the host.
+     *
+     * @return port number
+     */
+    OvsdbPortNumber portNumber();
+
+    /**
+     * Returns the Port type associated with the host.
+     *
+     * @return port type
+     */
+    OvsdbPortType portType();
+
+    /**
+     * Returns the Ovs dpid associated with the host.
+     *
+     * @return Ovs dpid
+     */
+    OvsdbDatapathId dpid();
+
+    /**
+     * Returns the vm ifaceid associated with the host.
+     *
+     * @return vm ifaceid
+     */
+    OvsdbIfaceId ifaceid();
+}
diff --git a/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbIfaceId.java b/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbIfaceId.java
new file mode 100644
index 0000000..b0535d2
--- /dev/null
+++ b/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbIfaceId.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.ovsdb.controller;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
+import java.util.Objects;
+
+/**
+ * The class representing a ifaceid. This class is immutable.
+ */
+public class OvsdbIfaceId {
+    private final String value;
+
+    /**
+     * Constructor from a String ifaceid.
+     *
+     * @param value the ifaceid to use
+     */
+    public OvsdbIfaceId(String value) {
+        checkNotNull(value, "value is not null");
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the ifaceid.
+     *
+     * @return the value of the ifaceid
+     */
+    public String value() {
+        return value;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(value);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof OvsdbIfaceId) {
+            final OvsdbIfaceId otherIfaceId = (OvsdbIfaceId) obj;
+            return Objects.equals(this.value, otherIfaceId.value);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this).add("value", value).toString();
+    }
+}
diff --git a/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbPortType.java b/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbPortType.java
new file mode 100644
index 0000000..bf05fc7
--- /dev/null
+++ b/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbPortType.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.ovsdb.controller;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Objects;
+
+/**
+ * The class representing a port type. This class is immutable.
+ */
+public class OvsdbPortType {
+
+    private final String value;
+
+    /**
+     * Constructor from a String port type.
+     *
+     * @param value the port type to use
+     */
+    public OvsdbPortType(String value) {
+        checkNotNull(value, "value is not null");
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the port type.
+     *
+     * @return the value of the port type
+     */
+    public String value() {
+        return value;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(value);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof OvsdbPortType) {
+            final OvsdbPortType otherOvsdbPortType = (OvsdbPortType) obj;
+            return Objects.equals(this.value, otherOvsdbPortType.value);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this).add("value", value).toString();
+    }
+}