17a509b59d0828b6ecdfc5bb5f7aa7513a6c38af
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / yang / gen / v1 / urn / opendaylight / params / xml / ns / yang / config / openflow / plugin / impl / rev150327 / OpenFlowProviderModule.java
1 package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.plugin.impl.rev150327;
2
3 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
4 import org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl;
5 import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
6 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory;
8
9 public class OpenFlowProviderModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.plugin.impl.rev150327.AbstractOpenFlowProviderModule {
10
11     private static final Logger LOG = LoggerFactory.getLogger(OpenFlowProviderModule.class);
12
13     public OpenFlowProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
14         super(identifier, dependencyResolver);
15     }
16
17     public OpenFlowProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.plugin.impl.rev150327.OpenFlowProviderModule oldModule, java.lang.AutoCloseable oldInstance) {
18         super(identifier, dependencyResolver, oldModule, oldInstance);
19     }
20
21     @Override
22     public void customValidation() {
23         // add custom validation form module attributes here.
24     }
25
26     @Override
27     public java.lang.AutoCloseable createInstance() {
28         LOG.info("Initializing new OFP southbound.");
29         OpenflowPortsUtil.init();
30         OpenFlowPluginProvider openflowPluginProvider = new OpenFlowPluginProviderImpl(getRpcRequestsQuota(), getGlobalNotificationQuota());
31
32         openflowPluginProvider.setSwitchConnectionProviders(getOpenflowSwitchConnectionProviderDependency());
33         openflowPluginProvider.setRole(getRole());
34         openflowPluginProvider.setDataBroker(getDataBrokerDependency());
35         openflowPluginProvider.setRpcProviderRegistry(getRpcRegistryDependency());
36         openflowPluginProvider.setNotificationProviderService(getNotificationAdapterDependency());
37         openflowPluginProvider.setNotificationPublishService(getNotificationPublishAdapterDependency());
38         openflowPluginProvider.setSwitchFeaturesMandatory(getSwitchFeaturesMandatory());
39         openflowPluginProvider.initialize();
40
41         return openflowPluginProvider;
42     }
43
44 }