2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netconf.api.monitoring;
11 * Class represents change in netconf session.
13 public final class SessionEvent {
14 private final NetconfManagementSession session;
15 private final Type type;
17 private SessionEvent(NetconfManagementSession session, Type type) {
18 this.session = session;
23 * Returns session, where event occurred.
27 public NetconfManagementSession getSession() {
36 public Type getType() {
40 public static SessionEvent inRpcSuccess(NetconfManagementSession session) {
41 return new SessionEvent(session, Type.IN_RPC_SUCCESS);
44 public static SessionEvent inRpcFail(NetconfManagementSession session) {
45 return new SessionEvent(session, Type.IN_RPC_FAIL);
48 public static SessionEvent outRpcError(NetconfManagementSession session) {
49 return new SessionEvent(session, Type.OUT_RPC_ERROR);
52 public static SessionEvent notification(NetconfManagementSession session) {
53 return new SessionEvent(session, Type.NOTIFICATION);
62 * Correct rpc message received.
67 * Incorrect rpc message received.
72 * rpc-reply messages sent that contained an rpc-error element.
77 * Notification message sent.