Skip to content
Snippets Groups Projects
Commit ce06ff16 authored by Ananth Suryanarayana's avatar Ananth Suryanarayana
Browse files

temp changes

parent e359f077
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,12 @@ import net.floodlightcontroller.restserver.IRestApiService; ...@@ -14,6 +14,12 @@ import net.floodlightcontroller.restserver.IRestApiService;
* @author alexreimers * @author alexreimers
*/ */
public class Main { public class Main {
private static IFloodlightModuleContext moduleContext;
public static IFloodlightModuleContext floodlightContextGet () {
return moduleContext;
}
/** /**
* Main method to load configuration and modules * Main method to load configuration and modules
...@@ -36,7 +42,7 @@ public class Main { ...@@ -36,7 +42,7 @@ public class Main {
// Load modules // Load modules
FloodlightModuleLoader fml = new FloodlightModuleLoader(); FloodlightModuleLoader fml = new FloodlightModuleLoader();
IFloodlightModuleContext moduleContext = fml.loadModulesFromConfig(settings.getModuleFile()); moduleContext = fml.loadModulesFromConfig(settings.getModuleFile());
// Run REST server // Run REST server
IRestApiService restApi = moduleContext.getServiceImpl(IRestApiService.class); IRestApiService restApi = moduleContext.getServiceImpl(IRestApiService.class);
restApi.run(); restApi.run();
......
...@@ -1581,11 +1581,11 @@ IFloodlightModule, IInfoProvider, IHAListener { ...@@ -1581,11 +1581,11 @@ IFloodlightModule, IInfoProvider, IHAListener {
// null role implies HA mode is not enabled. // null role implies HA mode is not enabled.
Role role = floodlightProvider.getRole(); Role role = floodlightProvider.getRole();
if (role == null || role == Role.MASTER) { if (role == null || role == Role.MASTER) {
log.trace("Rescheduling discovery task as role = {}", role); // log.trace("Rescheduling discovery task as role = {}", role);
discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL, discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL,
TimeUnit.SECONDS); TimeUnit.SECONDS);
} else { } else {
log.trace("Stopped LLDP rescheduling due to role = {}.", role); // log.trace("Stopped LLDP rescheduling due to role = {}.", role);
} }
} }
} }
...@@ -1608,10 +1608,10 @@ IFloodlightModule, IInfoProvider, IHAListener { ...@@ -1608,10 +1608,10 @@ IFloodlightModule, IInfoProvider, IHAListener {
// null role implies HA mode is not enabled. // null role implies HA mode is not enabled.
Role role = floodlightProvider.getRole(); Role role = floodlightProvider.getRole();
if (role == null || role == Role.MASTER) { if (role == null || role == Role.MASTER) {
log.trace("Setup: Rescheduling discovery task. role = {}", role); // log.trace("Setup: Rescheduling discovery task. role = {}", role);
discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL, TimeUnit.SECONDS); discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL, TimeUnit.SECONDS);
} else { } else {
log.trace("Setup: Not scheduling LLDP as role = {}.", role); // log.trace("Setup: Not scheduling LLDP as role = {}.", role);
} }
// Register for the OpenFlow messages we want to receive // Register for the OpenFlow messages we want to receive
floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this); floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
......
...@@ -39,6 +39,7 @@ import net.floodlightcontroller.counter.CounterStore; ...@@ -39,6 +39,7 @@ import net.floodlightcontroller.counter.CounterStore;
import net.floodlightcontroller.counter.ICounterStoreService; import net.floodlightcontroller.counter.ICounterStoreService;
import net.floodlightcontroller.counter.CounterValue.CounterType; import net.floodlightcontroller.counter.CounterValue.CounterType;
import net.floodlightcontroller.restserver.IRestApiService; import net.floodlightcontroller.restserver.IRestApiService;
import net.floodlightcontroller.storage.memory.MemoryStorageSource;
import net.floodlightcontroller.storage.web.StorageWebRoutable; import net.floodlightcontroller.storage.web.StorageWebRoutable;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -485,7 +486,8 @@ public abstract class AbstractStorageSource ...@@ -485,7 +486,8 @@ public abstract class AbstractStorageSource
IFloodlightService> m = IFloodlightService> m =
new HashMap<Class<? extends IFloodlightService>, new HashMap<Class<? extends IFloodlightService>,
IFloodlightService>(); IFloodlightService>();
m.put(IStorageSourceService.class, this); // m.put(IStorageSourceService.class, this);
m.put(IStorageSourceService.class, new MemoryStorageSource());
return m; return m;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment