X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fmessagebus-netconf%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fmessagebus%2Feventsources%2Fnetconf%2FNetconfEventSourceRegistration.java;h=2ae032288b8901207c5858ed75aaec3d342ad778;hb=1d91e1bbe29d0da6ea427a5d0837064c8a3d5134;hp=649454ef11c866b945e81f70a7d806297c1ee645;hpb=2295d50e7212d80a9bc752f655fa66790ad45022;p=netconf.git diff --git a/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceRegistration.java b/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceRegistration.java index 649454ef11..2ae032288b 100644 --- a/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceRegistration.java +++ b/netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceRegistration.java @@ -7,11 +7,11 @@ */ package org.opendaylight.netconf.messagebus.eventsources.netconf; -import com.google.common.base.Optional; import com.google.common.base.Preconditions; import java.util.List; -import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint; +import java.util.Optional; import org.opendaylight.controller.messagebus.spi.EventSourceRegistration; +import org.opendaylight.mdsal.dom.api.DOMMountPoint; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus.ConnectionStatus; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.available.capabilities.AvailableCapability; @@ -60,7 +60,7 @@ public final class NetconfEventSourceRegistration implements AutoCloseable { } private static boolean isEventSource(final Node node) { - final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class); + final NetconfNode netconfNode = node.augmentation(NetconfNode.class); if (netconfNode == null) { return false; } @@ -88,11 +88,11 @@ public final class NetconfEventSourceRegistration implements AutoCloseable { } Optional> getEventSourceRegistration() { - return Optional.fromNullable(eventSourceRegistration); + return Optional.ofNullable(eventSourceRegistration); } NetconfNode getNetconfNode() { - return node.getAugmentation(NetconfNode.class); + return node.augmentation(NetconfNode.class); } void updateStatus() { @@ -104,12 +104,12 @@ public final class NetconfEventSourceRegistration implements AutoCloseable { changeStatus(netconfConnStatus); } - private boolean checkConnectionStatusType(ConnectionStatus status) { + private static boolean checkConnectionStatusType(final ConnectionStatus status) { return status == ConnectionStatus.Connected || status == ConnectionStatus.Connecting || status == ConnectionStatus.UnableToConnect; } - private void changeStatus(ConnectionStatus newStatus) { + private void changeStatus(final ConnectionStatus newStatus) { Preconditions.checkNotNull(newStatus); Preconditions.checkState(this.currentNetconfConnStatus != null); if (!checkConnectionStatusType(newStatus)) { @@ -155,7 +155,7 @@ public final class NetconfEventSourceRegistration implements AutoCloseable { this.eventSourceRegistration = registration; } - private YangInstanceIdentifier domMountPath(final NodeId nodeId) { + private static YangInstanceIdentifier domMountPath(final NodeId nodeId) { return YangInstanceIdentifier.builder(NETCONF_DEVICE_DOM_PATH) .nodeWithKey(Node.QNAME, NODE_ID_QNAME, nodeId.getValue()).build(); }