Merge "Prevent ConfigPusher from killing its thread"
[controller.git] / opendaylight / sal / networkconfiguration / api / src / main / java / org / opendaylight / controller / sal / networkconfig / bridgedomain / IPluginInBridgeDomainConfigService.java
1 /*
2  * Copyright (c) 2014 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 package org.opendaylight.controller.sal.networkconfig.bridgedomain;
9
10 import java.util.List;
11 import java.util.Map;
12
13 import org.opendaylight.controller.sal.core.Node;
14 import org.opendaylight.controller.sal.core.NodeConnector;
15 import org.opendaylight.controller.sal.utils.Status;
16
17 /**
18  * This interface defines bridge domain configuration service methods to be
19  * implemented by protocol plugins
20  */
21 public interface IPluginInBridgeDomainConfigService {
22     /**
23      * Create a Bridge Domain
24      *
25      * @param node Node serving this configuration service
26      * @param bridgeIdentifier String representation of a Bridge Domain
27      * @param params Map representation of config name (ConfigConstants) and Parameter value (represented as Object).
28      * @return Status.StatusCode.SUCCESS if bridge domain is created successfully. Failure Status otherwise.
29      * @note This method will return false if one or more of the supplied params is not supported by the
30      * protocol plugin that serves the Node.
31      */
32     public Status createBridgeDomain(Node node, String bridgeIdentifier, Map<ConfigConstants, Object> params) throws Throwable;
33
34     /**
35      * Delete a Bridge Domain
36      *
37      * @param node Node serving this configuration service
38      * @param bridgeIdentifier String representation of a Bridge Domain
39      * @return Status.StatusCode.SUCCESS if bridge domain is deleted successfully. Failure Status otherwise.
40      */
41     public Status deleteBridgeDomain(Node node, String bridgeIdentifier);
42
43     /**
44      * Returns the configured Bridge Domains
45      *
46      * @param node Node serving this configuration service
47      * @return List of Bridge Domain Identifiers
48      */
49     public List<String> getBridgeDomains(Node node);
50
51     /**
52      * add Bridge Domain Configuration
53      *
54      * @param node Node serving this configuration service
55      * @param bridgeIdentifier String representation of a Bridge Domain
56      * @param params Map representation of config Name (ConfigConstants) and config value(represented as Object).
57      * @return Status.StatusCode.SUCCESS if bridge domain configuration is added successfully. Failure Status otherwise.
58      * @note This method will return false if one or more of the supplied params is not supported by the
59      * protocol plugin that serves the Node.
60      */
61     public Status addBridgeDomainConfig(Node node, String bridgeIdentifier, Map<ConfigConstants, Object> params);
62
63     /**
64      * Delete Bridge Domain Configuration
65      *
66      * @param node Node serving this configuration service
67      * @param bridgeIdentifier String representation of a Bridge Domain
68      * @param params Map representation of config name (ConfigConstants) and Parameter value (represented as Object).
69      * @return Status.StatusCode.SUCCESS if bridge domain configuration is deleted successfully. Failure Status otherwise.
70      * @note This method will return false if one or more of the supplied params is not supported by the
71      * protocol plugin that serves the Node.
72      */
73     public Status removeBridgeDomainConfig(Node node, String bridgeIdentifier, Map<ConfigConstants, Object> params);
74
75     /**
76      * Returns Bridge Domain Configurations
77      *
78      * @param node Node serving this configuration service
79      * @param bridgeIdentifier String representation of a Bridge Domain
80      * @return Map representation of config Name (ConfigConstants) and config value(represented as Object).
81      */
82
83     public Map<ConfigConstants, Object> getBridgeDomainConfigs(Node node, String bridgeIdentifier);
84
85     /**
86      * Returns a Node dedicated to a Bridge Domain (if available) that is created using createBridgeDomain.
87      * @param configNode Node serving this configuration service.
88      * @param bridgeIdentifier Name of the bridge domain that would map to a dedicated Node
89      * @return Node dedicated to a bridge domain that is created using createBridgeDomain.
90      *         returns null if there is no such dedicated node is available or represented.
91      */
92     public Node getBridgeDomainNode(Node configNode, String bridgeIdentifier);
93
94     /**
95      * Add a port to a bridge domain
96      *
97      * @param node Node serving this configuration service
98      * @param bridgeIdentifier String representation of a Bridge Domain
99      * @param portIdentifier String representation of a Port.
100      * @param params Map representation of config name (ConfigConstants) and Parameter value (represented as Object).
101      * @return Status.StatusCode.SUCCESS if a port is added successfully. Failure Status otherwise.
102      * @note This method will return false if one or more of the supplied params is not supported by the
103      * protocol plugin that serves the Node.
104      */
105     public Status addPort(Node node, String bridgeIdentifier, String portIdentifier,
106                            Map<ConfigConstants, Object> params);
107
108     /**
109      * Delete a Port from a bridge domain
110      *
111      * @param node Node serving this configuration service
112      * @param bridgeIdentifier String representation of a Bridge Domain
113      * @param portIdentifier String representation of a Port.
114      * @return Status.StatusCode.SUCCESS if a port is added successfully. Failure Status otherwise.
115      */
116     public Status deletePort(Node node, String bridgeIdentifier, String portIdentifier);
117
118     /**
119      * add Port Configuration
120      *
121      * @param node Node serving this configuration service
122      * @param bridgeIdentifier String representation of a Bridge Domain
123      * @param portIdentifier String representation of a Port.
124      * @param params Map representation of config name (ConfigConstants) and Parameter value (represented as Object).
125      * @return Status.StatusCode.SUCCESS if a port configuration is added successfully. Failure Status otherwise.
126      * @note This method will return false if one or more of the supplied params is not supported by the
127      * protocol plugin that serves the Node.
128      */
129     public Status addPortConfig(Node node, String bridgeIdentifier, String portIdentifier,
130                                  Map<ConfigConstants, Object> params);
131
132     /**
133      * Delete Port Configuration
134      *
135      * @param node Node serving this configuration service
136      * @param portIdentifier String representation of a Port.
137      * @param config Map representation of ConfigName and Configuration Value in Strings.
138      * @return Status.StatusCode.SUCCESS if a port configuration is removed successfully. Failure Status otherwise.
139      * @note This method will return false if one or more of the supplied params is not supported by the
140      * protocol plugin that serves the Node.
141      */
142     public Status removePortConfig(Node node, String bridgeIdentifier, String portIdentifier, Map<ConfigConstants, Object> params);
143
144     /**
145      * Returns Port Configurations
146      *
147      * @param node Node serving this configuration service
148      * @param bridgeIdentifier String representation of a Bridge Domain
149      * @param portIdentifier String representation of a Port.
150      * @return Map representation of Configuration Name (ConfigConstants) and Configuration value (represented as Object).
151      */
152     public Map<ConfigConstants, Object> getPortConfigs(Node node, String bridgeIdentifier, String portIdentifier);
153
154
155     /**
156      * Returns a NodeConnector mapped to a Port (if available) that is created using addPort.
157      * @param configNode Node serving this configuration service.
158      * @param bridgeIdentifier Name of the bridge domain that would map to a dedicated Node
159      * @param portIdentifier String representation of a Port.
160      * @return NodeConnector that is mapped to a port created using addPort.
161      *         returns null if there is no such nodeConnector is available or mapped.
162      */
163     public NodeConnector getNodeConnector(Node configNode, String bridgeIdentifier, String portIdentifier);
164 }