2 * Copyright (c) 2015 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 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.connection;
11 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply;
16 * Each OpenFlow session is tracked by a Connection Context. These attach to a particular Device Context in such a way,
17 * that there is at most one primary session associated with a Device Context.
19 * Created by Martin Bobak <mbobak@cisco.com> on 25.2.2015.
21 public interface ConnectionContext extends MultiMsgCollector {
24 * distinguished connection states
26 enum CONNECTION_STATE {
28 * initial phase of talking to switch
32 * standard phase - interacting with switch
36 * connection is idle, waiting for echo reply from switch
40 * talking to switch is over - resting in pieces
49 void setNodeId(NodeId nodeId);
52 * Method returns identifier of device whic connection represents this context.
54 * @return {@link org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId}
59 * @return the connectionAdapter
61 ConnectionAdapter getConnectionAdapter();
65 * Method returns current connection state.
67 * @return {@link ConnectionContext.CONNECTION_STATE}
69 CONNECTION_STATE getConnectionState();
72 * Method sets connection state of current context.
74 * @param connectionState
76 void setConnectionState(CONNECTION_STATE connectionState);
79 * @param featuresReply as received from device during handshake
81 void setFeatures(FeaturesReply featuresReply);
84 * @return featureReply as received from device during handshake
86 FeaturesReply getFeatures();