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
8 package org.opendaylight.openflowjava.protocol.api.connection;
10 import com.google.common.annotations.Beta;
11 import java.net.InetSocketAddress;
12 import java.util.concurrent.Future;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolService;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SystemNotificationsListener;
19 * @author michal.polkorab
21 public interface ConnectionAdapter extends OpenflowProtocolService {
24 * disconnect corresponding switch
25 * @return future set to true, when disconnect completed
27 Future<Boolean> disconnect();
30 * @return true, if connection to switch is alive
35 * @return address of the remote end - address of a switch if connected
37 InetSocketAddress getRemoteAddress();
39 * @param messageListener here will be pushed all messages from switch
41 void setMessageListener(OpenflowProtocolListener messageListener);
44 * @param systemListener here will be pushed all system messages from library
46 void setSystemListener(SystemNotificationsListener systemListener);
49 * Throws exception if any of required listeners is missing
51 void checkListeners();
54 * notify listener about connection ready-to-use event
56 void fireConnectionReadyNotification();
59 * set listener for connection became ready-to-use event
60 * @param connectionReadyListener
62 void setConnectionReadyListener(ConnectionReadyListener connectionReadyListener);
65 * sets option for automatic channel reading;
66 * if set to false, incoming messages won't be read
68 void setAutoRead(boolean autoRead);
71 * @return true, if channel is configured to autoread
76 * Registers a new bypass outbound queue
78 * @param maxQueueDepth
79 * @param maxBarrierNanos
80 * @return An {@link OutboundQueueHandlerRegistration}
83 <T extends OutboundQueueHandler> OutboundQueueHandlerRegistration<T> registerOutboundQueueHandler(T handler,
84 int maxQueueDepth, long maxBarrierNanos);