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;
12 import java.util.Map.Entry;
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;
22 public interface SessionContext {
25 * @return primary connection wrapper
27 public ConnectionConductor getPrimaryConductor();
30 * @return the features of corresponding switch
32 public GetFeaturesOutput getFeatures();
36 * key under which the auxiliary conductor is stored
37 * @return list of auxiliary connection wrappers
39 public ConnectionConductor getAuxiliaryConductor(
40 SwitchConnectionDistinguisher auxiliaryKey);
43 * @return entries of all auxiliary connections wrapped in conductors in this session
45 public Set<Entry<SwitchConnectionDistinguisher, ConnectionConductor>> getAuxiliaryConductors();
48 * register new auxiliary connection wrapped in {@link ConnectionConductor}
53 public void addAuxiliaryConductor(SwitchConnectionDistinguisher auxiliaryKey,
54 ConnectionConductor conductor);
57 * @param connectionCookie
58 * @return removed connectionConductor
60 public ConnectionConductor removeAuxiliaryConductor(
61 SwitchConnectionDistinguisher connectionCookie);
64 * @return true if this session is valid
66 public boolean isValid();
69 * @param valid the valid to set
71 public void setValid(boolean valid);
74 * @return the sessionKey
76 public SwitchConnectionDistinguisher getSessionKey();
78 // TODO:: add listeners here, manager will set them and conductor use them
81 * get message dispatch service to send the message to switch
83 * @return the message service
85 public IMessageDispatchService getMessageDispatchService();
88 * @return the unique xid for this session
90 public Long getNextXid();