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 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
26 public NetconfManagementSession getSession() {
34 public Type getType() {
38 public static SessionEvent inRpcSuccess(NetconfManagementSession session) {
39 return new SessionEvent(session, Type.IN_RPC_SUCCESS);
42 public static SessionEvent inRpcFail(NetconfManagementSession session) {
43 return new SessionEvent(session, Type.IN_RPC_FAIL);
46 public static SessionEvent outRpcError(NetconfManagementSession session) {
47 return new SessionEvent(session, Type.OUT_RPC_ERROR);
50 public static SessionEvent notification(NetconfManagementSession session) {
51 return new SessionEvent(session, Type.NOTIFICATION);
60 * Correct rpc message received
65 * Incorrect rpc message received
70 * rpc-reply messages sent that contained an rpc-error element.
75 * Notification message sent