import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Interner;
import com.google.common.collect.Interners;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
}
@Override
+ @SuppressFBWarnings("BC_UNCONFIRMED_CAST")
protected void handleMessage(final NetconfHelloMessage netconfMessage) throws NetconfDocumentedException {
final NetconfClientSession session = getSessionForHelloMessage(netconfMessage);
replaceHelloMessageInboundHandler(session);
// If exi should be used, try to initiate exi communication
// Call negotiationSuccessFul after exi negotiation is finished successfully or not
- if (shouldUseExi(netconfMessage)) {
+ final NetconfMessage startExiMessage = sessionPreferences.getStartExiMessage();
+ if (shouldUseExi(netconfMessage) && startExiMessage instanceof NetconfStartExiMessage) {
LOG.debug("Netconf session {} should use exi.", session);
- NetconfStartExiMessage startExiMessage = (NetconfStartExiMessage) sessionPreferences.getStartExiMessage();
- tryToInitiateExi(session, startExiMessage);
+ tryToInitiateExi(session, (NetconfStartExiMessage) startExiMessage);
} else {
// Exi is not supported, release session immediately
LOG.debug("Netconf session {} isn't capable of using exi.", session);
});
}
+ @SuppressFBWarnings("BC_UNCONFIRMED_CAST")
private boolean shouldUseExi(final NetconfHelloMessage helloMsg) {
return containsExi10Capability(helloMsg.getDocument())
&& containsExi10Capability(sessionPreferences.getHelloMessage().getDocument());
}
}
- return Long.valueOf(textContent);
+ return Long.parseLong(textContent);
}
private static String getSessionIdWithXPath(final Document doc, final XPathExpression sessionIdXPath) {