Search in sources :

Example 6 with FeatureDetectorService

use of org.openkilda.floodlight.service.FeatureDetectorService in project open-kilda by telstra.

the class SwitchManager method init.

/**
 * {@inheritDoc}
 */
@Override
public void init(FloodlightModuleContext context) throws FloodlightModuleException {
    ofSwitchService = context.getServiceImpl(IOFSwitchService.class);
    producerService = context.getServiceImpl(IKafkaProducerService.class);
    switchTracking = context.getServiceImpl(SwitchTrackingService.class);
    featureDetectorService = context.getServiceImpl(FeatureDetectorService.class);
    FloodlightModuleConfigurationProvider provider = FloodlightModuleConfigurationProvider.of(context, this);
    config = provider.getConfiguration(SwitchManagerConfig.class);
    switchFlowFactory = context.getServiceImpl(SwitchFlowFactory.class);
    String connectModeProperty = config.getConnectMode();
    try {
        connectMode = ConnectModeRequest.Mode.valueOf(connectModeProperty);
    } catch (Exception e) {
        logger.error("CONFIG EXCEPTION: connect-mode could not be set to {}, defaulting to AUTO", connectModeProperty);
        connectMode = ConnectModeRequest.Mode.AUTO;
    }
}
Also used : FloodlightModuleConfigurationProvider(org.openkilda.floodlight.config.provider.FloodlightModuleConfigurationProvider) IOFSwitchService(net.floodlightcontroller.core.internal.IOFSwitchService) IKafkaProducerService(org.openkilda.floodlight.service.kafka.IKafkaProducerService) FeatureDetectorService(org.openkilda.floodlight.service.FeatureDetectorService) SwitchFlowFactory(org.openkilda.floodlight.switchmanager.factory.SwitchFlowFactory) InvalidMeterIdException(org.openkilda.floodlight.error.InvalidMeterIdException) ExecutionException(java.util.concurrent.ExecutionException) TimeoutException(java.util.concurrent.TimeoutException) SwitchOperationException(org.openkilda.floodlight.error.SwitchOperationException) UnsupportedSwitchOperationException(org.openkilda.floodlight.error.UnsupportedSwitchOperationException) SwitchNotFoundException(org.openkilda.floodlight.error.SwitchNotFoundException) FloodlightModuleException(net.floodlightcontroller.core.module.FloodlightModuleException) OfInstallException(org.openkilda.floodlight.error.OfInstallException)

Example 7 with FeatureDetectorService

use of org.openkilda.floodlight.service.FeatureDetectorService in project open-kilda by telstra.

the class FlowSegmentCommand method setup.

@Override
protected void setup(FloodlightModuleContext moduleContext) throws Exception {
    super.setup(moduleContext);
    FeatureDetectorService featureDetectorService = moduleContext.getServiceImpl(FeatureDetectorService.class);
    switchFeatures = featureDetectorService.detectSwitch(getSw());
    KildaCore kildaCore = moduleContext.getServiceImpl(KildaCore.class);
    kildaCoreConfig = kildaCore.getConfig();
}
Also used : FeatureDetectorService(org.openkilda.floodlight.service.FeatureDetectorService) KildaCore(org.openkilda.floodlight.KildaCore)

Example 8 with FeatureDetectorService

use of org.openkilda.floodlight.service.FeatureDetectorService in project open-kilda by telstra.

the class SwitchFlowFactory method setup.

@Override
public void setup(FloodlightModuleContext context) {
    ISwitchManager switchManager = context.getServiceImpl(ISwitchManager.class);
    config = switchManager.getSwitchManagerConfig();
    featureDetectorService = context.getServiceImpl(FeatureDetectorService.class);
    kildaCore = context.getServiceImpl(KildaCore.class);
    verificationBcastPacketDst = context.getServiceImpl(IPathVerificationService.class).getConfig().getVerificationBcastPacketDst();
}
Also used : ISwitchManager(org.openkilda.floodlight.switchmanager.ISwitchManager) IPathVerificationService(org.openkilda.floodlight.pathverification.IPathVerificationService) FeatureDetectorService(org.openkilda.floodlight.service.FeatureDetectorService) KildaCore(org.openkilda.floodlight.KildaCore)

Aggregations

FeatureDetectorService (org.openkilda.floodlight.service.FeatureDetectorService)8 KildaCore (org.openkilda.floodlight.KildaCore)5 IOFSwitchService (net.floodlightcontroller.core.internal.IOFSwitchService)4 FloodlightModuleConfigurationProvider (org.openkilda.floodlight.config.provider.FloodlightModuleConfigurationProvider)4 Properties (java.util.Properties)2 FloodlightModuleContext (net.floodlightcontroller.core.module.FloodlightModuleContext)2 PropertiesBasedConfigurationProvider (org.openkilda.config.provider.PropertiesBasedConfigurationProvider)2 FlowSegmentMetadata (org.openkilda.floodlight.model.FlowSegmentMetadata)2 IPathVerificationService (org.openkilda.floodlight.pathverification.IPathVerificationService)2 SwitchManagerConfig (org.openkilda.floodlight.switchmanager.SwitchManagerConfig)2 SwitchFlowFactory (org.openkilda.floodlight.switchmanager.factory.SwitchFlowFactory)2 MessageContext (org.openkilda.messaging.MessageContext)2 JdkProxyStaticConfigurationFactory (com.sabre.oss.conf4j.factory.jdkproxy.JdkProxyStaticConfigurationFactory)1 MapConfigurationSource (com.sabre.oss.conf4j.source.MapConfigurationSource)1 ExecutionException (java.util.concurrent.ExecutionException)1 TimeoutException (java.util.concurrent.TimeoutException)1 IFloodlightProviderService (net.floodlightcontroller.core.IFloodlightProviderService)1 IOFSwitch (net.floodlightcontroller.core.IOFSwitch)1 SwitchDescription (net.floodlightcontroller.core.SwitchDescription)1 FloodlightModuleException (net.floodlightcontroller.core.module.FloodlightModuleException)1