OpenDaylight Controller functional modules.
[controller.git] / opendaylight / forwardingrulesmanager / src / main / java / org / opendaylight / controller / forwardingrulesmanager / PortGroupProvider.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
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
8  */
9
10 package org.opendaylight.controller.forwardingrulesmanager;
11
12 import java.util.Map;
13
14 import org.opendaylight.controller.sal.core.Node;
15
16 /**
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.
20  *
21  *
22  *
23  */
24 public interface PortGroupProvider {
25     /**
26      * This method is invoked by the Controller towards the Provider when a new port group is configured.
27      *
28      * @param config New PortGroupConfig object created by user Configuration.
29      * @return true if successful. false otherwise.
30      */
31     public boolean createPortGroupConfig(PortGroupConfig config);
32
33     /**
34      * This method is invoked by the Controller towards the Provider when an existing port group is deleted.
35      *
36      * @param config Existing Port Group Configuration deleted by the user.
37      * @return true if successful. false otherwise.
38      */
39     public boolean deletePortGroupConfig(PortGroupConfig config);
40
41     /**
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.
45      *
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.
49      */
50     public Map<Node, PortGroup> getPortGroupData(PortGroupConfig config);
51
52     /**
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.
56      *
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.
61      * @see PortGroup
62      */
63     public PortGroup getPortGroupData(PortGroupConfig config,
64             long matrixSwitchId);
65
66     /**
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.
69      */
70     public void registerPortGroupChange(PortGroupChangeListener listener);
71
72     /**
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.
77      *
78      * @return Usage string.
79      */
80     public String getApplicationDrivenMatchCriteriaUsage();
81
82     /**
83      * Returns the name of the Custom Application that implements  PortGroupProvider interface.
84      *
85      * @return Provider Name
86      */
87     public String getProviderName();
88
89     /**
90      * Controller uses this method to check with the Provider supports the matchCriteria String configured by the User.
91      *
92      * @param matchCriteria
93      * @return true if the Provider supports the matchCriteria String. false otherwise.
94      */
95     public boolean isMatchCriteriaSupported(String matchCriteria);
96 }