Bug 1764 - created new bundle responsible for default OF switch configuration
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / md / core / session / SessionManager.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.api.openflow.md.core.session;
10
11 import com.google.common.util.concurrent.ListeningExecutorService;
12 import java.util.Collection;
13 import java.util.List;
14 import java.util.Map;
15 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
16 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
17 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
18 import org.opendaylight.openflowplugin.api.openflow.md.core.ConnectionConductor;
19 import org.opendaylight.openflowplugin.api.openflow.md.core.IMDMessageTranslator;
20 import org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher;
21 import org.opendaylight.openflowplugin.api.statistics.MessageSpy;
22 import org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey;
23 import org.opendaylight.openflowplugin.api.openflow.md.queue.PopListener;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
25 import org.opendaylight.yangtools.concepts.ListenerRegistration;
26 import org.opendaylight.yangtools.yang.binding.DataContainer;
27 import org.opendaylight.yangtools.yang.binding.DataObject;
28
29 /**
30  * @author mirehak
31  */
32 public interface SessionManager extends AutoCloseable {
33
34     /**
35      * @param sessionKey
36      * @return corresponding conductor, holding {@link ConnectionAdapter} to
37      * primary connection
38      */
39     public SessionContext getSessionContext(SwitchSessionKeyOF sessionKey);
40
41     /**
42      * disconnect all underlying {@link ConnectionAdapter}s and notify listeners
43      *
44      * @param sessionKey
45      */
46     public void invalidateSessionContext(SwitchSessionKeyOF sessionKey);
47
48     /**
49      * register session context
50      *
51      * @param sessionKey
52      * @param context
53      */
54     public void addSessionContext(SwitchSessionKeyOF sessionKey, SessionContext context);
55
56     /**
57      * disconnect particular auxiliary {@link ConnectionAdapter}, identified by
58      * sessionKey and connectionCookie
59      *
60      * @param sessionKey
61      * @param connectionCookie
62      */
63     public void invalidateAuxiliary(SwitchSessionKeyOF sessionKey,
64                                     SwitchConnectionDistinguisher connectionCookie);
65
66     /**
67      * @param connectionConductor
68      */
69     public void invalidateOnDisconnect(ConnectionConductor connectionConductor);
70
71     /**
72      * @param translatorMapping
73      */
74     public void setTranslatorMapping(Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> translatorMapping);
75
76     /**
77      * @return translator mapping
78      */
79     public Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> getTranslatorMapping();
80
81     /**
82      * @param notificationProviderService
83      */
84     public void setNotificationProviderService(NotificationProviderService notificationProviderService);
85
86     /**
87      * @return notificationServiceProvider
88      */
89     public DataBroker getDataBroker();
90
91     /**
92      * @param dataBroker
93      */
94     public void setDataBroker(DataBroker dataBroker);
95
96     /**
97      * @return notificationServiceProvider
98      */
99     public NotificationProviderService getNotificationProviderService();
100
101     /**
102      * @param listener
103      * @return registration
104      */
105     public ListenerRegistration<SessionListener> registerSessionListener(SessionListener listener);
106
107     /**
108      * @return popListener mapping, key=message type; value=collection of listeners
109      */
110     public Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> getPopListenerMapping();
111
112     /**
113      * @param popListenerMapping the popListenerMapping to set
114      */
115     void setPopListenerMapping(Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> popListenerMapping);
116
117     /**
118      * @param rpcPoolDelegator
119      */
120     void setRpcPool(ListeningExecutorService rpcPoolDelegator);
121
122     /**
123      * @return the rpcPool instance
124      */
125     ListeningExecutorService getRpcPool();
126
127     /**
128      * @param messageSpy
129      */
130     void setMessageSpy(MessageSpy<DataContainer> messageSpy);
131
132     /**
133      * @return the messageSpy
134      */
135     MessageSpy<DataContainer> getMessageSpy();
136
137 }