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.api.openflow.md.core.session;
11 import java.util.List;
13 import java.util.Map.Entry;
15 import org.opendaylight.openflowplugin.api.openflow.md.ModelDrivenSwitch;
16 import org.opendaylight.openflowplugin.api.openflow.md.core.ConnectionConductor;
17 import org.opendaylight.openflowplugin.api.openflow.md.core.NotificationEnqueuer;
18 import org.opendaylight.openflowplugin.api.openflow.md.core.NotificationQueueWrapper;
19 import org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ControllerRole;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortGrouping;
23 import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
28 public interface SessionContext {
31 * @return primary connection wrapper
33 ConnectionConductor getPrimaryConductor();
36 * @return the features of corresponding switch
38 GetFeaturesOutput getFeatures();
41 * @param auxiliaryKey key under which the auxiliary conductor is stored
42 * @return list of auxiliary connection wrappers
44 ConnectionConductor getAuxiliaryConductor(
45 SwitchConnectionDistinguisher auxiliaryKey);
48 * @return entries of all auxiliary connections wrapped in conductors in this session
50 Set<Entry<SwitchConnectionDistinguisher, ConnectionConductor>> getAuxiliaryConductors();
53 * register new auxiliary connection wrapped in {@link ConnectionConductor}
58 void addAuxiliaryConductor(SwitchConnectionDistinguisher auxiliaryKey,
59 ConnectionConductor conductor);
62 * @param connectionCookie
63 * @return removed connectionConductor
65 ConnectionConductor removeAuxiliaryConductor(
66 SwitchConnectionDistinguisher connectionCookie);
69 * @return true if this session is valid
74 * @param valid the valid to set
76 void setValid(boolean valid);
79 * @return the sessionKey
81 SwitchSessionKeyOF getSessionKey();
84 * Returns a map containing all OFPhysicalPorts of this switch.
86 * @return The Map of OFPhysicalPort
89 Map<Long, PortGrouping> getPhysicalPorts();
92 * Returns a map containing all bandwidths for all OFPorts of this switch.
94 * @return The Map of bandwidths for all OFPorts
97 Map<Long, Boolean> getPortsBandwidth();
100 * Returns a Set containing all port IDs of this switch.
102 * @return The Set of port ID
105 Set<Long> getPorts();
108 * Returns OFPhysicalPort of the specified portNumber of this switch.
110 * @param portNumber The port ID
111 * @return OFPhysicalPort for the specified PortNumber
113 PortGrouping getPhysicalPort(Long portNumber);
116 * Returns the bandwidth of the specified portNumber of this switch.
118 * @param portNumber the port ID
121 Boolean getPortBandwidth(Long portNumber);
124 * Returns True if the port is enabled,
127 * @return True if the port is enabled
129 boolean isPortEnabled(long portNumber);
132 * Returns True if the port is enabled.
135 * @return True if the port is enabled
137 boolean isPortEnabled(PortGrouping port);
140 * Returns a list containing all enabled ports of this switch.
142 * @return List containing all enabled ports of this switch
144 List<PortGrouping> getEnabledPorts();
146 // TODO:: add listeners here, manager will set them and conductor use them
149 * get message dispatch service to send the message to switch
151 * @return the message service
153 IMessageDispatchService getMessageDispatchService();
156 * @return the unique xid for this session
161 * @param registration provider composite registration
163 void setProviderRegistration(CompositeObjectRegistration<ModelDrivenSwitch> registration);
166 * @return provider composite registration
168 CompositeObjectRegistration<ModelDrivenSwitch> getProviderRegistration();
171 * @return seed value for random operations
176 * @return (wrapped) notification enqueue service - {@link NotificationQueueWrapper}
178 NotificationEnqueuer getNotificationEnqueuer();
181 * @param roleOnDevice
183 void setRoleOnDevice(ControllerRole roleOnDevice);
186 * @return actual role
188 ControllerRole getRoleOnDevice();