Added Security Rule for Custom ICMP
[ovsdb.git] / plugin / src / main / java / org / opendaylight / ovsdb / plugin / internal / Activator.java
1 /*
2  * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.internal;
10
11 import org.apache.felix.dm.DependencyActivatorBase;
12 import org.apache.felix.dm.DependencyManager;
13 import org.opendaylight.ovsdb.lib.OvsdbConnection;
14 import org.opendaylight.ovsdb.lib.OvsdbConnectionListener;
15 import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
16 import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
17 import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
18 import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
19 import org.opendaylight.ovsdb.plugin.impl.ConfigurationServiceImpl;
20 import org.opendaylight.ovsdb.plugin.impl.ConnectionServiceImpl;
21 import org.opendaylight.ovsdb.plugin.impl.InventoryServiceImpl;
22
23 import org.osgi.framework.BundleContext;
24
25 /**
26  * OVSDB protocol plugin Activator
27  *
28  *
29  */
30 public class Activator extends DependencyActivatorBase {
31
32     @Override
33     public void init(BundleContext context, DependencyManager manager) throws Exception {
34         manager.add(createComponent()
35                         .setInterface(OvsdbConfigurationService.class.getName(), null)
36                         .setImplementation(ConfigurationServiceImpl.class)
37                         .add(createServiceDependency()
38                                         .setService(OvsdbConnectionService.class)
39                                         .setRequired(true))
40                         .add(createServiceDependency()
41                                 .setService(OvsdbInventoryService.class)
42                                 .setRequired(true)));
43
44         manager.add(createComponent()
45                         .setInterface(
46                                 new String[] {OvsdbConnectionService.class.getName(),
47                                         OvsdbConnectionListener.class.getName()}, null)
48                         .setImplementation(ConnectionServiceImpl.class)
49                         .add(createServiceDependency()
50                                 .setService(OvsdbInventoryService.class)
51                                 .setRequired(true))
52                         .add(createServiceDependency()
53                                 .setService(OvsdbConnection.class)
54                                 .setRequired(true))
55         );
56
57         manager.add(createComponent()
58                         .setInterface(OvsdbInventoryService.class.getName(), null)
59                         .setImplementation(InventoryServiceImpl.class)
60                         .add(createServiceDependency()
61                                 .setService(OvsdbInventoryListener.class)
62                                 .setCallbacks("listenerAdded", "listenerRemoved"))
63                         .add(createServiceDependency()
64                                 .setService(OvsdbConfigurationService.class)
65                                 .setRequired(false)));
66     }
67
68     @Override
69     public void destroy(BundleContext context, DependencyManager manager) throws Exception {
70     }
71 }