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.forwardingrulesmanager;
14 import org.opendaylight.controller.sal.core.Node;
17 * PortGroupProvider interface provides all the necessary blueprint for a custom application to implement
18 * in order to provide Port Grouping Service. Custom Application that implements this interface will have
19 * to handle the opaque match criteria passed to it via PortGroupConfig.
24 public interface PortGroupProvider {
26 * This method is invoked by the Controller towards the Provider when a new port group is configured.
28 * @param config New PortGroupConfig object created by user Configuration.
29 * @return true if successful. false otherwise.
31 public boolean createPortGroupConfig(PortGroupConfig config);
34 * This method is invoked by the Controller towards the Provider when an existing port group is deleted.
36 * @param config Existing Port Group Configuration deleted by the user.
37 * @return true if successful. false otherwise.
39 public boolean deletePortGroupConfig(PortGroupConfig config);
42 * Returns the complete mapping database corresponds to a PortGroup Configuration.
43 * Its the PortGroupProvider Application's responsibility to manage the Switches & the Set of its Ports that
44 * correspond to each of the Configuration and return it to the Controller when requested.
46 * @param config User Configuration
47 * @see PortGroupConfig
48 * @return Database of Switch-Id to PortGroup mapping that corresponds to the Port Group User Configuration.
50 public Map<Node, PortGroup> getPortGroupData(PortGroupConfig config);
53 * Returns PortGroup data for a given Switch and user Configuration.
54 * Its the PortGroupProvider Application's responsibility to manage the Switches & the Set of its Ports that
55 * correspond to each of the Configuration and return it to the Controller when requested.
57 * @param config User Configuration
58 * @param matrixSwitchId Switch Id that represents an openflow Switch
59 * @see PortGroupConfig
60 * @return PortGroup data for a given Openflow switch.
63 public PortGroup getPortGroupData(PortGroupConfig config,
67 * Registers a Listener for Port Group membership changes based on Custom application algorithm.
68 * @param listener A Controller module that listens to events from the Custom Port Grouping Application.
70 public void registerPortGroupChange(PortGroupChangeListener listener);
73 * Application returns an Usage string for the Match Criteria User Configuration.
74 * Controller provides an opportunity for application to implement Custom Algorithm for Port Grouping.
75 * This method exposes the custom algorithm to the user so that the user can configure the matchString
76 * regular expression in PortGroupConfig appropriately.
78 * @return Usage string.
80 public String getApplicationDrivenMatchCriteriaUsage();
83 * Returns the name of the Custom Application that implements PortGroupProvider interface.
85 * @return Provider Name
87 public String getProviderName();
90 * Controller uses this method to check with the Provider supports the matchCriteria String configured by the User.
92 * @param matchCriteria
93 * @return true if the Provider supports the matchCriteria String. false otherwise.
95 public boolean isMatchCriteriaSupported(String matchCriteria);