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 io.netty.channel.ChannelFuture;
11 import io.netty.util.concurrent.Future;
13 import java.io.IOException;
14 import java.net.InetSocketAddress;
16 import org.opendaylight.protocol.framework.ReconnectStrategy;
17 import org.opendaylight.protocol.framework.SessionListenerFactory;
20 * Dispatcher class for creating servers and clients.
22 public interface PCEPDispatcher {
24 * Creates server. Each server needs three factories to pass their instances to client sessions.
25 * @param address to be bound with the server
26 * @param listenerFactory to create listeners for clients
27 * @param proposalFactory to create proposed open objects for clients
28 * @param checkerFactory to create session characteristics checker for clients
29 * @return instance of PCEPServer
30 * @throws IOException if some IO error occurred
32 public ChannelFuture createServer(final InetSocketAddress address, final SessionListenerFactory<PCEPSessionListener> listenerFactory);
35 * Creates a client. Needs to be started via the start method.
36 * @param connection PCEP connection settings
37 * @param strategy Reconnection strategy to be used for TCP-level connection
38 * @throws IOException if some IO error occurred
40 public Future<? extends PCEPSession> createClient(InetSocketAddress address, final PCEPSessionListener listener, final ReconnectStrategy strategy);