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.controller.forwardingrulesmanager;
13 import org.opendaylight.controller.sal.core.Node;
16 * PortGroupProvider interface provides all the necessary blueprint for a custom
17 * application to implement in order to provide Port Grouping Service. Custom
18 * Application that implements this interface will have to handle the opaque
19 * 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
27 * port group is configured.
30 * New PortGroupConfig object created by user Configuration.
31 * @return true if successful. false otherwise.
33 public boolean createPortGroupConfig(PortGroupConfig config);
36 * This method is invoked by the Controller towards the Provider when an
37 * existing port group is deleted.
40 * Existing Port Group Configuration deleted by the user.
41 * @return true if successful. false otherwise.
43 public boolean deletePortGroupConfig(PortGroupConfig config);
46 * Returns the complete mapping database corresponds to a PortGroup
47 * Configuration. Its the PortGroupProvider Application's responsibility to
48 * manage the Switches & the Set of its Ports that correspond to each of the
49 * Configuration and return it to the Controller when requested.
53 * @see PortGroupConfig
54 * @return Database of Switch-Id to PortGroup mapping that corresponds to
55 * the Port Group User Configuration.
57 public Map<Node, PortGroup> getPortGroupData(PortGroupConfig config);
60 * Returns PortGroup data for a given Switch and user Configuration. Its the
61 * PortGroupProvider Application's responsibility to manage the Switches &
62 * the Set of its Ports that correspond to each of the Configuration and
63 * return it to the Controller when requested.
67 * @param matrixSwitchId
68 * Switch Id that represents an openflow Switch
69 * @see PortGroupConfig
70 * @return PortGroup data for a given Openflow switch.
73 public PortGroup getPortGroupData(PortGroupConfig config, long matrixSwitchId);
76 * Registers a Listener for Port Group membership changes based on Custom
77 * application algorithm.
80 * A Controller module that listens to events from the Custom
81 * Port Grouping Application.
83 public void registerPortGroupChange(PortGroupChangeListener listener);
86 * Application returns an Usage string for the Match Criteria User
87 * Configuration. Controller provides an opportunity for application to
88 * implement Custom Algorithm for Port Grouping. This method exposes the
89 * custom algorithm to the user so that the user can configure the
90 * matchString regular expression in PortGroupConfig appropriately.
92 * @return Usage string.
94 public String getApplicationDrivenMatchCriteriaUsage();
97 * Returns the name of the Custom Application that implements
98 * PortGroupProvider interface.
100 * @return Provider Name
102 public String getProviderName();
105 * Controller uses this method to check with the Provider supports the
106 * matchCriteria String configured by the User.
108 * @param matchCriteria
109 * @return true if the Provider supports the matchCriteria String. false
112 public boolean isMatchCriteriaSupported(String matchCriteria);