2 * Copyright (c) 2013 Pantheon Technologies s.r.o. 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
10 package org.opendaylight.openflowjava.protocol.spi.connection;
12 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
13 import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler;
14 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey;
15 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
16 import org.opendaylight.yangtools.yang.binding.DataObject;
18 import com.google.common.util.concurrent.ListenableFuture;
22 * @author michal.polkorab
25 public interface SwitchConnectionProvider extends AutoCloseable {
28 * @param configuration [protocol, port, address and supported features]
30 void setConfiguration(ConnectionConfiguration configuration);
33 * start listening to switches, but please don't forget to do
34 * {@link #setSwitchConnectionHandler(SwitchConnectionHandler)} first
35 * @return future, triggered to true, when listening channel is up and running
37 ListenableFuture<Boolean> startup();
40 * stop listening to switches
41 * @return future, triggered to true, when all listening channels are down
43 ListenableFuture<Boolean> shutdown();
46 * @param switchConHandler instance being informed when new switch connects
48 void setSwitchConnectionHandler(SwitchConnectionHandler switchConHandler);
51 * Registers custom serializer
52 * @param key used for serializer lookup
53 * @param serializer serializer implementation
55 public <E extends DataObject> void registerCustomSerializer(MessageTypeKey<E> key,
56 OFSerializer<E> serializer);