Merge "Bug 8153: Enforce check-style rules for netconf - netconf-notification-api"
authorTomas Cere <tcere@cisco.com>
Fri, 28 Apr 2017 08:11:05 +0000 (08:11 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 28 Apr 2017 08:11:05 +0000 (08:11 +0000)
netconf/netconf-notifications-api/pom.xml
netconf/netconf-notifications-api/src/main/java/org/opendaylight/netconf/notifications/BaseNetconfNotificationListener.java
netconf/netconf-notifications-api/src/main/java/org/opendaylight/netconf/notifications/BaseNotificationPublisherRegistration.java
netconf/netconf-notifications-api/src/main/java/org/opendaylight/netconf/notifications/NetconfNotification.java
netconf/netconf-notifications-api/src/main/java/org/opendaylight/netconf/notifications/NetconfNotificationCollector.java
netconf/netconf-notifications-api/src/main/java/org/opendaylight/netconf/notifications/NetconfNotificationListener.java
netconf/netconf-notifications-api/src/main/java/org/opendaylight/netconf/notifications/NetconfNotificationRegistry.java
netconf/netconf-notifications-api/src/main/java/org/opendaylight/netconf/notifications/NotificationListenerRegistration.java
netconf/netconf-notifications-api/src/main/java/org/opendaylight/netconf/notifications/NotificationRegistration.java

index 59fb664dab09ca675402c747ac7e91bd482a2811..967dfe6f98f9192e60d12888d018af6a43ca0dad 100644 (file)
             <artifactId>slf4j-api</artifactId>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
index c95e3ba7114eba5f382ff95b9b4e4a901987ad29..ea5e3b623a9db5afe7341608a623aa44c54c0507 100644 (file)
@@ -21,17 +21,17 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.not
 public interface BaseNetconfNotificationListener {
 
     /**
-     * Callback used to notify about a change in used capabilities
+     * Callback used to notify about a change in used capabilities.
      */
-    void onCapabilityChanged(final NetconfCapabilityChange capabilityChange);
+    void onCapabilityChanged(NetconfCapabilityChange capabilityChange);
 
     /**
-     * Callback used to notify about netconf session start
+     * Callback used to notify about netconf session start.
      */
     void onSessionStarted(NetconfSessionStart start);
 
     /**
-     * Callback used to notify about netconf session end
+     * Callback used to notify about netconf session end.
      */
     void onSessionEnded(NetconfSessionEnd end);
 
index 9d053242bf702193e4735c79d4bb8d7f463ab0d6..799672596044d5dc1b3cd7ff39db6777739e2ade 100644 (file)
@@ -9,8 +9,10 @@
 package org.opendaylight.netconf.notifications;
 
 /**
- * Registration for base notification publisher. This registration allows for publishing of base netconf notifications using generated classes
+ * Registration for base notification publisher.
+ * This registration allows for publishing of base netconf notifications using generated classes
  */
-public interface BaseNotificationPublisherRegistration extends NotificationRegistration, BaseNetconfNotificationListener {
+public interface BaseNotificationPublisherRegistration
+        extends NotificationRegistration, BaseNetconfNotificationListener {
 
 }
index 67b4069ac8b27fa7aee6000688fb507445eac0e0..3e7f562434770fe89cb0912e2d76b9c1b92c8836 100644 (file)
@@ -85,7 +85,8 @@ public final class NetconfNotification extends NetconfMessage {
                 while (reminderBuilder.charAt(reminderBuilder.length() - 1) == '0') {
                     reminderBuilder.deleteCharAt(reminderBuilder.length() - 1);
                 }
-                LOG.warn("Fraction of second is cut to three digits. Value that was cut {}", reminderBuilder.toString());
+                LOG.warn("Fraction of second is cut to three digits. Value that was cut {}",
+                        reminderBuilder.toString());
             }
 
             return Date.from(Instant.from(localDateTime));
@@ -104,8 +105,8 @@ public final class NetconfNotification extends NetconfMessage {
      * conversion is applied, replacing the second-of-minute of 60 with 59.
      *
      * @param time {@link String} representation of a time
-     * @return {@code null} if time isn't ISO compliant or if the time doesn't have a leap second
-     * else a {@link Date} as per as the RFC3339_DATE_PARSER.
+     *     @return {@code null} if time isn't ISO compliant or if the time doesn't have a leap second
+     *     else a {@link Date} as per as the RFC3339_DATE_PARSER.
      */
     private static Date handlePotentialLeapSecond(final String time) {
         // Parse the string from offset 0, so we get the whole value.
@@ -127,7 +128,8 @@ public final class NetconfNotification extends NetconfMessage {
             return null;
         }
 
-        LOG.trace("Received time contains leap second, adjusting by replacing the second-of-minute of 60 with 59 {}", time);
+        LOG.trace("Received time contains leap second, adjusting by replacing the second-of-minute of 60 with 59 {}",
+                time);
 
         // Applying simple conversion replacing the second-of-minute of 60 with 59.
 
@@ -147,10 +149,12 @@ public final class NetconfNotification extends NetconfMessage {
     }
 
     /**
+     * Get value asociated with {@code ChronoField}.
+     *
      * @param accessor The {@link TemporalAccessor}
      * @param field The {@link ChronoField} to get
      * @return the value associated with the {@link ChronoField} for the given {@link TemporalAccessor} if present,
-     * else 0.
+     *     else 0.
      */
     private static int getFieldFromTemporalAccessor(final TemporalAccessor accessor, final ChronoField field) {
         return accessor.isSupported(field) ? (int) accessor.getLong(field) : 0;
@@ -159,21 +163,21 @@ public final class NetconfNotification extends NetconfMessage {
     public static final String EVENT_TIME = "eventTime";
 
     /**
-     * Used for unknown/un-parse-able event-times
+     * Used for unknown/un-parse-able event-times.
      */
     public static final Date UNKNOWN_EVENT_TIME = new Date(0);
 
     private final Date eventTime;
 
     /**
-     * Create new notification and capture the timestamp in the constructor
+     * Create new notification and capture the timestamp in the constructor.
      */
     public NetconfNotification(final Document notificationContent) {
         this(notificationContent, new Date());
     }
 
     /**
-     * Create new notification with provided timestamp
+     * Create new notification with provided timestamp.
      */
     public NetconfNotification(final Document notificationContent, final Date eventTime) {
         super(wrapNotification(notificationContent, eventTime));
@@ -181,6 +185,8 @@ public final class NetconfNotification extends NetconfMessage {
     }
 
     /**
+     * Get the time of the event.
+     *
      * @return notification event time
      */
     public Date getEventTime() {
index 034e48a5e160cfa9020cd2f9721442977b1622be..34a80b391c7dd71ad4567886ec131e0119b48e3c 100644 (file)
@@ -17,8 +17,9 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.r
 public interface NetconfNotificationCollector {
 
     /**
-     * Add notification publisher for a particular stream
+     * Add notification publisher for a particular stream.
      *
+     * <p>
      * Implementations should allow for multiple publishers of a single stream
      * and its up to implementations to decide how to merge metadata (e.g. description)
      * for the same stream when providing information about available stream
@@ -27,7 +28,7 @@ public interface NetconfNotificationCollector {
     NotificationPublisherRegistration registerNotificationPublisher(Stream stream);
 
     /**
-     * Register base notification publisher
+     * Register base notification publisher.
      */
     BaseNotificationPublisherRegistration registerBaseNotificationPublisher();
 
@@ -35,22 +36,23 @@ public interface NetconfNotificationCollector {
      * Users of the registry have an option to get notification each time new notification stream gets registered
      * This allows for a push model in addition to pull model for retrieving information about available streams.
      *
+     * <p>
      * The listener should receive callbacks for each stream available prior to the registration when its registered
      */
     NotificationRegistration registerStreamListener(NetconfNotificationStreamListener listener);
 
     /**
-     * Simple listener that receives notifications about changes in stream availability
+     * Simple listener that receives notifications about changes in stream availability.
      */
     public interface NetconfNotificationStreamListener {
 
         /**
-         * Stream becomes available in the collector (first publisher is registered)
+         * Stream becomes available in the collector (first publisher is registered).
          */
         void onStreamRegistered(Stream stream);
 
         /**
-         * Stream is not available anymore in the collector (last publisher is unregistered)
+         * Stream is not available anymore in the collector (last publisher is unregistered).
          */
         void onStreamUnregistered(StreamNameType stream);
     }
index 48ba9da2b0127fe0d22d1174f93b8a76539736ca..3a839233defc1c9024e9662bc65b90e367768a3f 100644 (file)
@@ -11,12 +11,12 @@ package org.opendaylight.netconf.notifications;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType;
 
 /**
- * Generic listener for netconf notifications
+ * Generic listener for netconf notifications.
  */
 public interface NetconfNotificationListener {
 
     /**
-     * Callback used to notify the listener about any new notification
+     * Callback used to notify the listener about any new notification.
      */
     void onNotification(StreamNameType stream, NetconfNotification notification);
 
index 2b28f7f751c228af1b8a3948ab898fe4ef7143fa..c1167ea25f4085ffb5e9fecd40e03533ca1eb1eb 100644 (file)
@@ -11,23 +11,21 @@ package org.opendaylight.netconf.notifications;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams;
 
-/**
- *
- */
 public interface NetconfNotificationRegistry {
 
     /**
-     * Add listener for a certain notification type
+     * Add listener for a certain notification type.
      */
-    NotificationListenerRegistration registerNotificationListener(StreamNameType stream, NetconfNotificationListener listener);
+    NotificationListenerRegistration registerNotificationListener(StreamNameType stream,
+                                                                  NetconfNotificationListener listener);
 
     /**
-     * Check stream availability
+     * Check stream availability.
      */
     boolean isStreamAvailable(StreamNameType streamNameType);
 
     /**
-     * Get all the streams available
+     * Get all the streams available.
      */
     Streams getNotificationPublishers();
 
index aad97f3246225d3be78a5de7250ad4e90a920850..744679988aed3768ec606d93132010fc959d00c7 100644 (file)
@@ -9,7 +9,7 @@
 package org.opendaylight.netconf.notifications;
 
 /**
- * Manages the registration of a single listener
+ * Manages the registration of a single listener.
  */
 public interface NotificationListenerRegistration extends NotificationRegistration {
 
index 11bd30ad96edc3384448382428ca8b7e5b98750e..53ca343f05a28863f53a7c4dab7acd65e213196f 100644 (file)
@@ -9,7 +9,7 @@
 package org.opendaylight.netconf.notifications;
 
 /**
- * Generic registration, used as a base for other registration types
+ * Generic registration, used as a base for other registration types.
  */
 public interface NotificationRegistration extends AutoCloseable {