Integrate MRI projects for Neon
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / BindingDOMMountPointListenerAdapter.java
index f33148271f4ba85590a35452efd7dfc8899cce21..ef80c78fb49b7a65342f15918da6c712589b7942 100644 (file)
@@ -7,23 +7,28 @@
  */
 package org.opendaylight.controller.md.sal.binding.impl;
 
-import com.google.common.base.Optional;
+import java.util.Optional;
 import org.opendaylight.controller.md.sal.binding.api.MountPointService.MountPointListener;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-final class BindingDOMMountPointListenerAdapter<T extends MountPointListener> implements ListenerRegistration<T>, MountProvisionListener {
+final class BindingDOMMountPointListenerAdapter<T extends MountPointListener>
+        implements ListenerRegistration<T>, DOMMountPointListener {
+    private static final Logger LOG = LoggerFactory.getLogger(BindingDOMMountPointListenerAdapter.class);
 
     private final T listener;
-    private final ListenerRegistration<MountProvisionListener> registration;
+    private final ListenerRegistration<DOMMountPointListener> registration;
     private final BindingToNormalizedNodeCodec codec;
 
-    public BindingDOMMountPointListenerAdapter(final T listener, final BindingToNormalizedNodeCodec codec, final DOMMountPointService mountService) {
+    BindingDOMMountPointListenerAdapter(final T listener, final BindingToNormalizedNodeCodec codec,
+            final DOMMountPointService mountService) {
         this.listener = listener;
         this.codec = codec;
         this.registration = mountService.registerProvisionListener(this);
@@ -45,14 +50,15 @@ final class BindingDOMMountPointListenerAdapter<T extends MountPointListener> im
             final InstanceIdentifier<? extends DataObject> bindingPath = toBinding(path);
             listener.onMountPointCreated(bindingPath);
         } catch (final DeserializationException e) {
-            BindingDOMMountPointServiceAdapter.LOG.error("Unable to translate mountPoint path {}. Omitting event.",path,e);
+            LOG.error("Unable to translate mountPoint path {}. Omitting event.", path, e);
         }
 
     }
 
-    private InstanceIdentifier<? extends DataObject> toBinding(final YangInstanceIdentifier path) throws DeserializationException {
+    private InstanceIdentifier<? extends DataObject> toBinding(final YangInstanceIdentifier path)
+            throws DeserializationException {
         final Optional<InstanceIdentifier<? extends DataObject>> instanceIdentifierOptional = codec.toBinding(path);
-        if(instanceIdentifierOptional.isPresent()) {
+        if (instanceIdentifierOptional.isPresent()) {
             return instanceIdentifierOptional.get();
         } else {
             throw new DeserializationException("Deserialization unsuccessful, " + instanceIdentifierOptional);
@@ -65,7 +71,7 @@ final class BindingDOMMountPointListenerAdapter<T extends MountPointListener> im
             final InstanceIdentifier<? extends DataObject> bindingPath = toBinding(path);
             listener.onMountPointRemoved(bindingPath);
         } catch (final DeserializationException e) {
-            BindingDOMMountPointServiceAdapter.LOG.error("Unable to translate mountPoint path {}. Omitting event.",path,e);
+            LOG.error("Unable to translate mountPoint path {}. Omitting event.", path, e);
         }
     }
-}
\ No newline at end of file
+}