XMPP as SBI support: implementation of core XMPP and Xmpp Device Provider

State machine handled by XmppSession interface, most of tests implemented

XmppDeviceFactory re-designed, tests updated

pom and BUCK files updated

Change-Id: I4c6955e091169c945415084cbb000c61b474c0fc
diff --git a/protocols/xmpp/core/api/src/main/java/org/onosproject/xmpp/core/XmppController.java b/protocols/xmpp/core/api/src/main/java/org/onosproject/xmpp/core/XmppController.java
new file mode 100644
index 0000000..8b500a3
--- /dev/null
+++ b/protocols/xmpp/core/api/src/main/java/org/onosproject/xmpp/core/XmppController.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.xmpp.core;
+
+/**
+ * Abstraction of a XMPP controller. Serves as a one stop
+ * shop for obtaining XMPP devices and (un)register listeners
+ * on XMPP events
+ */
+public interface XmppController {
+
+    /**
+     * Method allows to retrieve XMPP device for given XmppDeviceId, if one exists.
+     *
+     * @param xmppDeviceId the device to retrieve
+     * @return the interface to XMPP Device
+     */
+    XmppDevice getDevice(XmppDeviceId xmppDeviceId);
+
+    /**
+     * Register a listener for device events.
+     *
+     * @param deviceListener the listener to notify
+     */
+    void addXmppDeviceListener(XmppDeviceListener deviceListener);
+
+    /**
+     * Unregister a listener for device events.
+     *
+     * @param deviceListener the listener to unregister
+     */
+    void removeXmppDeviceListener(XmppDeviceListener deviceListener);
+
+    /**
+     * Register a listener for IQ stanza of XMPP protocol.
+     *
+     * @param iqListener the listener to notify
+     */
+    void addXmppIqListener(XmppIqListener iqListener);
+
+    /**
+     * Unregister a listener for IQ stanza of XMPP protocol.
+     *
+     * @param iqListener the listener to unregister
+     */
+    void removeXmppIqListener(XmppIqListener iqListener);
+
+    /**
+     * Register a listener for Message stanza of XMPP protocol.
+     *
+     * @param messageListener the listener to notify
+     */
+    void addXmppMessageListener(XmppMessageListener messageListener);
+
+    /**
+     * Unregister a listener for Message stanza of XMPP protocol.
+     *
+     * @param messageListener the listener to unregister
+     */
+    void removeXmppMessageListener(XmppMessageListener messageListener);
+
+    /**
+     * Register a listener for Presence stanza of XMPP protocol.
+     *
+     * @param presenceListener the listener to notify
+     */
+    void addXmppPresenceListener(XmppPresenceListener presenceListener);
+
+    /**
+     * Unregister a listener for Presence stanza of XMPP protocol.
+     *
+     * @param presenceListener the listener to unregister
+     */
+    void removeXmppPresenceListener(XmppPresenceListener presenceListener);
+
+}