import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
+
import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
import org.opendaylight.controller.netconf.api.NetconfMessage;
-import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
import org.opendaylight.controller.netconf.api.NetconfSessionListener;
import org.opendaylight.controller.netconf.api.NetconfTerminationReason;
+import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultCloseSession;
+import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService;
import org.opendaylight.controller.netconf.util.messages.SendErrorExceptionUtil;
import org.opendaylight.controller.netconf.util.xml.XmlElement;
-import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;
import org.opendaylight.controller.netconf.util.xml.XmlUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
session.onIncommingRpcFail();
throw new IllegalStateException("Unable to process incoming message " + netconfMessage, e);
} catch (NetconfDocumentedException e) {
- logger.trace("Error occured while processing mesage {}",e);
+ logger.trace("Error occurred while processing message",e);
session.onOutgoingRpcError();
session.onIncommingRpcFail();
SendErrorExceptionUtil.sendErrorMessage(session, e, netconfMessage);
logger.info("Session {} closed successfully", session.getSessionId());
}
+
+
private NetconfMessage processDocument(final NetconfMessage netconfMessage, NetconfServerSession session)
throws NetconfDocumentedException {
Document rpcReply = operationRouter.onNetconfMessage(incomingDocument, session);
+ rpcReply = SubtreeFilter.applySubtreeFilter(incomingDocument, rpcReply);
+
session.onIncommingRpcSuccess();
responseDocument.appendChild(responseDocument.importNode(rpcReply.getDocumentElement(), true));