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.server.api.monitoring;
11 * Class represents change in a {@link NetconfManagementSession}.
13 public final class SessionEvent {
14 private final NetconfManagementSession session;
15 private final Type type;
17 private SessionEvent(final NetconfManagementSession session, final 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(final NetconfManagementSession session) {
41 return new SessionEvent(session, Type.IN_RPC_SUCCESS);
44 public static SessionEvent inRpcFail(final NetconfManagementSession session) {
45 return new SessionEvent(session, Type.IN_RPC_FAIL);
48 public static SessionEvent outRpcError(final NetconfManagementSession session) {
49 return new SessionEvent(session, Type.OUT_RPC_ERROR);
52 public static SessionEvent notification(final NetconfManagementSession session) {
53 return new SessionEvent(session, Type.NOTIFICATION);
61 * Correct rpc message received.
66 * Incorrect rpc message received.
71 * rpc-reply messages sent that contained an rpc-error element.
76 * Notification message sent.