use of org.opendaylight.netconf.shaded.exificient.core.exceptions.EXIException in project netconf by opendaylight.
the class AbstractNetconfSession method startExiCommunication.
@Override
public final void startExiCommunication(final NetconfMessage startExiMessage) {
final EXIParameters exiParams;
try {
exiParams = EXIParameters.fromXmlElement(XmlElement.fromDomDocument(startExiMessage.getDocument()));
} catch (final UnsupportedOption e) {
LOG.warn("Unable to parse EXI parameters from {} on session {}", startExiMessage, this, e);
throw new IllegalArgumentException("Cannot parse options", e);
}
final NetconfEXICodec exiCodec = NetconfEXICodec.forParameters(exiParams);
final NetconfMessageToEXIEncoder exiEncoder = NetconfMessageToEXIEncoder.create(exiCodec);
final NetconfEXIToMessageDecoder exiDecoder;
try {
exiDecoder = NetconfEXIToMessageDecoder.create(exiCodec);
} catch (EXIException e) {
LOG.warn("Failed to instantiate EXI decodeer for {} on session {}", exiCodec, this, e);
throw new IllegalStateException("Cannot instantiate encoder for options", e);
}
addExiHandlers(exiDecoder, exiEncoder);
LOG.debug("Session {} EXI handlers added to pipeline", this);
}
Aggregations