@Before public void setUp() throws FloodlightModuleException { final SwitchManager switchManager = new SwitchManager(); final PathVerificationService pathVerificationService = new PathVerificationService(); ofSwitchService = createMock(IOFSwitchService.class); producer = createMock(KafkaMessageProducer.class); context.addService(IOFSwitchService.class, ofSwitchService); context.addService(IRestApiService.class, null); context.addService(SwitchEventCollector.class, null); context.addService(KafkaMessageProducer.class, producer); context.addService(IPathVerificationService.class, pathVerificationService); context.addService(ISwitchManager.class, switchManager); switchManager.init(context); collector = new KafkaMessageCollector(); context.addConfigParam(collector, "topic", ""); context.addConfigParam(collector, "bootstrap-servers", ""); collector.init(context); initScheme(); }
@Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class); deviceService = context.getServiceImpl(IDeviceService.class); routingService = context.getServiceImpl(IRoutingService.class); switchService = context.getServiceImpl(IOFSwitchService.class); linkService = context.getServiceImpl(ILinkDiscoveryService.class); messageDamper = new OFMessageDamper(OFMESSAGE_DAMPER_CAPACITY, EnumSet.of(OFType.FLOW_MOD), OFMESSAGE_DAMPER_TIMEOUT); library = new FP_LibFloodlight( LoggerFactory.getLogger( getClass() )); }
@Override public Collection<Class<? extends IFloodlightService>> getModuleDependencies() { Collection<Class<? extends IFloodlightService>> l = new ArrayList<Class<? extends IFloodlightService>>(); l.add(IFloodlightProviderService.class); l.add(IRestApiService.class); l.add(IOFSwitchService.class); l.add(IDeviceService.class); l.add(IDebugCounterService.class); l.add(ITopologyService.class); l.add(IRoutingService.class); l.add(IStaticFlowEntryPusherService.class); return l; }
@Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { floodlightProviderService = context.getServiceImpl(IFloodlightProviderService.class); restApiService = context.getServiceImpl(IRestApiService.class); debugCounterService = context.getServiceImpl(IDebugCounterService.class); deviceManagerService = context.getServiceImpl(IDeviceService.class); routingEngineService = context.getServiceImpl(IRoutingService.class); topologyService = context.getServiceImpl(ITopologyService.class); sfpService = context.getServiceImpl(IStaticFlowEntryPusherService.class); switchService = context.getServiceImpl(IOFSwitchService.class); vips = new HashMap<String, LBVip>(); pools = new HashMap<String, LBPool>(); members = new HashMap<String, LBMember>(); vipIpToId = new HashMap<Integer, String>(); vipIpToMac = new HashMap<Integer, MacAddress>(); memberIpToId = new HashMap<Integer, String>(); }
@Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { linkDiscoveryService = context.getServiceImpl(ILinkDiscoveryService.class); threadPoolService = context.getServiceImpl(IThreadPoolService.class); floodlightProviderService = context.getServiceImpl(IFloodlightProviderService.class); switchService = context.getServiceImpl(IOFSwitchService.class); restApiService = context.getServiceImpl(IRestApiService.class); debugCounterService = context.getServiceImpl(IDebugCounterService.class); debugEventService = context.getServiceImpl(IDebugEventService.class); switchPorts = new HashMap<DatapathId, Set<OFPort>>(); switchPortLinks = new HashMap<NodePortTuple, Set<Link>>(); directLinks = new HashMap<NodePortTuple, Set<Link>>(); portBroadcastDomainLinks = new HashMap<NodePortTuple, Set<Link>>(); tunnelPorts = new HashSet<NodePortTuple>(); topologyAware = new ArrayList<ITopologyListener>(); ldUpdates = new LinkedBlockingQueue<LDUpdate>(); haListener = new HAListenerDelegate(); registerTopologyDebugCounters(); registerTopologyDebugEvents(); }
protected OFFeaturesReply getSwitchFeaturesReply(DatapathId switchId) { IOFSwitchService switchService = (IOFSwitchService) getContext().getAttributes(). get(IOFSwitchService.class.getCanonicalName()); IOFSwitch sw = switchService.getSwitch(switchId); Future<OFFeaturesReply> future; OFFeaturesReply featuresReply = null; OFFeaturesRequest featuresRequest = sw.getOFFactory().buildFeaturesRequest().build(); if (sw != null) { try { future = sw.writeRequest(featuresRequest); featuresReply = future.get(10, TimeUnit.SECONDS); } catch (Exception e) { log.error("Failure getting features reply from switch" + sw, e); } } return featuresReply; }
@Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { controller.setStorageSourceService( context.getServiceImpl(IStorageSourceService.class)); controller.setPktInProcessingService( context.getServiceImpl(IPktInProcessingTimeService.class)); controller.setDebugCounter( context.getServiceImpl(IDebugCounterService.class)); controller.setDebugEvent( context.getServiceImpl(IDebugEventService.class)); controller.setRestApiService( context.getServiceImpl(IRestApiService.class)); controller.setThreadPoolService( context.getServiceImpl(IThreadPoolService.class)); controller.setSyncService( context.getServiceImpl(ISyncService.class)); controller.setSwitchService( context.getServiceImpl(IOFSwitchService.class)); controller.init(context.getConfigParams(this)); }
@Before public void SetUp() throws Exception { fmc = new FloodlightModuleContext(); linkDiscovery = EasyMock.createMock(ILinkDiscoveryService.class); mockFloodlightProvider = new MockFloodlightProvider(); fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider); fmc.addService(IOFSwitchService.class, new MockSwitchManager()); fmc.addService(ILinkDiscoveryService.class, linkDiscovery); fmc.addService(IDebugCounterService.class, new MockDebugCounterService()); fmc.addService(IDebugEventService.class, new MockDebugEventService()); MockThreadPoolService tp = new MockThreadPoolService(); topologyManager = new TopologyManager(); fmc.addService(IThreadPoolService.class, tp); topologyManager.init(fmc); tp.init(fmc); tp.startUp(fmc); }
@Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class); logger = LoggerFactory.getLogger(MulticastController.class); lds = context.getServiceImpl(ILinkDiscoveryService.class); routingService = context.getServiceImpl(IRoutingService.class); flowPusher = context.getServiceImpl(IStaticFlowEntryPusherService.class); switchService = context.getServiceImpl(IOFSwitchService.class); statisticsService = context.getServiceImpl(IStatisticsService.class); groupDB = new MulticastGroupStore(this); Map<String, String> configOptions = context.getConfigParams(this); String topologyFile = configOptions.get("topologyFile"); String ipBandwidthQoSFile = configOptions.get("ipBandwidthQoSFile"); if (topologyFile != null) { topologyHelper = new TopologyHelper(topologyFile); } else { logger.error("topologyFile not provided"); } logger.info(" QOS file : " + ipBandwidthQoSFile); flowQoSDemandHelper = new FlowQoSDemandHelper(ipBandwidthQoSFile); if (statisticsService.getBandwidthConsumption() == null) statisticsService.collectStatistics(false); }
/** * {@inheritDoc} */ @Override public Collection<Class<? extends IFloodlightService>> getModuleDependencies() { Collection<Class<? extends IFloodlightService>> services = new ArrayList<>(3); services.add(IFloodlightProviderService.class); services.add(IOFSwitchService.class); services.add(IRestApiService.class); return services; }
/** * {@inheritDoc} */ @Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class); ofSwitchService = context.getServiceImpl(IOFSwitchService.class); restApiService = context.getServiceImpl(IRestApiService.class); kafkaProducer = context.getServiceImpl(KafkaMessageProducer.class); // TODO: Ensure Kafka Topics are created.. }
/** * {@inheritDoc} */ @Override public Collection<Class<? extends IFloodlightService>> getModuleDependencies() { Collection<Class<? extends IFloodlightService>> services = new ArrayList<>(3); services.add(IOFSwitchService.class); services.add(KafkaMessageProducer.class); services.add(ISwitchManager.class); return services; }