BUG-58: refactor to take advantage of netty
[bgpcep.git] / pcep / api / src / main / java / org / opendaylight / protocol / pcep / PCEPSession.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.pcep;
9
10 import org.opendaylight.protocol.framework.ProtocolSession;
11 import org.opendaylight.protocol.pcep.object.PCEPCloseObject;
12
13 /**
14  * PCEP Session represents the finite state machine in PCEP, including timers and its purpose is to create a PCEP
15  * connection between PCE/PCC. Session is automatically started, when TCP connection is created, but can be stopped
16  * manually. If the session is up, it has to redirect messages to/from user. Handles also malformed messages and unknown
17  * requests.
18  */
19 public interface PCEPSession extends ProtocolSession<PCEPMessage> {
20
21         /**
22          * Sends message from user to PCE/PCC. If the user sends an Open Message, the session returns an error (open message
23          * is only allowed, when a PCEP handshake is in progress). Close message will close the session and free all the
24          * resources.
25          * 
26          * @param message message to be sent
27          */
28         public void sendMessage(PCEPMessage message);
29
30         public void close(PCEPCloseObject.Reason reason);
31 }