*/
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;
}
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;
}
}
Optional<EventSourceRegistration<NetconfEventSource>> getEventSourceRegistration() {
- return Optional.fromNullable(eventSourceRegistration);
+ return Optional.ofNullable(eventSourceRegistration);
}
NetconfNode getNetconfNode() {
- return node.getAugmentation(NetconfNode.class);
+ return node.augmentation(NetconfNode.class);
}
void updateStatus() {
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)) {
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();
}