<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>
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);
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 {
}
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));
* 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.
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.
}
/**
+ * 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;
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));
}
/**
+ * Get the time of the event.
+ *
* @return notification event time
*/
public Date getEventTime() {
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
NotificationPublisherRegistration registerNotificationPublisher(Stream stream);
/**
- * Register base notification publisher
+ * Register base notification publisher.
*/
BaseNotificationPublisherRegistration registerBaseNotificationPublisher();
* 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);
}
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);
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();
package org.opendaylight.netconf.notifications;
/**
- * Manages the registration of a single listener
+ * Manages the registration of a single listener.
*/
public interface NotificationListenerRegistration extends NotificationRegistration {
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 {