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.ModelDrivenSwitchRegistration;
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;
24 public interface SessionContext {
27 * return primary connection wrapper.
29 ConnectionConductor getPrimaryConductor();
32 * return the features of corresponding switch.
34 GetFeaturesOutput getFeatures();
37 * Auxiliary connections.
38 * @param auxiliaryKey key under which the auxiliary conductor is stored
39 * @return list of auxiliary connection wrappers
41 ConnectionConductor getAuxiliaryConductor(
42 SwitchConnectionDistinguisher auxiliaryKey);
45 * return entries of all auxiliary connections wrapped in conductors in this session.
47 Set<Entry<SwitchConnectionDistinguisher, ConnectionConductor>> getAuxiliaryConductors();
50 * register new auxiliary connection wrapped in {@link ConnectionConductor}.
52 * @param auxiliaryKey key
53 * @param conductor connection conductor
55 void addAuxiliaryConductor(SwitchConnectionDistinguisher auxiliaryKey,
56 ConnectionConductor conductor);
60 * @param connectionCookie cookie
61 * @return removed connectionConductor
63 ConnectionConductor removeAuxiliaryConductor(
64 SwitchConnectionDistinguisher connectionCookie);
67 * return true if this session is valid.
73 * @param valid the valid to set
75 void setValid(boolean valid);
78 * return the sessionKey.
80 SwitchSessionKeyOF getSessionKey();
83 * Returns a map containing all OFPhysicalPorts of this switch.
85 * @return The Map of OFPhysicalPort
88 Map<Long, PortGrouping> getPhysicalPorts();
91 * Returns a map containing all bandwidths for all OFPorts of this switch.
93 * @return The Map of bandwidths for all OFPorts
96 Map<Long, Boolean> getPortsBandwidth();
99 * Returns a Set containing all port IDs of this switch.
101 * @return The Set of port ID
104 Set<Long> getPorts();
107 * Returns OFPhysicalPort of the specified portNumber of this switch.
109 * @param portNumber The port ID
110 * @return OFPhysicalPort for the specified PortNumber
112 PortGrouping getPhysicalPort(Long portNumber);
115 * Returns the bandwidth of the specified portNumber of this switch.
117 * @param portNumber the port ID
120 Boolean getPortBandwidth(Long portNumber);
123 * Returns True if the port is enabled.
125 * @param portNumber port number
126 * @return True if the port is enabled
128 boolean isPortEnabled(long portNumber);
131 * Returns True if the port is enabled.
134 * @return True if the port is enabled
136 boolean isPortEnabled(PortGrouping port);
139 * Returns a list containing all enabled ports of this switch.
141 * @return List containing all enabled ports of this switch
143 List<PortGrouping> getEnabledPorts();
145 // TODO:: add listeners here, manager will set them and conductor use them
148 * get message dispatch service to send the message to switch.
150 * @return the message service
152 IMessageDispatchService getMessageDispatchService();
155 * return the unique xid for this session.
162 * @param registration provider composite registration
164 void setProviderRegistration(ModelDrivenSwitchRegistration registration);
167 * return provider composite registration.
168 * @return ModelDrivenSwitchRegistration
170 ModelDrivenSwitchRegistration getProviderRegistration();
173 * return seed value for random operations.
179 * return (wrapped) notification enqueue service - {@link NotificationQueueWrapper}.
180 * @return NotificationEnqueuer
182 NotificationEnqueuer getNotificationEnqueuer();
186 * @param roleOnDevice role
188 void setRoleOnDevice(ControllerRole roleOnDevice);
191 * return actual role.
194 ControllerRole getRoleOnDevice();