X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fadsal%2Fsal%2Fnetworkconfiguration%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fnetworkconfig%2Fbridgedomain%2Finternal%2FBridgeDomainConfigService.java;fp=opendaylight%2Fadsal%2Fsal%2Fnetworkconfiguration%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fnetworkconfig%2Fbridgedomain%2Finternal%2FBridgeDomainConfigService.java;h=0000000000000000000000000000000000000000;hb=50f88249a65c52ba56a48852b71ce432fed2bbeb;hp=14c5e0d9e72ada56a7d8d4c2f55e477e2a5f95f1;hpb=abfa9a03550cbe9fccc4420684dced175dd6d119;p=controller.git diff --git a/opendaylight/adsal/sal/networkconfiguration/implementation/src/main/java/org/opendaylight/controller/sal/networkconfig/bridgedomain/internal/BridgeDomainConfigService.java b/opendaylight/adsal/sal/networkconfiguration/implementation/src/main/java/org/opendaylight/controller/sal/networkconfig/bridgedomain/internal/BridgeDomainConfigService.java deleted file mode 100644 index 14c5e0d9e7..0000000000 --- a/opendaylight/adsal/sal/networkconfiguration/implementation/src/main/java/org/opendaylight/controller/sal/networkconfig/bridgedomain/internal/BridgeDomainConfigService.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.sal.networkconfig.bridgedomain.internal; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -import org.opendaylight.controller.sal.core.Node; -import org.opendaylight.controller.sal.core.NodeConnector; -import org.opendaylight.controller.sal.networkconfig.bridgedomain.BridgeDomainConfigServiceException; -import org.opendaylight.controller.sal.networkconfig.bridgedomain.ConfigConstants; -import org.opendaylight.controller.sal.networkconfig.bridgedomain.IBridgeDomainConfigService; -import org.opendaylight.controller.sal.networkconfig.bridgedomain.IPluginInBridgeDomainConfigService; -import org.opendaylight.controller.sal.utils.GlobalConstants; -import org.opendaylight.controller.sal.utils.Status; -import org.opendaylight.controller.sal.utils.StatusCode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class BridgeDomainConfigService implements IBridgeDomainConfigService { - protected static final Logger logger = LoggerFactory - .getLogger(BridgeDomainConfigService.class); - private final ConcurrentMap pluginService = - new ConcurrentHashMap(); - - void setPluginInService (Map props, IPluginInBridgeDomainConfigService s) { - String type = null; - Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString()); - if (value instanceof String) { - type = (String) value; - } - if (type == null) { - logger.error("Received a PluginInConnectionService without any " - + "protocolPluginType provided"); - } else { - this.pluginService.put(type, s); - } - } - - void unsetPluginInService(Map props, IPluginInBridgeDomainConfigService s) { - String type = null; - - Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString()); - if (value instanceof String) { - type = (String) value; - } - if (type == null) { - logger.error("Received a PluginInConnectionService without any " - + "protocolPluginType provided"); - } else if (this.pluginService.get(type).equals(s)) { - this.pluginService.remove(type); - } - } - - /** - * Function called by the dependency manager when all the required - * dependencies are satisfied - * - */ - void init() { - } - - /** - * Function called by the dependency manager when at least one dependency - * become unsatisfied or when the component is shutting down because for - * example bundle is being stopped. - * - */ - void destroy() { - if (this.pluginService != null) { - this.pluginService.clear(); - } - } - - @Override - public Status createBridgeDomain(Node node, String bridgeIdentifier, Map params) - throws BridgeDomainConfigServiceException { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.createBridgeDomain(node, bridgeIdentifier, params); - } - } - return new Status(StatusCode.NOSERVICE, "Requested Plugin Service Not available"); - } - - @Override - public Status deleteBridgeDomain(Node node, String bridgeIdentifier) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.deleteBridgeDomain(node, bridgeIdentifier); - } - } - return new Status(StatusCode.NOSERVICE, "Requested Plugin Service Not available"); - } - - @Override - public List getBridgeDomains(Node node) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.getBridgeDomains(node); - } - } - return null; - } - - @Override - public Status addBridgeDomainConfig(Node node, String bridgeIdentifier, Map params) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.addBridgeDomainConfig(node, bridgeIdentifier, params); - } - } - return new Status(StatusCode.NOSERVICE, "Requested Plugin Service Not available"); - } - - @Override - public Status removeBridgeDomainConfig(Node node, String bridgeIdentifier, Map params) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.removeBridgeDomainConfig(node, bridgeIdentifier, params); - } - } - return new Status(StatusCode.NOSERVICE, "Requested Plugin Service Not available"); - } - - @Override - public Map getBridgeDomainConfigs(Node node, String bridgeIdentifier) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.getBridgeDomainConfigs(node, bridgeIdentifier); - } - } - return null; - } - - @Override - public Node getBridgeDomainNode(Node configNode, String bridgeIdentifier) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(configNode.getType()); - if (plugin != null) { - return plugin.getBridgeDomainNode(configNode, bridgeIdentifier); - } - } - return null; - } - - @Override - public Status addPort(Node node, String bridgeIdentifier, String portIdentifier, Map params) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.addPort(node, bridgeIdentifier, portIdentifier, params); - } - } - return new Status(StatusCode.NOSERVICE, "Requested Plugin Service Not available"); - } - - @Override - public Status deletePort(Node node, String bridgeIdentifier, String portIdentifier) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.deletePort(node, bridgeIdentifier, portIdentifier); - } - } - return new Status(StatusCode.NOSERVICE, "Requested Plugin Service Not available"); - } - - @Override - public Status addPortConfig(Node node, String bridgeIdentifier, String portIdentifier, - Map params) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.addPortConfig(node, bridgeIdentifier, portIdentifier, params); - } - } - return new Status(StatusCode.NOSERVICE, "Requested Plugin Service Not available"); - } - - @Override - public Status removePortConfig(Node node, String bridgeIdentifier, String portIdentifier, - Map params) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.removePortConfig(node, bridgeIdentifier, portIdentifier, params); - } - } - return new Status(StatusCode.NOSERVICE, "Requested Plugin Service Not available"); - } - - @Override - public Map getPortConfigs(Node node, String bridgeIdentifier, String portIdentifier) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType()); - if (plugin != null) { - return plugin.getPortConfigs(node, bridgeIdentifier, portIdentifier); - } - } - return null; - } - - @Override - public NodeConnector getNodeConnector(Node configNode, String bridgeIdentifier, String portIdentifier) { - if (pluginService != null) { - IPluginInBridgeDomainConfigService plugin = this.pluginService.get(configNode.getType()); - if (plugin != null) { - return plugin.getNodeConnector(configNode, bridgeIdentifier, portIdentifier); - } - } - return null; - } -}