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
9 package org.opendaylight.openflowplugin.api.openflow.md.core;
11 import com.google.common.collect.Lists;
12 import java.util.List;
13 import java.util.concurrent.Future;
14 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
15 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
16 import org.opendaylight.openflowplugin.api.openflow.md.queue.QueueProcessor;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
18 import org.opendaylight.yangtools.yang.binding.DataObject;
24 public interface ConnectionConductor {
26 /** distinguished connection states */
27 public enum CONDUCTOR_STATE {
28 /** initial phase of talking to switch */
30 /** standard phase - interacting with switch */
32 /** connection is idle, waiting for echo reply from switch */
34 /** talking to switch is over - resting in pieces */
38 /** supported version ordered by height (highest version is at the beginning) */
39 List<Short> versionOrder = Lists.newArrayList((short) 0x04, (short) 0x01);
42 * initialize wiring around {@link ConnectionAdapter}
47 * @return the negotiated version
52 * @return the state of conductor
54 CONDUCTOR_STATE getConductorState();
57 * @param conductorState
59 void setConductorState(CONDUCTOR_STATE conductorState);
62 * terminates owned connection
63 * @return future result of disconnect action
65 Future<Boolean> disconnect();
68 * assign corresponding {@link SessionContext} to this conductor (to handle disconnect caused by switch)
71 void setSessionContext(SessionContext context);
74 * assign corresponding {@link org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher} to this conductor
75 * to handle disconnect caused by switch. This involves auxiliary conductors only.
78 void setConnectionCookie(SwitchConnectionDistinguisher auxiliaryKey);
81 * @return the sessionContext
83 SessionContext getSessionContext();
86 * @return the auxiliaryKey (null if this is a primary connection)
88 SwitchConnectionDistinguisher getAuxiliaryKey();
91 * @return the connectionAdapter
93 ConnectionAdapter getConnectionAdapter();
96 * assign global queueKeeper
99 void setQueueProcessor(QueueProcessor<OfHeader, DataObject> queueKeeper);
102 * @param errorHandler for internal exception handling
104 void setErrorHandler(ErrorHandler errorHandler);
109 void setId(int conductorId);