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.MessageCodeKey;
15 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey;
16 import org.opendaylight.openflowjava.protocol.api.extensibility.OFGeneralDeserializer;
17 import org.opendaylight.openflowjava.protocol.api.extensibility.OFGeneralSerializer;
19 import com.google.common.util.concurrent.ListenableFuture;
23 * @author michal.polkorab
26 public interface SwitchConnectionProvider extends AutoCloseable {
29 * @param configuration [protocol, port, address and supported features]
31 void setConfiguration(ConnectionConfiguration configuration);
34 * start listening to switches, but please don't forget to do
35 * {@link #setSwitchConnectionHandler(SwitchConnectionHandler)} first
36 * @return future, triggered to true, when listening channel is up and running
38 ListenableFuture<Boolean> startup();
41 * stop listening to switches
42 * @return future, triggered to true, when all listening channels are down
44 ListenableFuture<Boolean> shutdown();
47 * @param switchConHandler instance being informed when new switch connects
49 void setSwitchConnectionHandler(SwitchConnectionHandler switchConHandler);
52 * Registers custom serializer
53 * @param key used for serializer lookup
54 * @param serializer serializer implementation
56 public <KEY_TYPE> void registerSerializer(MessageTypeKey<KEY_TYPE> key,
57 OFGeneralSerializer serializer);
60 * Registers custom deserializer
61 * @param key used for deserializer lookup
62 * @param deserializer deserializer instance
64 public void registerDeserializer(MessageCodeKey key, OFGeneralDeserializer deserializer);