2 * Copyright (c) 2015 IBM Corporation and others. All rights reserved.
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
9 package org.opendaylight.neutron.transcriber;
11 import java.util.ArrayList;
12 import java.util.List;
14 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
15 import org.osgi.framework.BundleActivator;
16 import org.osgi.framework.BundleContext;
17 import org.osgi.framework.ServiceRegistration;
19 public class Activator implements BundleActivator {
20 private List<ServiceRegistration<?>> registrations = new ArrayList<ServiceRegistration<?>>();
21 private ProviderContext providerContext;
23 public Activator(ProviderContext providerContext) {
24 this.providerContext = providerContext;
28 public void start(BundleContext context) throws Exception {
29 NeutronRouterInterface.registerNewInterface(context, providerContext, registrations);
30 NeutronPortInterface.registerNewInterface(context, providerContext, registrations);
31 NeutronSubnetInterface.registerNewInterface(context, providerContext, registrations);
32 NeutronNetworkInterface.registerNewInterface(context, providerContext, registrations);
33 NeutronSecurityGroupInterface.registerNewInterface(context, providerContext, registrations);
34 NeutronSecurityRuleInterface.registerNewInterface(context, providerContext, registrations);
35 NeutronFirewallInterface.registerNewInterface(context, providerContext, registrations);
36 NeutronFirewallPolicyInterface.registerNewInterface(context, providerContext, registrations);
37 NeutronFirewallRuleInterface.registerNewInterface(context, providerContext, registrations);
38 NeutronLoadBalancerInterface.registerNewInterface(context, providerContext, registrations);
39 NeutronLoadBalancerPoolInterface.registerNewInterface(context, providerContext, registrations);
40 NeutronLoadBalancerListenerInterface.registerNewInterface(context, providerContext, registrations);
41 NeutronLoadBalancerHealthMonitorInterface.registerNewInterface(context, providerContext, registrations);
42 NeutronMeteringLabelInterface.registerNewInterface(context, providerContext, registrations);
43 NeutronMeteringLabelRuleInterface.registerNewInterface(context, providerContext, registrations);
44 NeutronVPNServiceInterface.registerNewInterface(context, providerContext, registrations);
45 NeutronVPNIKEPolicyInterface.registerNewInterface(context, providerContext, registrations);
46 NeutronVPNIPSECPolicyInterface.registerNewInterface(context, providerContext, registrations);
47 NeutronVPNIPSECSiteConnectionsInterface.registerNewInterface(context, providerContext, registrations);
48 NeutronFloatingIPInterface.registerNewInterface(context, providerContext, registrations);
49 NeutronBgpvpnInterface.registerNewInterface(context, providerContext, registrations);
53 public void stop(BundleContext context) throws Exception {
54 for (ServiceRegistration registration : registrations) {
55 if (registration != null) {
56 registration.unregister();