Deprecate messagebus-netconf
[netconf.git] / netconf / messagebus-netconf / src / main / java / org / opendaylight / netconf / messagebus / eventsources / netconf / NotificationTopicRegistration.java
index d9b3543167572f7376fd8d666d7d38ba3b6a1c45..286ac1db35c35a2dddb4d01d19ce2d8b59fe562f 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.netconf.messagebus.eventsources.netconf;
 
-import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
-import java.util.Date;
+import java.time.Instant;
+import java.util.HashSet;
+import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.TopicId;
@@ -20,6 +20,7 @@ import org.slf4j.LoggerFactory;
 /**
  * Notification topic registration.
  */
+@Deprecated(forRemoval = true)
 abstract class NotificationTopicRegistration implements AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(NotificationTopicRegistration.class);
@@ -34,7 +35,7 @@ abstract class NotificationTopicRegistration implements AutoCloseable {
     private final String sourceName;
     private final String notificationUrnPrefix;
     private boolean replaySupported;
-    private Date lastEventTime;
+    private Instant lastEventTime;
     protected final ConcurrentHashMap<SchemaPath, Set<TopicId>> notificationTopicMap = new ConcurrentHashMap<>();
 
     protected NotificationTopicRegistration(final NotificationSourceType notificationSourceType,
@@ -74,7 +75,7 @@ abstract class NotificationTopicRegistration implements AutoCloseable {
      */
     Set<TopicId> getTopicsForNotification(final SchemaPath notificationPath) {
         final Set<TopicId> topicIds = notificationTopicMap.get(notificationPath);
-        return topicIds != null ? topicIds : Sets.newHashSet();
+        return topicIds != null ? topicIds : new HashSet<>();
     }
 
     /**
@@ -93,11 +94,11 @@ abstract class NotificationTopicRegistration implements AutoCloseable {
         return nameSpace.startsWith(getNotificationUrnPrefix());
     }
 
-    Optional<Date> getLastEventTime() {
-        return Optional.fromNullable(lastEventTime);
+    Optional<Instant> getLastEventTime() {
+        return Optional.ofNullable(lastEventTime);
     }
 
-    void setLastEventTime(final Date lastEventTime) {
+    void setLastEventTime(final Instant lastEventTime) {
         this.lastEventTime = lastEventTime;
     }