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.List;
14 import java.util.Map.Entry;
16 import org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductor;
17 import org.opendaylight.openflowplugin.openflow.md.core.SwitchConnectionDistinguisher;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Port;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatus;
25 public interface SessionContext {
28 * @return primary connection wrapper
30 public ConnectionConductor getPrimaryConductor();
33 * @return the features of corresponding switch
35 public GetFeaturesOutput getFeatures();
39 * key under which the auxiliary conductor is stored
40 * @return list of auxiliary connection wrappers
42 public ConnectionConductor getAuxiliaryConductor(
43 SwitchConnectionDistinguisher auxiliaryKey);
46 * @return entries of all auxiliary connections wrapped in conductors in this session
48 public Set<Entry<SwitchConnectionDistinguisher, ConnectionConductor>> getAuxiliaryConductors();
51 * register new auxiliary connection wrapped in {@link ConnectionConductor}
56 public void addAuxiliaryConductor(SwitchConnectionDistinguisher auxiliaryKey,
57 ConnectionConductor conductor);
60 * @param connectionCookie
61 * @return removed connectionConductor
63 public ConnectionConductor removeAuxiliaryConductor(
64 SwitchConnectionDistinguisher connectionCookie);
67 * @return true if this session is valid
69 public boolean isValid();
72 * @param valid the valid to set
74 public void setValid(boolean valid);
77 * @return the sessionKey
79 public SwitchConnectionDistinguisher getSessionKey();
82 * Returns a map containing all OFPhysicalPorts of this switch.
83 * @return The Map of OFPhysicalPort
85 public Map<Long, Port> getPhysicalPorts();
88 * Returns a Set containing all port IDs of this switch.
89 * @return The Set of port ID
91 public Set<Long> getPorts();
94 * Returns OFPhysicalPort of the specified portNumber of this switch.
95 * @param portNumber The port ID
96 * @return OFPhysicalPort for the specified PortNumber
98 public Port getPhysicalPort(Long portNumber);
101 * Returns the bandwidth of the specified portNumber of this switch.
102 * @param portNumber the port ID
105 public Boolean getPortBandwidth(Long portNumber);
108 * Returns True if the port is enabled,
110 * @return True if the port is enabled
112 public boolean isPortEnabled(long portNumber);
115 * Returns True if the port is enabled.
117 * @return True if the port is enabled
119 public boolean isPortEnabled(Port port);
122 * Returns a list containing all enabled ports of this switch.
123 * @return List containing all enabled ports of this switch
125 public List<Port> getEnabledPorts();
127 public void processPortStatusMsg(PortStatus arg0);
130 // TODO:: add listeners here, manager will set them and conductor use them
133 * get message dispatch service to send the message to switch
135 * @return the message service
137 public IMessageDispatchService getMessageDispatchService();
140 * @return the unique xid for this session
142 public Long getNextXid();