Move streams support classes 59/100559/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 12 Apr 2022 16:44:09 +0000 (18:44 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 14 Apr 2022 19:04:33 +0000 (21:04 +0200)
All these classes are used only by the streams/listeners package,
make sure to relocate them to the same package and are a properly-hidden
implementation detail.

JIRA: NETCONF-837
Change-Id: Ib9d979ef408c36e8c5b9d2cf617dc07c887fa622
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 files changed:
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/AbstractCommonSubscriber.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/AbstractWebsocketSerializer.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/serializer/AbstractWebsocketSerializer.java with 89% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/DataTreeCandidateFormatter.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/DataTreeCandidateFormatter.java with 86% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/DataTreeCandidateFormatterFactory.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/DataTreeCandidateFormatterFactory.java with 78% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/EventFormatter.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/EventFormatter.java with 93% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/EventFormatterFactory.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/EventFormatterFactory.java with 82% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JSONDataTreeCandidateFormatter.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/JSONDataTreeCandidateFormatter.java with 96% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JSONNotificationFormatter.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/JSONNotificationFormatter.java with 89% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/JsonDataTreeCandidateSerializer.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/serializer/JsonDataTreeCandidateSerializer.java with 92% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapter.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/NotificationFormatter.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/NotificationFormatter.java with 87% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/NotificationFormatterFactory.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/NotificationFormatterFactory.java with 79% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/NotificationListenerAdapter.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/XMLDataTreeCandidateFormatter.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/XMLDataTreeCandidateFormatter.java with 81% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/XMLNotificationFormatter.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/XMLNotificationFormatter.java with 83% similarity]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/XmlDataTreeCandidateSerializer.java [moved from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/serializer/XmlDataTreeCandidateSerializer.java with 87% similarity]

index 246bdb58a17bdecae5789df9b50e3d220e7933e9..d83e15e63bb67206f020db6ba81ad5a634da7b79 100644 (file)
@@ -27,8 +27,6 @@ import org.checkerframework.checker.lock.qual.GuardedBy;
 import org.checkerframework.checker.lock.qual.Holding;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
-import org.opendaylight.restconf.common.formatters.EventFormatter;
-import org.opendaylight.restconf.common.formatters.EventFormatterFactory;
 import org.opendaylight.restconf.nb.rfc8040.NotificationQueryParams;
 import org.opendaylight.restconf.nb.rfc8040.streams.StreamSessionHandler;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.serializer;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import static com.google.common.base.Verify.verifyNotNull;
 import static java.util.Objects.requireNonNull;
