use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.
the class SwitchTrackingService method setup.
@Override
public void setup(FloodlightModuleContext context) {
producerService = context.getServiceImpl(IKafkaProducerService.class);
switchManager = context.getServiceImpl(ISwitchManager.class);
featureDetector = context.getServiceImpl(FeatureDetectorService.class);
KafkaChannel kafkaChannel = context.getServiceImpl(KafkaUtilityService.class).getKafkaChannel();
discoveryTopic = kafkaChannel.getTopoDiscoTopic();
region = kafkaChannel.getRegion();
context.getServiceImpl(IOFSwitchService.class).addOFSwitchListener(this);
}
use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.
the class ZooKeeperService method setup.
@Override
public void setup(FloodlightModuleContext moduleContext) throws FloodlightModuleException {
KafkaChannel kafkaChannel = moduleContext.getServiceImpl(KafkaUtilityService.class).getKafkaChannel();
region = kafkaChannel.getRegion();
KildaCore kildaCore = moduleContext.getServiceImpl(KildaCore.class);
String connectionString = kafkaChannel.getConfig().getZooKeeperConnectString();
long reconnectDelayMs = kafkaChannel.getConfig().getZooKeeperReconnectDelayMs();
zkWriter = ZkWriter.builder().id(region).serviceName(ZK_COMPONENT_NAME).connectionString(connectionString).reconnectDelayMs(reconnectDelayMs).expectedState(getExpectedState(kildaCore.getConfig().getRole())).build();
zooKeeperStateTracker = new ZkStateTracker(zkWriter);
watchDog = ZkWatchDog.builder().id(region).serviceName(ZK_COMPONENT_NAME).reconnectDelayMs(reconnectDelayMs).connectionString(connectionString).build();
watchDog.subscribe(this);
initZookeeper();
}
use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.
the class ConnectedDevicesService method setup.
@Override
public void setup(FloodlightModuleContext context) {
logger.info("Stating {}", ConnectedDevicesService.class.getCanonicalName());
KafkaChannel kafkaChannel = context.getServiceImpl(KafkaUtilityService.class).getKafkaChannel();
logger.info("region: {}", kafkaChannel.getRegion());
region = kafkaChannel.getRegion();
producerService = context.getServiceImpl(IKafkaProducerService.class);
topic = kafkaChannel.getConnectedDevicesTopic();
InputService inputService = context.getServiceImpl(InputService.class);
inputService.addTranslator(OFType.PACKET_IN, this);
}
use of org.openkilda.floodlight.KafkaChannel in project open-kilda by telstra.
the class NetworkDiscoveryEmitterTest method setUp.
@Before
public void setUp() throws Exception {
injectMocks(this);
moduleContext.addService(IKafkaProducerService.class, kafkaProducerService);
moduleContext.addService(IPathVerificationService.class, pathVerificationService);
KafkaChannel kafkaChannel = mock(KafkaChannel.class);
expect(kafkaChannel.getTopoDiscoTopic()).andStubReturn(CONFIRMATION_TOPIC);
expect(kafkaChannel.getRegion()).andStubReturn(REGION);
KafkaUtilityService kafkaUtility = mock(KafkaUtilityService.class);
expect(kafkaUtility.getKafkaChannel()).andStubReturn(kafkaChannel);
moduleContext.addService(KafkaUtilityService.class, kafkaUtility);
}
Aggregations