[ONOS-3943] SNMP protocol and provider refactoring according to ONOS architecture

Change-Id: Ie87ee6c181c9550ffac602397f2ee74a691bbdfa
diff --git a/protocols/snmp/api/src/main/java/org/onosproject/snmp/SnmpController.java b/protocols/snmp/api/src/main/java/org/onosproject/snmp/SnmpController.java
new file mode 100644
index 0000000..d730107
--- /dev/null
+++ b/protocols/snmp/api/src/main/java/org/onosproject/snmp/SnmpController.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2016 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.snmp;
+
+import com.btisystems.pronx.ems.core.snmp.ISnmpSession;
+import org.onosproject.incubator.net.faultmanagement.alarm.DefaultAlarm;
+import org.onosproject.net.DeviceId;
+
+import java.io.IOException;
+import java.util.Collection;
+
+/**
+ * Snmp Controller.
+ */
+public interface SnmpController {
+
+    /**
+     * Return all the devices that this controller has notion of.
+     * @return Set of all Snmp devices
+     */
+    Collection<SnmpDevice> getDevices();
+
+    /**
+     * Gets a device for a specific deviceId.
+     * @param deviceId device id of the device
+     * @return SnmpDevice for given deviceId
+     */
+    SnmpDevice getDevice(DeviceId deviceId);
+
+    /**
+     * Removes a specific device.
+     * @param deviceId device id of the device to be removed
+     */
+    void removeDevice(DeviceId deviceId);
+
+    /**
+     * Add a device with a specific DeviceId.
+     * @param deviceId deviceId of the device
+     * @param device device to add to this controller
+     */
+    void addDevice(DeviceId deviceId, SnmpDevice device);
+
+    /**
+     * Gets an Instance of ISnmpSession for a specific device.
+     *
+     * @param deviceId device to retrieve the session for.
+     * @return ISnmp session.
+     * @throws IOException if the session can't be established.
+     */
+    ISnmpSession getSession(DeviceId deviceId) throws IOException;
+
+    /**
+     * Creates an error alarm if the interaction with the device failed.
+     *
+     * @param deviceId the device with a failed interaction
+     * @return default alarm error
+     */
+    DefaultAlarm buildWalkFailedAlarm(DeviceId deviceId);
+}
diff --git a/protocols/snmp/api/src/main/java/org/onosproject/snmp/SnmpDevice.java b/protocols/snmp/api/src/main/java/org/onosproject/snmp/SnmpDevice.java
new file mode 100644
index 0000000..f8876c3
--- /dev/null
+++ b/protocols/snmp/api/src/main/java/org/onosproject/snmp/SnmpDevice.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2016 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.snmp;
+
+import org.onosproject.net.DeviceId;
+
+/**
+ * Abstraction a default Snmp Device.
+ */
+public interface SnmpDevice {
+
+    /**
+     * Returns host IP and host Port, used by this particular SNMP Device.
+     *
+     * @return Device Information.
+     */
+    String deviceInfo();
+
+    /**
+     * Terminates the device connection.
+     */
+    void disconnect();
+
+    /**
+     * Retrieves the device state.
+     *
+     * @return true if connected
+     */
+    boolean isReachable();
+
+    /**
+     * Returns the IP used connect ssh on the device.
+     *
+     * @return SNMP Device IP
+     */
+    String getSnmpHost();
+
+    /**
+     * Returns the SSH Port used connect the device.
+     *
+     * @return SSH Port number
+     */
+    int getSnmpPort();
+
+    /**
+     * Retrieves the username of the device.
+     *
+     * @return username
+     */
+    String getUsername();
+
+    /**
+     * Retrieves the community (password) of the device.
+     *
+     * @return password
+     */
+    String getCommunity();
+
+    /**
+     * Return the SNMP device deviceID.
+     *
+     * @return DeviceId
+     */
+    DeviceId deviceId();
+}
diff --git a/protocols/snmp/api/src/main/java/org/onosproject/snmp/package-info.java b/protocols/snmp/api/src/main/java/org/onosproject/snmp/package-info.java
new file mode 100644
index 0000000..5a4afb2
--- /dev/null
+++ b/protocols/snmp/api/src/main/java/org/onosproject/snmp/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 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 for SNMP apis interfaces.
+ */
+package org.onosproject.snmp;