handled review comments (sending rpc message to library and version
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / session / SessionContext.java
1 /**
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.openflowplugin.openflow.md.core.session;
10
11
12 import java.util.Map.Entry;
13 import java.util.Set;
14
15 import org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductor;
16 import org.opendaylight.openflowplugin.openflow.md.core.SwitchConnectionDistinguisher;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
18
19 /**
20  * @author mirehak
21  */
22 public interface SessionContext {
23
24     /**
25      * @return primary connection wrapper
26      */
27     public ConnectionConductor getPrimaryConductor();
28
29     /**
30      * @return the features of corresponding switch
31      */
32     public GetFeaturesOutput getFeatures();
33
34     /**
35      * @param auxiliaryKey
36      *            key under which the auxiliary conductor is stored
37      * @return list of auxiliary connection wrappers
38      */
39     public ConnectionConductor getAuxiliaryConductor(
40             SwitchConnectionDistinguisher auxiliaryKey);
41
42     /**
43      * @return entries of all auxiliary connections wrapped in conductors in this session
44      */
45     public Set<Entry<SwitchConnectionDistinguisher, ConnectionConductor>> getAuxiliaryConductors();
46
47     /**
48      * register new auxiliary connection wrapped in {@link ConnectionConductor}
49      *
50      * @param auxiliaryKey
51      * @param conductor
52      */
53     public void addAuxiliaryConductor(SwitchConnectionDistinguisher auxiliaryKey,
54             ConnectionConductor conductor);
55
56     /**
57      * @param connectionCookie
58      * @return removed connectionConductor
59      */
60     public ConnectionConductor removeAuxiliaryConductor(
61             SwitchConnectionDistinguisher connectionCookie);
62
63     /**
64      * @return true if this session is valid
65      */
66     public boolean isValid();
67
68     /**
69      * @param valid the valid to set
70      */
71     public void setValid(boolean valid);
72
73     /**
74      * @return the sessionKey
75      */
76     public SwitchConnectionDistinguisher getSessionKey();
77
78     // TODO:: add listeners here, manager will set them and conductor use them
79
80     /**
81      *  get message dispatch service to send the message to switch
82      *
83      * @return the message service
84      */
85     public IMessageDispatchService getMessageDispatchService();
86
87    /**
88     * @return the unique xid for this session
89     */
90     public Long getNextXid();
91
92
93
94 }