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.net.InetAddress;
11 import java.util.concurrent.Future;
13 import org.opendaylight.protocol.framework.ProtocolSession;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Tlvs;
18 * PCEP Session represents the finite state machine in PCEP, including timers and its purpose is to create a PCEP
19 * connection between PCE/PCC. Session is automatically started, when TCP connection is created, but can be stopped
20 * manually. If the session is up, it has to redirect messages to/from user. Handles also malformed messages and unknown
23 public interface PCEPSession extends ProtocolSession<Message> {
26 * Sends message from user to PCE/PCC. If the user sends an Open Message, the session returns an error (open message
27 * is only allowed, when a PCEP handshake is in progress). Close message will close the session and free all the
30 * @param message message to be sent
31 * @return Future promise which will be succeed when the message is enqueued in the socket.
33 Future<Void> sendMessage(Message message);
35 public void close(TerminationReason reason);
37 public Tlvs getRemoteTlvs();
39 public InetAddress getRemoteAddress();