Merge "Checkstyle enforcer"
[controller.git] / opendaylight / forwardingrulesmanager / api / src / main / java / org / opendaylight / controller / forwardingrulesmanager / PortGroupProvider.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.forwardingrulesmanager;
10
11 import java.util.Map;
12
13 import org.opendaylight.controller.sal.core.Node;
14
15 /**
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.
20  *
21  *
22  *
23  */
24 public interface PortGroupProvider {
25     /**
26      * This method is invoked by the Controller towards the Provider when a new
27      * port group is configured.
28      *
29      * @param config
30      *            New PortGroupConfig object created by user Configuration.
31      * @return true if successful. false otherwise.
32      */
33     public boolean createPortGroupConfig(PortGroupConfig config);
34
35     /**
36      * This method is invoked by the Controller towards the Provider when an
37      * existing port group is deleted.
38      *
39      * @param config
40      *            Existing Port Group Configuration deleted by the user.
41      * @return true if successful. false otherwise.
42      */
43     public boolean deletePortGroupConfig(PortGroupConfig config);
44
45     /**
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.
50      *
51      * @param config
52      *            User Configuration
53      * @see PortGroupConfig
54      * @return Database of Switch-Id to PortGroup mapping that corresponds to
55      *         the Port Group User Configuration.
56      */
57     public Map<Node, PortGroup> getPortGroupData(PortGroupConfig config);
58
59     /**
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.
64      *
65      * @param config
66      *            User Configuration
67      * @param matrixSwitchId
68      *            Switch Id that represents an openflow Switch
69      * @see PortGroupConfig
70      * @return PortGroup data for a given Openflow switch.
71      * @see PortGroup
72      */
73     public PortGroup getPortGroupData(PortGroupConfig config,
74             long matrixSwitchId);
75
76     /**
77      * Registers a Listener for Port Group membership changes based on Custom
78      * application algorithm.
79      *
80      * @param listener
81      *            A Controller module that listens to events from the Custom
82      *            Port Grouping Application.
83      */
84     public void registerPortGroupChange(PortGroupChangeListener listener);
85
86     /**
87      * Application returns an Usage string for the Match Criteria User
88      * Configuration. Controller provides an opportunity for application to
89      * implement Custom Algorithm for Port Grouping. This method exposes the
90      * custom algorithm to the user so that the user can configure the
91      * matchString regular expression in PortGroupConfig appropriately.
92      *
93      * @return Usage string.
94      */
95     public String getApplicationDrivenMatchCriteriaUsage();
96
97     /**
98      * Returns the name of the Custom Application that implements
99      * PortGroupProvider interface.
100      *
101      * @return Provider Name
102      */
103     public String getProviderName();
104
105     /**
106      * Controller uses this method to check with the Provider supports the
107      * matchCriteria String configured by the User.
108      *
109      * @param matchCriteria
110      * @return true if the Provider supports the matchCriteria String. false
111      *         otherwise.
112      */
113     public boolean isMatchCriteriaSupported(String matchCriteria);
114 }