blob: 490f30f83ef027d67714e557f3f70f4010591ffe [file] [log] [blame]
Jonathan Hart4b5bbb52014-02-06 10:09:31 -08001package net.onrc.onos.ofcontroller.networkgraph;
2
3import java.util.ArrayList;
4import java.util.Collection;
5import java.util.HashMap;
6import java.util.List;
7import java.util.Map;
8
9import net.floodlightcontroller.core.module.FloodlightModuleContext;
10import net.floodlightcontroller.core.module.FloodlightModuleException;
11import net.floodlightcontroller.core.module.IFloodlightModule;
12import net.floodlightcontroller.core.module.IFloodlightService;
13
14public class NetworkGraphModule implements IFloodlightModule, INetworkGraphService {
15
16 // This is initialized as a module for now
17 // private RCNetworkGraphPublisher eventListener;
18
19 private NetworkGraphImpl networkGraph;
20 private SouthboundNetworkGraph southboundNetworkGraph;
21
22
23 @Override
24 public Collection<Class<? extends IFloodlightService>> getModuleServices() {
25 List<Class<? extends IFloodlightService>> services =
26 new ArrayList<Class<? extends IFloodlightService>>();
27 services.add(INetworkGraphService.class);
28 return services;
29 }
30
31 @Override
32 public Map<Class<? extends IFloodlightService>, IFloodlightService>
33 getServiceImpls() {
34 Map<Class<? extends IFloodlightService>, IFloodlightService> impls =
35 new HashMap<Class<? extends IFloodlightService>, IFloodlightService>();
36 impls.put(INetworkGraphService.class, this);
37 return impls;
38 }
39
40 @Override
41 public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
42 return null;
43 }
44
45 @Override
46 public void init(FloodlightModuleContext context)
47 throws FloodlightModuleException {
48 networkGraph = new NetworkGraphImpl();
49 southboundNetworkGraph = new SouthboundNetworkGraph(networkGraph);
50 }
51
52 @Override
53 public void startUp(FloodlightModuleContext context) {
54 // TODO Auto-generated method stub
55
56 }
57
58 @Override
59 public NetworkGraph getNetworkGraph() {
60 return networkGraph;
61 }
62
63 @Override
64 public SouthboundNetworkGraph getSouthboundNetworkGraph() {
65 return southboundNetworkGraph;
66 }
67
68}