@@ -31,12 +31,12 @@ import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class AbstractWebsocketSerializer<T extends Exception> {
+abstract class AbstractWebsocketSerializer<T extends Exception> {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractWebsocketSerializer.class);
 
     private final EffectiveModelContext context;
 
-    protected AbstractWebsocketSerializer(final EffectiveModelContext context) {
+    AbstractWebsocketSerializer(final EffectiveModelContext context) {
         this.context = requireNonNull(context);
     }
 
@@ -51,7 +51,7 @@ public abstract class AbstractWebsocketSerializer<T extends Exception> {
         }
     }
 
-    void serializeLeafNodesOnly(final Deque<PathArgument> path, final DataTreeCandidateNode candidate,
+    final void serializeLeafNodesOnly(final Deque<PathArgument> path, final DataTreeCandidateNode candidate,
             final boolean skipData) throws T {
         NormalizedNode node = null;
         switch (candidate.getModificationType()) {
@@ -114,16 +114,16 @@ public abstract class AbstractWebsocketSerializer<T extends Exception> {
 
     abstract void serializeOperation(DataTreeCandidateNode candidate) throws T;
 
-    String convertPath(final Collection<PathArgument> path) {
+    static final String convertPath(final Collection<PathArgument> path) {
         final StringBuilder pathBuilder = new StringBuilder();
 
         for (PathArgument pathArgument : path) {
             if (pathArgument instanceof YangInstanceIdentifier.AugmentationIdentifier) {
                 continue;
             }
-            pathBuilder.append("/");
+            pathBuilder.append('/');
             pathBuilder.append(pathArgument.getNodeType().getNamespace().toString().replace(':', '-'));
-            pathBuilder.append(":");
+            pathBuilder.append(':');
             pathBuilder.append(pathArgument.getNodeType().getLocalName());
 
             if (pathArgument instanceof YangInstanceIdentifier.NodeIdentifierWithPredicates) {
@@ -132,20 +132,21 @@ public abstract class AbstractWebsocketSerializer<T extends Exception> {
                         ((YangInstanceIdentifier.NodeIdentifierWithPredicates) pathArgument).entrySet();
                 for (Map.Entry<QName, Object> key : keys) {
                     pathBuilder.append(key.getKey().getNamespace().toString().replace(':', '-'));
-                    pathBuilder.append(":");
+                    pathBuilder.append(':');
                     pathBuilder.append(key.getKey().getLocalName());
                     pathBuilder.append("='");
                     pathBuilder.append(key.getValue().toString());
-                    pathBuilder.append("'");
+                    pathBuilder.append('\'');
                 }
-                pathBuilder.append("]");
+                pathBuilder.append(']');
             }
         }
 
         return pathBuilder.toString();
     }
 
-    String modificationTypeToOperation(final DataTreeCandidateNode candidate, final ModificationType modificationType) {
+    static final String modificationTypeToOperation(final DataTreeCandidateNode candidate,
+            final ModificationType modificationType) {
         switch (modificationType) {
             case UNMODIFIED:
                 // shouldn't ever happen since the root of a modification is only triggered by some event
@@ -163,8 +164,7 @@ public abstract class AbstractWebsocketSerializer<T extends Exception> {
             case DISAPPEARED:
                 return "deleted";
             default:
-                LOG.error("DataTreeCandidate modification has unknown type: {}",
-                        candidate.getModificationType());
+                LOG.error("DataTreeCandidate modification has unknown type: {}", candidate.getModificationType());
                 throw new IllegalStateException("Unknown modification type");
         }
     }
@@ -5,12 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.formatters;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
-import static org.opendaylight.restconf.common.formatters.NotificationFormatter.XML_OUTPUT_FACTORY;
-import static org.opendaylight.restconf.common.formatters.XMLNotificationFormatter.DATA_CHANGE_EVENT_ELEMENT;
+import static org.opendaylight.restconf.nb.rfc8040.streams.listeners.NotificationFormatter.XML_OUTPUT_FACTORY;
+import static org.opendaylight.restconf.nb.rfc8040.streams.listeners.XMLNotificationFormatter.DATA_CHANGE_EVENT_ELEMENT;
 
-import com.google.common.annotations.Beta;
 import java.io.IOException;
 import java.time.Instant;
 import java.util.Collection;
@@ -32,12 +31,12 @@ import org.w3c.dom.Element;
 /**
  * Base formatter for DataTreeCandidates which only handles exporting to a document for filter checking purpose.
  */
-@Beta
-public abstract class DataTreeCandidateFormatter extends EventFormatter<Collection<DataTreeCandidate>> {
-    protected DataTreeCandidateFormatter() {
+abstract class DataTreeCandidateFormatter extends EventFormatter<Collection<DataTreeCandidate>> {
+    DataTreeCandidateFormatter() {
+
     }
 
-    public DataTreeCandidateFormatter(final String xpathFilter) throws XPathExpressionException {
+    DataTreeCandidateFormatter(final String xpathFilter) throws XPathExpressionException {
         super(xpathFilter);
     }
 
@@ -5,13 +5,13 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.formatters;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import java.util.Collection;
 import javax.xml.xpath.XPathExpressionException;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
 
-public interface DataTreeCandidateFormatterFactory extends EventFormatterFactory<Collection<DataTreeCandidate>> {
+interface DataTreeCandidateFormatterFactory extends EventFormatterFactory<Collection<DataTreeCandidate>> {
 
     @Override
     DataTreeCandidateFormatter getFormatter();
similarity index 93%
rename from restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/formatters/EventFormatter.java
rename to restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/EventFormatter.java
index dc6482592a51e24eb2857ccd1a1e91c3eb6e217a..64c8cb23cf1d22ee0febeecdd7751afe6cff6719 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.formatters;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import java.io.IOException;
 import java.time.Instant;
@@ -26,7 +26,7 @@ import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.w3c.dom.Document;
 
-public abstract class EventFormatter<T> implements Immutable {
+abstract class EventFormatter<T> implements Immutable {
     private static final XPathFactory XPF = XPathFactory.newInstance();
 
     // FIXME: NETCONF-369: XPath operates without namespace context, therefore we need an namespace-unaware builder.
@@ -67,8 +67,8 @@ public abstract class EventFormatter<T> implements Immutable {
         filter = xpath.compile(xpathFilter);
     }
 
-    public final Optional<String> eventData(final EffectiveModelContext schemaContext, final T input, final Instant now,
-                                            boolean leafNodesOnly, boolean skipData)
+    final Optional<String> eventData(final EffectiveModelContext schemaContext, final T input, final Instant now,
+                                     final boolean leafNodesOnly, final boolean skipData)
             throws Exception {
         if (!filterMatches(schemaContext, input, now)) {
             return Optional.empty();
@@ -121,7 +121,7 @@ public abstract class EventFormatter<T> implements Immutable {
             throw new IllegalStateException("Failed to evaluate expression " + filter, e);
         }
 
-        return eval.booleanValue();
+        return eval;
     }
 
     /**
@@ -5,11 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.formatters;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import javax.xml.xpath.XPathExpressionException;
 
-public interface EventFormatterFactory<T> {
+interface EventFormatterFactory<T> {
 
     EventFormatter<T> getFormatter();
 
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.formatters;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import static java.util.Objects.requireNonNull;
 
@@ -16,7 +16,6 @@ import java.io.Writer;
 import java.time.Instant;
 import java.util.Collection;
 import javax.xml.xpath.XPathExpressionException;
-import org.opendaylight.restconf.common.serializer.JsonDataTreeCandidateSerializer;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.formatters;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import static java.util.Objects.requireNonNull;
 
@@ -20,7 +20,7 @@ import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONNormalizedNodeStreamWriter;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 
-public final class JSONNotificationFormatter extends NotificationFormatter {
+final class JSONNotificationFormatter extends NotificationFormatter {
     private final JSONCodecFactorySupplier codecSupplier;
 
     private JSONNotificationFormatter(final JSONCodecFactorySupplier codecSupplier) {
@@ -33,7 +33,7 @@ public final class JSONNotificationFormatter extends NotificationFormatter {
         this.codecSupplier = requireNonNull(codecSupplier);
     }
 
-    public static NotificationFormatterFactory createFactory(final JSONCodecFactorySupplier codecSupplier) {
+    static NotificationFormatterFactory createFactory(final JSONCodecFactorySupplier codecSupplier) {
         requireNonNull(codecSupplier);
         return new NotificationFormatterFactory() {
             @Override
@@ -51,7 +51,7 @@ public final class JSONNotificationFormatter extends NotificationFormatter {
 
     @Override
     String createText(final EffectiveModelContext schemaContext, final DOMNotification input, final Instant now,
-                      boolean leafNodesOnly, boolean skipData)
+                      final boolean leafNodesOnly, final boolean skipData)
             throws IOException {
         final Writer writer = new StringWriter();
         final JsonWriter jsonWriter = new JsonWriter(writer).beginObject();
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.serializer;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import static java.util.Objects.requireNonNull;
 
@@ -22,11 +22,11 @@ import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference;
 
-public class JsonDataTreeCandidateSerializer extends AbstractWebsocketSerializer<IOException> {
+final class JsonDataTreeCandidateSerializer extends AbstractWebsocketSerializer<IOException> {
     private final JSONCodecFactorySupplier codecSupplier;
     private final JsonWriter jsonWriter;
 
-    public JsonDataTreeCandidateSerializer(final EffectiveModelContext context,
+    JsonDataTreeCandidateSerializer(final EffectiveModelContext context,
             final JSONCodecFactorySupplier codecSupplier, final JsonWriter jsonWriter) {
         super(context);
         this.codecSupplier = requireNonNull(codecSupplier);
index 1f11b8141a52fa2e76af34110e7e5d06e0d2d227..b438f36b0223c50b501916933b8b4a412c40d7c3 100644 (file)
@@ -18,9 +18,6 @@ import org.opendaylight.mdsal.dom.api.ClusteredDOMDataTreeChangeListener;
 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeService;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
-import org.opendaylight.restconf.common.formatters.DataTreeCandidateFormatterFactory;
-import org.opendaylight.restconf.common.formatters.JSONDataTreeCandidateFormatter;
-import org.opendaylight.restconf.common.formatters.XMLDataTreeCandidateFormatter;
 import org.opendaylight.yang.gen.v1.urn.sal.restconf.event.subscription.rev140708.NotificationOutputTypeGrouping.NotificationOutputType;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.formatters;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import java.io.IOException;
 import java.time.Instant;
@@ -24,8 +24,8 @@ import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-public abstract class NotificationFormatter extends EventFormatter<DOMNotification> {
-    protected static final XMLOutputFactory XML_OUTPUT_FACTORY;
+abstract class NotificationFormatter extends EventFormatter<DOMNotification> {
+    static final XMLOutputFactory XML_OUTPUT_FACTORY;
 
     static {
         XML_OUTPUT_FACTORY = XMLOutputFactory.newFactory();
@@ -36,12 +36,13 @@ public abstract class NotificationFormatter extends EventFormatter<DOMNotificati
 
     }
 
-    public NotificationFormatter(final String xpathFilter) throws XPathExpressionException {
+    NotificationFormatter(final String xpathFilter) throws XPathExpressionException {
         super(xpathFilter);
     }
 
     @Override
-    void fillDocument(Document doc, EffectiveModelContext schemaContext, DOMNotification input) throws IOException {
+    final void fillDocument(final Document doc, final EffectiveModelContext schemaContext, final DOMNotification input)
+            throws IOException {
         final Element notificationElement = doc.createElementNS("urn:ietf:params:xml:ns:netconf:notification:1.0",
                 "notification");
         final Element eventTimeElement = doc.createElement("eventTime");
@@ -5,12 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.formatters;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import javax.xml.xpath.XPathExpressionException;
 import org.opendaylight.mdsal.dom.api.DOMNotification;
 
-public interface NotificationFormatterFactory extends EventFormatterFactory<DOMNotification> {
+interface NotificationFormatterFactory extends EventFormatterFactory<DOMNotification> {
     @Override
     NotificationFormatter getFormatter();
 
index 9992c7a07c42639859ec0212fe1ebc5cdd39ce51..5f43481862a82f478b325cb7e6802cca4a2ab2bb 100644 (file)
@@ -12,9 +12,6 @@ import java.util.Optional;
 import org.opendaylight.mdsal.dom.api.DOMNotification;
 import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
-import org.opendaylight.restconf.common.formatters.JSONNotificationFormatter;
-import org.opendaylight.restconf.common.formatters.NotificationFormatterFactory;
-import org.opendaylight.restconf.common.formatters.XMLNotificationFormatter;
 import org.opendaylight.yang.gen.v1.urn.sal.restconf.event.subscription.rev140708.NotificationOutputTypeGrouping.NotificationOutputType;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
@@ -24,7 +21,7 @@ import org.slf4j.LoggerFactory;
 /**
  * {@link NotificationListenerAdapter} is responsible to track events on notifications.
  */
-public class NotificationListenerAdapter extends AbstractCommonSubscriber<Absolute, DOMNotification>
+public final class NotificationListenerAdapter extends AbstractCommonSubscriber<Absolute, DOMNotification>
         implements DOMNotificationListener {
 
     private static final Logger LOG = LoggerFactory.getLogger(NotificationListenerAdapter.class);
@@ -83,7 +80,7 @@ public class NotificationListenerAdapter extends AbstractCommonSubscriber<Absolu
         return path();
     }
 
-    public final synchronized void listen(final DOMNotificationService notificationService) {
+    public synchronized void listen(final DOMNotificationService notificationService) {
         if (!isListening()) {
             setRegistration(notificationService.registerNotificationListener(this, getSchemaPath()));
         }
@@ -5,13 +5,13 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.formatters;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
-import static org.opendaylight.restconf.common.formatters.NotificationFormatter.XML_OUTPUT_FACTORY;
-import static org.opendaylight.restconf.common.formatters.XMLNotificationFormatter.DATA_CHANGED_NAMESPACE;
-import static org.opendaylight.restconf.common.formatters.XMLNotificationFormatter.DATA_CHANGED_NOTIFICATION_ELEMENT;
-import static org.opendaylight.restconf.common.formatters.XMLNotificationFormatter.NOTIFICATION_ELEMENT;
-import static org.opendaylight.restconf.common.formatters.XMLNotificationFormatter.NOTIFICATION_NAMESPACE;
+import static org.opendaylight.restconf.nb.rfc8040.streams.listeners.NotificationFormatter.XML_OUTPUT_FACTORY;
+import static org.opendaylight.restconf.nb.rfc8040.streams.listeners.XMLNotificationFormatter.DATA_CHANGED_NAMESPACE;
+import static org.opendaylight.restconf.nb.rfc8040.streams.listeners.XMLNotificationFormatter.DATA_CHANGED_NOTIFICATION_ELEMENT;
+import static org.opendaylight.restconf.nb.rfc8040.streams.listeners.XMLNotificationFormatter.NOTIFICATION_ELEMENT;
+import static org.opendaylight.restconf.nb.rfc8040.streams.listeners.XMLNotificationFormatter.NOTIFICATION_NAMESPACE;
 
 import java.io.IOException;
 import java.io.StringWriter;
@@ -20,14 +20,13 @@ import java.util.Collection;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 import javax.xml.xpath.XPathExpressionException;
-import org.opendaylight.restconf.common.serializer.XmlDataTreeCandidateSerializer;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 
 public final class XMLDataTreeCandidateFormatter extends DataTreeCandidateFormatter {
     private static final XMLDataTreeCandidateFormatter INSTANCE = new XMLDataTreeCandidateFormatter();
 
-    public static final DataTreeCandidateFormatterFactory FACTORY =
+    static final DataTreeCandidateFormatterFactory FACTORY =
         new DataTreeCandidateFormatterFactory() {
             @Override
             public XMLDataTreeCandidateFormatter getFormatter(final String xpathFilter)
@@ -42,6 +41,7 @@ public final class XMLDataTreeCandidateFormatter extends DataTreeCandidateFormat
         };
 
     private XMLDataTreeCandidateFormatter() {
+
     }
 
     private XMLDataTreeCandidateFormatter(final String xpathFilter) throws XPathExpressionException {
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.formatters;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import java.io.IOException;
 import java.io.StringWriter;
@@ -19,7 +19,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWrit
 import org.opendaylight.yangtools.yang.data.codec.xml.XMLStreamNormalizedNodeStreamWriter;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 
-public class XMLNotificationFormatter extends NotificationFormatter {
+final class XMLNotificationFormatter extends NotificationFormatter {
     private static final XMLNotificationFormatter INSTANCE = new XMLNotificationFormatter();
 
     static final String NOTIFICATION_NAMESPACE = "urn:ietf:params:xml:ns:netconf:notification:1.0";
@@ -28,9 +28,9 @@ public class XMLNotificationFormatter extends NotificationFormatter {
     static final String DATA_CHANGED_NAMESPACE = "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote";
     static final String DATA_CHANGED_NOTIFICATION_ELEMENT = "data-changed-notification";
 
-    public static final String DATA_CHANGE_EVENT_ELEMENT = "data-change-event";
+    static final String DATA_CHANGE_EVENT_ELEMENT = "data-change-event";
 
-    public static final NotificationFormatterFactory FACTORY = new NotificationFormatterFactory() {
+    static final NotificationFormatterFactory FACTORY = new NotificationFormatterFactory() {
         @Override
         public XMLNotificationFormatter getFormatter(final String xpathFilter) throws XPathExpressionException {
             return new XMLNotificationFormatter(xpathFilter);
@@ -42,16 +42,17 @@ public class XMLNotificationFormatter extends NotificationFormatter {
         }
     };
 
-    public XMLNotificationFormatter() {
+    XMLNotificationFormatter() {
+
     }
 
-    public XMLNotificationFormatter(String xpathFilter) throws XPathExpressionException {
+    XMLNotificationFormatter(final String xpathFilter) throws XPathExpressionException {
         super(xpathFilter);
     }
 
     @Override
-    String createText(EffectiveModelContext schemaContext, DOMNotification input, Instant now,
-                      boolean leafNodesOnly, boolean skipData)
+    String createText(final EffectiveModelContext schemaContext, final DOMNotification input, final Instant now,
+                      final boolean leafNodesOnly, final boolean skipData)
             throws IOException {
         final StringWriter writer = new StringWriter();
         try {
@@ -5,10 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.common.serializer;
+package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
 
 import static java.util.Objects.requireNonNull;
-import static org.opendaylight.restconf.common.formatters.XMLNotificationFormatter.DATA_CHANGE_EVENT_ELEMENT;
+import static org.opendaylight.restconf.nb.rfc8040.streams.listeners.XMLNotificationFormatter.DATA_CHANGE_EVENT_ELEMENT;
 
 import java.util.Collection;
 import javax.xml.stream.XMLStreamException;
@@ -21,10 +21,10 @@ import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference;
 
-public class XmlDataTreeCandidateSerializer extends AbstractWebsocketSerializer<Exception> {
+final class XmlDataTreeCandidateSerializer extends AbstractWebsocketSerializer<Exception> {
     private final XMLStreamWriter xmlWriter;
 
-    public XmlDataTreeCandidateSerializer(final EffectiveModelContext context, final XMLStreamWriter xmlWriter) {
+    XmlDataTreeCandidateSerializer(final EffectiveModelContext context, final XMLStreamWriter xmlWriter) {
         super(context);
         this.xmlWriter = requireNonNull(xmlWriter);
     }