private final NetconfOperationRouter operationRouter;
private final AutoCloseable onSessionDownCloseable;
private final NetconfOperationRouter operationRouter;
private final AutoCloseable onSessionDownCloseable;
- public NetconfServerSessionListener(NetconfOperationRouter operationRouter, SessionMonitoringService monitoringService,
- AutoCloseable onSessionDownCloseable) {
+ public NetconfServerSessionListener(final NetconfOperationRouter operationRouter, final SessionMonitoringService monitoringService,
+ final AutoCloseable onSessionDownCloseable) {
this.operationRouter = operationRouter;
this.monitoringService = monitoringService;
this.onSessionDownCloseable = onSessionDownCloseable;
}
@Override
this.operationRouter = operationRouter;
this.monitoringService = monitoringService;
this.onSessionDownCloseable = onSessionDownCloseable;
}
@Override
LOG.debug("Session {} down, reason: {}", netconfNetconfServerSession, cause.getMessage());
onDown(netconfNetconfServerSession);
}
LOG.debug("Session {} down, reason: {}", netconfNetconfServerSession, cause.getMessage());
onDown(netconfNetconfServerSession);
}
- public void onSessionTerminated(NetconfServerSession netconfNetconfServerSession,
- NetconfTerminationReason netconfTerminationReason) {
+ public void onSessionTerminated(final NetconfServerSession netconfNetconfServerSession,
+ final NetconfTerminationReason netconfTerminationReason) {
LOG.debug("Session {} terminated, reason: {}", netconfNetconfServerSession,
netconfTerminationReason.getErrorMessage());
onDown(netconfNetconfServerSession);
}
@Override
LOG.debug("Session {} terminated, reason: {}", netconfNetconfServerSession,
netconfTerminationReason.getErrorMessage());
onDown(netconfNetconfServerSession);
}
@Override
try {
Preconditions.checkState(operationRouter != null, "Cannot handle message, session up was not yet received");
try {
Preconditions.checkState(operationRouter != null, "Cannot handle message, session up was not yet received");
// destroy NetconfOperationService
session.close();
LOG.info("Session {} closed successfully", session.getSessionId());
// destroy NetconfOperationService
session.close();
LOG.info("Session {} closed successfully", session.getSessionId());