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.util.concurrent.Future;
12 import java.io.IOException;
13 import java.net.InetSocketAddress;
15 import org.opendaylight.protocol.framework.ProtocolServer;
16 import org.opendaylight.protocol.framework.ReconnectStrategy;
19 * Dispatcher class for creating servers and clients.
21 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 Future<ProtocolServer> createServer(final InetSocketAddress address, final PCEPConnectionFactory connectionFactory) throws IOException;
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(PCEPConnection connection, final ReconnectStrategy strategy) throws IOException;
43 * Sets the limit of maximum unknown messages per minute. If not set by the user, default is 5 messages/minute.
44 * @param limit maximum unknown messages per minute
46 public void setMaxUnknownMessages(final int limit);