3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.switchmanager;
12 import java.net.InetAddress;
13 import java.util.List;
17 import org.opendaylight.controller.sal.core.Node;
18 import org.opendaylight.controller.sal.core.NodeConnector;
19 import org.opendaylight.controller.sal.core.Property;
20 import org.opendaylight.controller.sal.utils.Status;
23 * Primary purpose of this interface is to provide methods for application to
24 * access various system resources and inventory data including nodes, node
25 * connectors and their properties, Layer3 configurations, Span configurations,
26 * node configurations, network device representations viewed by Controller Web
29 public interface ISwitchManager {
31 * Add a subnet configuration
33 * @param configObject refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
34 * @return the Status object representing the result of the request
36 public Status addSubnet(SubnetConfig configObject);
39 * Remove a subnet configuration
41 * @param configObject refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
42 * @return the Status object representing the result of the request
44 public Status removeSubnet(SubnetConfig configObject);
47 * Modify a subnet configuration
49 * @param configObject refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
50 * @return the Status object representing the result of the request
52 public Status modifySubnet(SubnetConfig configObject);
55 * Remove a subnet configuration given the name
57 * @param name subnet name
58 * @return "Success" or failure reason
60 public Status removeSubnet(String name);
63 * Return a list of all known devices in the system
65 * @return returns a list of {@link org.opendaylight.controller.switchmanager.Switch}
67 public List<Switch> getNetworkDevices();
70 * Return a Set of all configured devices that are not connected to the controller
72 * @return Set of {@link org.opendaylight.controller.switchmanager.Switch}
74 public Set<Switch> getConfiguredNotConnectedSwitches();
77 * Return a list of subnet that were previously configured
79 * @return list of L3 interface {@link org.opendaylight.controller.switchmanager.SubnetConfig} configurations
81 public List<SubnetConfig> getSubnetsConfigList();
84 * Return the subnet configuration
86 * @param subnet subnet
87 * @return a L3 interface {@link org.opendaylight.controller.switchmanager.SubnetConfig} configuration
89 public SubnetConfig getSubnetConfig(String subnet);
92 * Return a subnet configuration given the network address
94 * @param networkAddress the ip address in long format
95 * @return the {@link org.opendaylight.controller.switchmanager.Subnet}
97 public Subnet getSubnetByNetworkAddress(InetAddress networkAddress);
100 * Save the current switch configurations
102 * @return the status code
104 public Status saveSwitchConfig();
107 * Add a span port configuration
109 * @param SpanConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SpanConfig}
110 * @return status code
112 public Status addSpanConfig(SpanConfig configObject);
115 * Remove a span port configuration
117 * @param SpanConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SpanConfig}
118 * @return status code
120 public Status removeSpanConfig(SpanConfig cfgObject);
123 * Return a list of span configurations that were configured previously
125 * @return list of {@link org.opendaylight.controller.switchmanager.SpanConfig} resources
127 public List<SpanConfig> getSpanConfigList();
130 * Return the list of span ports of a given node
132 * @param node {@link org.opendaylight.controller.sal.core.Node}
133 * @return the list of span {@link org.opendaylight.controller.sal.core.NodeConnector} of the node
135 public List<NodeConnector> getSpanPorts(Node node);
138 * Update Switch specific configuration such as Switch Name and Tier
140 * @param cfgConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SwitchConfig}
142 * @deprecated replaced by updateNodeConfig(switchConfig)
145 public void updateSwitchConfig(SwitchConfig cfgObject);
148 * Update Node specific configuration such as Node Name and Tier
151 * refer to {@link Open Declaration
152 * org.opendaylight.controller.switchmanager.SwitchConfig}
153 * @return "Success" or failure reason
155 public Status updateNodeConfig(SwitchConfig switchConfig);
158 * Removes node properties configured by the user
161 * Node Identifier as specified by
162 * {@link org.opendaylight.controller.sal.core.Node}
163 * @return "Success" or failure reason
165 public Status removeNodeConfig(String nodeId);
168 * Return the previously configured Switch Configuration given the node id
171 * Node Identifier as specified by
172 * {@link org.opendaylight.controller.sal.core.Node}
173 * @return {@link org.opendaylight.controller.switchmanager.SwitchConfig}
176 public SwitchConfig getSwitchConfig(String nodeId);
179 * Add node connectors to a subnet
181 * @param name The configured subnet name
182 * @param nodeConnectors list of string each representing a node connector as specified by {@link Open Declaration org.opendaylight.controller.sal.core.NodeConnector}
183 * @return The Status object indicating the result of this request
185 public Status addPortsToSubnet(String name, List<String> nodeConnectors);
188 * Remove node connectors from a subnet
190 * @param name the configured subnet name
191 * @param nodeConnectors list of string each representing a node connector as specified by {@link Open Declaration org.opendaylight.controller.sal.core.NodeConnector}
192 * @return The Status object indicating the result of this request
194 public Status removePortsFromSubnet(String name, List<String> nodeConnectors);
197 * Return the set of all the nodes
199 * @return set of {@link org.opendaylight.controller.sal.core.Node}
201 public Set<Node> getNodes();
204 * Return all the properties of a node
206 * @param node {@link org.opendaylight.controller.sal.core.Node}
207 * @return map of {@link org.opendaylight.controller.sal.core.Property} such as
208 * {@link org.opendaylight.controller.sal.core.Description} and/or
209 * {@link org.opendaylight.controller.sal.core.Tier} etc.
211 public Map<String, Property> getNodeProps(Node node);
214 * Return a specific property of a node given the property name
216 * @param node {@link org.opendaylight.controller.sal.core.Node}
217 * @param propName the property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
218 * @return {@link org.opendaylight.controller.sal.core.Property}
220 public Property getNodeProp(Node node, String propName);
223 * Set a specific property of a node
225 * @param node {@link org.opendaylight.controller.sal.core.Node}
226 * @param prop {@link org.opendaylight.controller.sal.core.Property}
228 public void setNodeProp(Node node, Property prop);
231 * Remove a property of a node
233 * @param nc {@link org.opendaylight.controller.sal.core.Node}
234 * @param propName the property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
235 * @return success or failed reason
237 public Status removeNodeProp(Node node, String propName);
240 * Remove all the properties of a node
242 * @param node {@link org.opendaylight.controller.sal.core.Node}
243 * @return success or failed reason
245 public Status removeNodeAllProps(Node node);
248 * Return all the node connectors in up state for a given node
250 * @param node {@link org.opendaylight.controller.sal.core.Node}
251 * @return set of {@link org.opendaylight.controller.sal.core.NodeConnector}
253 public Set<NodeConnector> getUpNodeConnectors(Node node);
256 * Return all the node connectors including those special ones. Status of each node connector varies.
258 * @param node {@link org.opendaylight.controller.sal.core.Node}
259 * @return all listed {@link org.opendaylight.controller.sal.core.NodeConnector}
261 public Set<NodeConnector> getNodeConnectors(Node node);
264 * Return all the physical node connectors of a node. Status of each node connector varies.
266 * @param node {@link org.opendaylight.controller.sal.core.Node}
267 * @return all physical {@link org.opendaylight.controller.sal.core.NodeConnector}
269 public Set<NodeConnector> getPhysicalNodeConnectors(Node node);
272 * Return all the properties of a node connector
274 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
275 * @return map of {@link org.opendaylight.controller.sal.core.Property} such as
276 * {@link org.opendaylight.controller.sal.core.Description} and/or
277 * {@link org.opendaylight.controller.sal.core.State} etc.
279 public Map<String, Property> getNodeConnectorProps(
280 NodeConnector nodeConnector);
283 * Return a specific property of a node connector given the property name
285 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
286 * @param propName property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
287 * @return {@link org.opendaylight.controller.sal.core.Property}
289 public Property getNodeConnectorProp(NodeConnector nodeConnector,
293 * Add a node connector and its property
295 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
296 * @param prop {@link org.opendaylight.controller.sal.core.Property}
297 * @return success or failed reason
299 public Status addNodeConnectorProp(NodeConnector nodeConnector,
303 * Remove a property of a node connector
305 * @param nc {@link org.opendaylight.controller.sal.core.NodeConnector}
306 * @param propName property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
307 * @return success or failed reason
309 public Status removeNodeConnectorProp(NodeConnector nc, String propName);
312 * Remove all the properties of a node connector
314 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
315 * @return success or failed reason
317 public Status removeNodeConnectorAllProps(NodeConnector nodeConnector);
320 * Return the node connector given its name
322 * @param node {@link org.opendaylight.controller.sal.core.Node}
323 * @param nodeConnectorName node connector identifier specified by {@link org.opendaylight.controller.sal.core.NodeConnector}
324 * @return {@link org.opendaylight.controller.sal.core.NodeConnector}
326 public NodeConnector getNodeConnector(Node node, String nodeConnectorName);
329 * Return whether the specified node connector is a special node port
330 * Example of node's special node connector are software stack, hardware path, controller...
332 * @param p {@link org.opendaylight.controller.sal.core.NodeConnector}
333 * @return true or false
335 public boolean isSpecial(NodeConnector p);
338 * Check if the node connector is up running
340 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
341 * @return true or false
343 public Boolean isNodeConnectorEnabled(NodeConnector nodeConnector);
346 * Test whether the given node connector exists.
348 * @param nc {@link org.opendaylight.controller.sal.core.NodeConnector}
349 * @return True if exists, false otherwise.
351 public boolean doesNodeConnectorExist(NodeConnector nc);
354 * Return controller MAC address
356 * @return MAC address in byte array
358 public byte[] getControllerMAC();
361 * Return MAC address for a given node
363 * @param node {@link org.opendaylight.controller.sal.core.Node}
364 * @return MAC address in byte array
366 public byte[] getNodeMAC(Node node);
369 * Create a Name/Tier/Bandwidth Property object based on given property name
370 * and value. Other property types are not supported yet.
373 * Name of the Property specified by
374 * {@link org.opendaylight.controller.sal.core.Property} and its
377 * Value of the Property specified by
378 * {@link org.opendaylight.controller.sal.core.Property} and its
380 * @return {@link org.opendaylight.controller.sal.core.Property}
382 public Property createProperty(String propName, String propValue);
385 * Returns the description for the specified node. It is either the one
386 * configured by user or the description advertised by the node.
388 * @param node the network node identifier
389 * @return the description of the specified node. If no description is
390 * configured and the network node does not provide its description,
391 * an empty string is returned.
394 public String getNodeDescription(Node node);
397 * Return all the properties of the controller
399 * @return map of {@link org.opendaylight.controller.sal.core.Property} such
400 * as {@link org.opendaylight.controller.sal.core.Description}
401 * and/or {@link org.opendaylight.controller.sal.core.Tier} etc.
403 public Map<String, Property> getControllerProperties();
406 * Return a specific property of the controller given the property name
409 * the property name specified by
410 * {@link org.opendaylight.controller.sal.core.Property} and its
412 * @return {@link org.opendaylight.controller.sal.core.Property}
414 public Property getControllerProperty(String propertyName);
417 * Set a specific property of the controller
420 * {@link org.opendaylight.controller.sal.core.Property}
423 public Status setControllerProperty(Property property);
426 * Remove a property of a node
428 * @param propertyName
429 * the property name specified by
430 * {@link org.opendaylight.controller.sal.core.Property} and its
432 * @return success or failed reason
434 public Status removeControllerProperty(String propertyName);