import org.opendaylight.controller.northbound.commons.exception.ResourceNotFoundException;
import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
import org.opendaylight.controller.sal.core.Node;
+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.utils.ServiceHelper;
if (status.getCode().equals(StatusCode.SUCCESS)) {
return Response.status(Response.Status.CREATED).build();
}
- } catch (Error e) {
- throw e;
- } catch (Throwable t) {
+ } catch (BridgeDomainConfigServiceException e) {
return Response.status(Response.Status.PRECONDITION_FAILED).build();
}
throw new ResourceNotFoundException(status.getDescription());
--- /dev/null
+/*
+ * 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;
+
+/**
+ * Exception thrown by IPluginInBridgeDomainConfigService implementations.
+ */
+public class BridgeDomainConfigServiceException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ public BridgeDomainConfigServiceException(String message) {
+ super(message);
+ }
+
+ public BridgeDomainConfigServiceException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
+
* @note This method will return false if one or more of the supplied params is not supported by the
* protocol plugin that serves the Node.
*/
- public Status createBridgeDomain(Node node, String bridgeIdentifier, Map<ConfigConstants, Object> params) throws Throwable;
+ public Status createBridgeDomain(Node node, String bridgeIdentifier, Map<ConfigConstants, Object> params) throws BridgeDomainConfigServiceException;
/**
* Delete a Bridge Domain
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;
public class BridgeDomainConfigService implements IBridgeDomainConfigService {
protected static final Logger logger = LoggerFactory
.getLogger(BridgeDomainConfigService.class);
- private ConcurrentMap<String, IPluginInBridgeDomainConfigService> pluginService =
+ private final ConcurrentMap<String, IPluginInBridgeDomainConfigService> pluginService =
new ConcurrentHashMap<String, IPluginInBridgeDomainConfigService>();
void setPluginInService (Map props, IPluginInBridgeDomainConfigService s) {
@Override
public Status createBridgeDomain(Node node, String bridgeIdentifier, Map<ConfigConstants, Object> params)
- throws Throwable {
+ throws BridgeDomainConfigServiceException {
if (pluginService != null) {
IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType());
if (plugin != null) {