Move internal classes under .impl package (1/2)
Change-Id: I72ed933ecd5ae7ffb268967f80fb395e90f7d8e9
diff --git a/protocols/netconf/api/src/main/java/org/onosproject/netconf/FilteringNetconfDeviceOutputEventListener.java b/protocols/netconf/api/src/main/java/org/onosproject/netconf/FilteringNetconfDeviceOutputEventListener.java
new file mode 100644
index 0000000..da5d51d
--- /dev/null
+++ b/protocols/netconf/api/src/main/java/org/onosproject/netconf/FilteringNetconfDeviceOutputEventListener.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2017-present 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.netconf;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Listener to listen for event about specific Device.
+ */
+public class FilteringNetconfDeviceOutputEventListener
+ implements NetconfDeviceOutputEventListener {
+
+ private static final Logger log =
+ LoggerFactory.getLogger(FilteringNetconfDeviceOutputEventListener.class);
+
+ private final NetconfDeviceInfo deviceInfo;
+
+ public FilteringNetconfDeviceOutputEventListener(NetconfDeviceInfo deviceInfo) {
+ this.deviceInfo = checkNotNull(deviceInfo);
+ }
+
+ @Override
+ public void event(NetconfDeviceOutputEvent event) {
+ switch (event.type()) {
+ case DEVICE_REPLY:
+ log.debug("Device {} has reply: {}", deviceInfo, event.getMessagePayload());
+ break;
+ case DEVICE_NOTIFICATION:
+ log.info("Device {} has notification: {}", deviceInfo, event.getMessagePayload());
+ break;
+ case DEVICE_UNREGISTERED:
+ log.warn("Device {} has closed session", deviceInfo);
+ break;
+ case DEVICE_ERROR:
+ log.warn("Device {} has error: {}", deviceInfo, event.getMessagePayload());
+ break;
+ case SESSION_CLOSED:
+ log.warn("Device {} has closed Session: {}", deviceInfo, event.getMessagePayload());
+ break;
+ default:
+ log.warn("Wrong event type {} ", event.type());
+ }
+
+ }
+
+ @Override
+ public boolean isRelevant(NetconfDeviceOutputEvent event) {
+ return deviceInfo.equals(event.getDeviceInfo());
+ }
+}
diff --git a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceInfo.java b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceInfo.java
index be76056..8ff65bf 100644
--- a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceInfo.java
+++ b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceInfo.java
@@ -41,6 +41,7 @@
private int port;
private char[] key;
//File keyFile @deprecated 1.9.0
+ @Deprecated
private File keyFile;
private DeviceId deviceId;
@@ -121,7 +122,7 @@
/**
* Exposes the port of the controller.
*
- * @return int port address
+ * @return port number
*/
public int port() {
return port;