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.openflow.md.core.session;
11 import java.util.Collection;
12 import java.util.List;
15 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
16 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
17 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
18 import org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductor;
19 import org.opendaylight.openflowplugin.openflow.md.core.IMDMessageTranslator;
20 import org.opendaylight.openflowplugin.openflow.md.core.SwitchConnectionDistinguisher;
21 import org.opendaylight.openflowplugin.openflow.md.core.TranslatorKey;
22 import org.opendaylight.openflowplugin.openflow.md.queue.PopListener;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
24 import org.opendaylight.yangtools.concepts.ListenerRegistration;
25 import org.opendaylight.yangtools.yang.binding.DataObject;
27 import com.google.common.util.concurrent.ListeningExecutorService;
32 public interface SessionManager extends AutoCloseable {
36 * @return corresponding conductor, holding {@link ConnectionAdapter} to
39 public SessionContext getSessionContext(SwitchSessionKeyOF sessionKey);
42 * disconnect all underlying {@link ConnectionAdapter}s and notify listeners
46 public void invalidateSessionContext(SwitchSessionKeyOF sessionKey);
49 * register session context
54 public void addSessionContext(SwitchSessionKeyOF sessionKey, SessionContext context);
57 * disconnect particular auxiliary {@link ConnectionAdapter}, identified by
58 * sessionKey and connectionCookie
61 * @param connectionCookie
63 public void invalidateAuxiliary(SwitchSessionKeyOF sessionKey,
64 SwitchConnectionDistinguisher connectionCookie);
67 * @param connectionConductor
69 public void invalidateOnDisconnect(ConnectionConductor connectionConductor);
72 * @param translatorMapping
74 public void setTranslatorMapping(Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> translatorMapping);
77 * @return translator mapping
79 public Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> getTranslatorMapping();
82 * @param notificationProviderService
84 public void setNotificationProviderService(NotificationProviderService notificationProviderService);
87 * @return notificationServiceProvider
89 public DataProviderService getDataProviderService();
92 * @param dataServiceProvider
94 public void setDataProviderService(DataProviderService dataServiceProvider);
97 * @return notificationServiceProvider
99 public NotificationProviderService getNotificationProviderService();
103 * @return registration
105 public ListenerRegistration<SessionListener> registerSessionListener(SessionListener listener);
108 * @return popListener mapping, key=message type; value=collection of listeners
110 public Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> getPopListenerMapping();
113 * @param popListenerMapping the popListenerMapping to set
115 void setPopListenerMapping(Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> popListenerMapping);
118 * @param newFixedThreadPool
120 void setRpcPool(ListeningExecutorService newFixedThreadPool);
123 * @return the rpcPool instance
125 ListeningExecutorService getRpcPool();