2 * Copyright (c) 2013 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.protocol.pcep;
10 import org.opendaylight.protocol.framework.SessionListener;
11 import org.opendaylight.protocol.framework.TerminationReason;
12 import org.opendaylight.protocol.pcep.object.PCEPOpenObject;
15 * Listener that receives session informations from the session.
17 public abstract class PCEPSessionListener implements SessionListener {
20 * Fired when a message is received.
22 * @param session session which received the message
23 * @param message PCEPMessage
25 public abstract void onMessage(PCEPSession session, PCEPMessage message);
28 * Fired when the session is in state UP.
30 * @param session Session which went up
31 * @param local Local open proposal which the peer accepted
32 * @param remote Peer open proposal which we accepted
34 public abstract void onSessionUp(PCEPSession session, PCEPOpenObject local, PCEPOpenObject remote);
37 * Fired when the session went down as a result of peer's decision to tear it down. Implementation should take care
38 * of closing underlying session.
40 * @param session Session which went down
41 * @param cause Reason for termination
42 * @param e exception that caused session down
44 public abstract void onSessionDown(PCEPSession session, TerminationReason cause, Exception e);
47 * Fired when the session is terminated locally. The session has already been closed and transitioned to IDLE state.
48 * Any outstanding queued messages were not sent. The user should not attempt to make any use of the session.
50 * @param session Session which went down
51 * @param cause the cause why the session went down
53 public abstract void onSessionTerminated(PCEPSession session, TerminationReason cause);