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;
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.ModelDrivenSwitch;
19 import org.opendaylight.openflowplugin.api.openflow.md.core.NotificationQueueWrapper;
20 import org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ControllerRole;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortGrouping;
24 import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
29 public interface SessionContext {
32 * @return primary connection wrapper
34 ConnectionConductor getPrimaryConductor();
37 * @return the features of corresponding switch
39 GetFeaturesOutput getFeatures();
43 * key under which the auxiliary conductor is stored
44 * @return list of auxiliary connection wrappers
46 ConnectionConductor getAuxiliaryConductor(
47 SwitchConnectionDistinguisher auxiliaryKey);
50 * @return entries of all auxiliary connections wrapped in conductors in this session
52 Set<Entry<SwitchConnectionDistinguisher, ConnectionConductor>> getAuxiliaryConductors();
55 * register new auxiliary connection wrapped in {@link ConnectionConductor}
60 void addAuxiliaryConductor(SwitchConnectionDistinguisher auxiliaryKey,
61 ConnectionConductor conductor);
64 * @param connectionCookie
65 * @return removed connectionConductor
67 ConnectionConductor removeAuxiliaryConductor(
68 SwitchConnectionDistinguisher connectionCookie);
71 * @return true if this session is valid
76 * @param valid the valid to set
78 void setValid(boolean valid);
81 * @return the sessionKey
83 SwitchSessionKeyOF getSessionKey();
86 * Returns a map containing all OFPhysicalPorts of this switch.
87 * @return The Map of OFPhysicalPort
89 Map<Long, PortGrouping> getPhysicalPorts();
92 * Returns a map containing all bandwidths for all OFPorts of this switch.
93 * @return The Map of bandwidths for all OFPorts
95 Map<Long, Boolean> getPortsBandwidth();
98 * Returns a Set containing all port IDs of this switch.
99 * @return The Set of port ID
101 Set<Long> getPorts();
104 * Returns OFPhysicalPort of the specified portNumber of this switch.
105 * @param portNumber The port ID
106 * @return OFPhysicalPort for the specified PortNumber
108 PortGrouping getPhysicalPort(Long portNumber);
111 * Returns the bandwidth of the specified portNumber of this switch.
112 * @param portNumber the port ID
115 Boolean getPortBandwidth(Long portNumber);
118 * Returns True if the port is enabled,
120 * @return True if the port is enabled
122 boolean isPortEnabled(long portNumber);
125 * Returns True if the port is enabled.
127 * @return True if the port is enabled
129 boolean isPortEnabled(PortGrouping port);
132 * Returns a list containing all enabled ports of this switch.
133 * @return List containing all enabled ports of this switch
135 List<PortGrouping> getEnabledPorts();
137 // TODO:: add listeners here, manager will set them and conductor use them
140 * get message dispatch service to send the message to switch
142 * @return the message service
144 IMessageDispatchService getMessageDispatchService();
147 * @return the unique xid for this session
152 * @param registration provider composite registration
154 void setProviderRegistration(CompositeObjectRegistration<ModelDrivenSwitch> registration);
157 * @return provider composite registration
159 CompositeObjectRegistration<ModelDrivenSwitch> getProviderRegistration();
162 * @return seed value for random operations
167 * @return (wrapped) notification enqueue service - {@link NotificationQueueWrapper}
169 NotificationEnqueuer getNotificationEnqueuer();
172 * @param roleOnDevice
174 void setRoleOnDevice(ControllerRole roleOnDevice);
177 * @return actual role
179 ControllerRole getRoleOnDevice();