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 java.util.EventListener;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
15 * Listener that receives session informations from the session.
18 public interface PCEPSessionListener extends EventListener {
20 * Fired when the session was established successfully.
22 * @param session Peer address families which we accepted
24 void onSessionUp(PCEPSession session);
27 * Fired when the session went down because of an IO error. Implementation should take care of closing underlying
30 * @param session that went down
31 * @param exception Exception that was thrown as the cause of session being down
33 void onSessionDown(PCEPSession session, Exception exception);
36 * Fired when the session is terminated locally. The session has already been closed and transitioned to IDLE state.
37 * Any outstanding queued messages were not sent. The user should not attempt to make any use of the session.
39 * @param reason the cause why the session went down
41 void onSessionTerminated(PCEPSession session, PCEPTerminationReason reason);
44 * Fired when a normal protocol message is received.
46 * @param message Protocol message
48 void onMessage(PCEPSession session, Message message);