Java 类net.floodlightcontroller.core.FloodlightProvider 实例源码

项目:floodlight-nfv    文件:RestApiServer.java   
@Override
public void init(FloodlightModuleContext context)
        throws FloodlightModuleException {
    // This has to be done here since we don't know what order the
    // startUp methods will be called
    this.restlets = new ArrayList<RestletRoutable>();
    this.fmlContext = context;

    // read our config options
    Map<String, String> configOptions = context.getConfigParams(this);
    restHost = configOptions.get("host");
    if (restHost == null) {
        Map<String, String> providerConfigOptions = context.getConfigParams(
                FloodlightProvider.class);
        restHost = providerConfigOptions.get("openflowhost");
    }
    if (restHost != null) {
        logger.debug("REST host set to {}", restHost);
    }
    String port = configOptions.get("port");
    if (port != null) {
        restPort = Integer.parseInt(port);
    }
    logger.debug("REST port set to {}", restPort);
}
项目:floodlight-oss    文件:RestApiServer.java   
@Override
public void init(FloodlightModuleContext context)
        throws FloodlightModuleException {
    // This has to be done here since we don't know what order the
    // startUp methods will be called
    this.restlets = new ArrayList<RestletRoutable>();
    this.fmlContext = context;

    // read our config options
    Map<String, String> configOptions = context.getConfigParams(this);
    restHost = configOptions.get("host");
    if (restHost == null) {
        Map<String, String> providerConfigOptions = context.getConfigParams(
                FloodlightProvider.class);
        restHost = providerConfigOptions.get("openflowhost");
    }
    if (restHost != null) {
        logger.debug("REST host set to {}", restHost);
    }
    String port = configOptions.get("port");
    if (port != null) {
        restPort = Integer.parseInt(port);
    }
    logger.debug("REST port set to {}", restPort);
}
项目:Multipath-Hedera-system-in-Floodlight-controller    文件:ControllerTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();

    FloodlightProvider cm = new FloodlightProvider();
    controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
    fmc.addService(IFloodlightProviderService.class, controller);

    MemoryStorageSource memstorage = new MemoryStorageSource();
    fmc.addService(IStorageSourceService.class, memstorage);

    RestApiServer restApi = new RestApiServer();
    fmc.addService(IRestApiService.class, restApi);

    CounterStore cs = new CounterStore();
    fmc.addService(ICounterStoreService.class, cs);

    PktInProcessingTime ppt = new PktInProcessingTime();
    fmc.addService(IPktInProcessingTimeService.class, ppt);

    tp = new MockThreadPoolService();
    fmc.addService(IThreadPoolService.class, tp);

    ppt.init(fmc);
    restApi.init(fmc);
    memstorage.init(fmc);
    cm.init(fmc);
    tp.init(fmc);
    ppt.startUp(fmc);
    restApi.startUp(fmc);
    memstorage.startUp(fmc);
    cm.startUp(fmc);
    tp.startUp(fmc);
}
项目:smartenit    文件:ControllerTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();

    FloodlightProvider cm = new FloodlightProvider();
    controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
    fmc.addService(IFloodlightProviderService.class, controller);

    MemoryStorageSource memstorage = new MemoryStorageSource();
    fmc.addService(IStorageSourceService.class, memstorage);

    RestApiServer restApi = new RestApiServer();
    fmc.addService(IRestApiService.class, restApi);

    CounterStore cs = new CounterStore();
    fmc.addService(ICounterStoreService.class, cs);

    PktInProcessingTime ppt = new PktInProcessingTime();
    fmc.addService(IPktInProcessingTimeService.class, ppt);

    tp = new MockThreadPoolService();
    fmc.addService(IThreadPoolService.class, tp);

    ppt.init(fmc);
    restApi.init(fmc);
    memstorage.init(fmc);
    cm.init(fmc);
    tp.init(fmc);
    ppt.startUp(fmc);
    restApi.startUp(fmc);
    memstorage.startUp(fmc);
    cm.startUp(fmc);
    tp.startUp(fmc);
}
项目:spring-open    文件:ControllerTest.java   
@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();

    FloodlightProvider floodlightProvider = new FloodlightProvider();

    controller = (Controller) floodlightProvider.getServiceImpls().get(
            IFloodlightProviderService.class);
    fmc.addService(IFloodlightProviderService.class, controller);

    RestApiServer restApi = new RestApiServer();
    fmc.addService(IRestApiService.class, restApi);

    DebugCounter counterService = new DebugCounter();
    fmc.addService(IDebugCounterService.class, counterService);

    threadPool = new MockThreadPoolService();
    fmc.addService(IThreadPoolService.class, threadPool);

    IControllerRegistryService registry =
            createMock(IControllerRegistryService.class);
    fmc.addService(IControllerRegistryService.class, registry);
    LinkDiscoveryManager linkDiscovery = new LinkDiscoveryManager();
    fmc.addService(ILinkDiscoveryService.class, linkDiscovery);

    restApi.init(fmc);
    floodlightProvider.init(fmc);
    threadPool.init(fmc);
    linkDiscovery.init(fmc);
    restApi.startUp(fmc);
    floodlightProvider.startUp(fmc);
    threadPool.startUp(fmc);
}
项目:floodlight-qosmanager    文件:ControllerTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();

    FloodlightProvider cm = new FloodlightProvider();
    controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
    fmc.addService(IFloodlightProviderService.class, controller);

    MemoryStorageSource memstorage = new MemoryStorageSource();
    fmc.addService(IStorageSourceService.class, memstorage);

    RestApiServer restApi = new RestApiServer();
    fmc.addService(IRestApiService.class, restApi);

    CounterStore cs = new CounterStore();
    fmc.addService(ICounterStoreService.class, cs);

    PktInProcessingTime ppt = new PktInProcessingTime();
    fmc.addService(IPktInProcessingTimeService.class, ppt);

    tp = new MockThreadPoolService();
    fmc.addService(IThreadPoolService.class, tp);

    ppt.init(fmc);
    restApi.init(fmc);
    memstorage.init(fmc);
    cm.init(fmc);
    tp.init(fmc);
    ppt.startUp(fmc);
    restApi.startUp(fmc);
    memstorage.startUp(fmc);
    cm.startUp(fmc);
    tp.startUp(fmc);
}
项目:floodlight-nfv    文件:JythonDebugInterface.java   
@Override
public void startUp(FloodlightModuleContext context) {
    Map<String, Object> locals = new HashMap<String, Object>();     
    // add all existing module references to the debug server
    for (Class<? extends IFloodlightService> s : context.getAllServices()) {
        // Put only the last part of the name
        String[] bits = s.getCanonicalName().split("\\.");
        String name = bits[bits.length-1];
        locals.put(name, context.getServiceImpl(s));
    }

    // read our config options
    Map<String, String> configOptions = context.getConfigParams(this);
    jythonHost = configOptions.get("host");
    if (jythonHost == null) {
        Map<String, String> providerConfigOptions = context.getConfigParams(
                FloodlightProvider.class);
        jythonHost = providerConfigOptions.get("openflowhost");
    }
    if (jythonHost != null) {
        log.debug("Jython host set to {}", jythonHost);
    }
    String port = configOptions.get("port");
    if (port != null) {
        jythonPort = Integer.parseInt(port);
    }
    log.debug("Jython port set to {}", jythonPort);

    JythonServer debug_server = new JythonServer(jythonHost, jythonPort, locals);
    debug_server.start();
}
项目:floodlight-nfv    文件:ControllerTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();

    FloodlightProvider cm = new FloodlightProvider();
    controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
    fmc.addService(IFloodlightProviderService.class, controller);

    MemoryStorageSource memstorage = new MemoryStorageSource();
    fmc.addService(IStorageSourceService.class, memstorage);

    RestApiServer restApi = new RestApiServer();
    fmc.addService(IRestApiService.class, restApi);

    CounterStore cs = new CounterStore();
    fmc.addService(ICounterStoreService.class, cs);

    PktInProcessingTime ppt = new PktInProcessingTime();
    fmc.addService(IPktInProcessingTimeService.class, ppt);

    tp = new MockThreadPoolService();
    fmc.addService(IThreadPoolService.class, tp);

    ppt.init(fmc);
    restApi.init(fmc);
    memstorage.init(fmc);
    cm.init(fmc);
    tp.init(fmc);
    ppt.startUp(fmc);
    restApi.startUp(fmc);
    memstorage.startUp(fmc);
    cm.startUp(fmc);
    tp.startUp(fmc);
}
项目:HederaInFloodlight    文件:ControllerTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();

    FloodlightProvider cm = new FloodlightProvider();
    controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
    fmc.addService(IFloodlightProviderService.class, controller);

    MemoryStorageSource memstorage = new MemoryStorageSource();
    fmc.addService(IStorageSourceService.class, memstorage);

    RestApiServer restApi = new RestApiServer();
    fmc.addService(IRestApiService.class, restApi);

    CounterStore cs = new CounterStore();
    fmc.addService(ICounterStoreService.class, cs);

    PktInProcessingTime ppt = new PktInProcessingTime();
    fmc.addService(IPktInProcessingTimeService.class, ppt);

    tp = new MockThreadPoolService();
    fmc.addService(IThreadPoolService.class, tp);

    ppt.init(fmc);
    restApi.init(fmc);
    memstorage.init(fmc);
    cm.init(fmc);
    tp.init(fmc);
    ppt.startUp(fmc);
    restApi.startUp(fmc);
    memstorage.startUp(fmc);
    cm.startUp(fmc);
    tp.startUp(fmc);
}
项目:floodlight-oss    文件:JythonDebugInterface.java   
@Override
public void startUp(FloodlightModuleContext context) {
    Map<String, Object> locals = new HashMap<String, Object>();     
    // add all existing module references to the debug server
    for (Class<? extends IFloodlightService> s : context.getAllServices()) {
        // Put only the last part of the name
        String[] bits = s.getCanonicalName().split("\\.");
        String name = bits[bits.length-1];
        locals.put(name, context.getServiceImpl(s));
    }

    // read our config options
    Map<String, String> configOptions = context.getConfigParams(this);
    jythonHost = configOptions.get("host");
    if (jythonHost == null) {
        Map<String, String> providerConfigOptions = context.getConfigParams(
                FloodlightProvider.class);
        jythonHost = providerConfigOptions.get("openflowhost");
    }
    if (jythonHost != null) {
        log.debug("Jython host set to {}", jythonHost);
    }
    String port = configOptions.get("port");
    if (port != null) {
        jythonPort = Integer.parseInt(port);
    }
    log.debug("Jython port set to {}", jythonPort);

    JythonServer debug_server = new JythonServer(jythonHost, jythonPort, locals);
    debug_server.start();
}
项目:floodlight-oss    文件:ControllerTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();

    FloodlightProvider cm = new FloodlightProvider();
    controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
    fmc.addService(IFloodlightProviderService.class, controller);

    MemoryStorageSource memstorage = new MemoryStorageSource();
    fmc.addService(IStorageSourceService.class, memstorage);

    RestApiServer restApi = new RestApiServer();
    fmc.addService(IRestApiService.class, restApi);

    CounterStore cs = new CounterStore();
    fmc.addService(ICounterStoreService.class, cs);

    PktInProcessingTime ppt = new PktInProcessingTime();
    fmc.addService(IPktInProcessingTimeService.class, ppt);

    tp = new MockThreadPoolService();
    fmc.addService(IThreadPoolService.class, tp);

    ppt.init(fmc);
    restApi.init(fmc);
    memstorage.init(fmc);
    cm.init(fmc);
    tp.init(fmc);
    ppt.startUp(fmc);
    restApi.startUp(fmc);
    memstorage.startUp(fmc);
    cm.startUp(fmc);
    tp.startUp(fmc);
}
项目:my-floodlight    文件:ControllerTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();

    FloodlightProvider cm = new FloodlightProvider();
    controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
    fmc.addService(IFloodlightProviderService.class, controller);

    MemoryStorageSource memstorage = new MemoryStorageSource();
    fmc.addService(IStorageSourceService.class, memstorage);

    RestApiServer restApi = new RestApiServer();
    fmc.addService(IRestApiService.class, restApi);

    CounterStore cs = new CounterStore();
    fmc.addService(ICounterStoreService.class, cs);

    PktInProcessingTime ppt = new PktInProcessingTime();
    fmc.addService(IPktInProcessingTimeService.class, ppt);

    tp = new MockThreadPoolService();
    fmc.addService(IThreadPoolService.class, tp);

    ppt.init(fmc);
    restApi.init(fmc);
    memstorage.init(fmc);
    cm.init(fmc);
    tp.init(fmc);
    ppt.startUp(fmc);
    restApi.startUp(fmc);
    memstorage.startUp(fmc);
    cm.startUp(fmc);
    tp.startUp(fmc);
}
项目:FL_HAND    文件:ControllerTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();

    FloodlightProvider cm = new FloodlightProvider();
    controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
    fmc.addService(IFloodlightProviderService.class, controller);

    MemoryStorageSource memstorage = new MemoryStorageSource();
    fmc.addService(IStorageSourceService.class, memstorage);

    RestApiServer restApi = new RestApiServer();
    fmc.addService(IRestApiService.class, restApi);

    CounterStore cs = new CounterStore();
    fmc.addService(ICounterStoreService.class, cs);

    PktInProcessingTime ppt = new PktInProcessingTime();
    fmc.addService(IPktInProcessingTimeService.class, ppt);

    tp = new MockThreadPoolService();
    fmc.addService(IThreadPoolService.class, tp);

    ppt.init(fmc);
    restApi.init(fmc);
    memstorage.init(fmc);
    cm.init(fmc);
    tp.init(fmc);
    ppt.startUp(fmc);
    restApi.startUp(fmc);
    memstorage.startUp(fmc);
    cm.startUp(fmc);
    tp.startUp(fmc);
}
项目:sdn-project    文件:ControllerTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();

    FloodlightProvider cm = new FloodlightProvider();
    controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
    fmc.addService(IFloodlightProviderService.class, controller);

    MemoryStorageSource memstorage = new MemoryStorageSource();
    fmc.addService(IStorageSourceService.class, memstorage);

    RestApiServer restApi = new RestApiServer();
    fmc.addService(IRestApiService.class, restApi);

    CounterStore cs = new CounterStore();
    fmc.addService(ICounterStoreService.class, cs);

    PktInProcessingTime ppt = new PktInProcessingTime();
    fmc.addService(IPktInProcessingTimeService.class, ppt);

    tp = new MockThreadPoolService();
    fmc.addService(IThreadPoolService.class, tp);

    ppt.init(fmc);
    restApi.init(fmc);
    memstorage.init(fmc);
    cm.init(fmc);
    tp.init(fmc);
    ppt.startUp(fmc);
    restApi.startUp(fmc);
    memstorage.startUp(fmc);
    cm.startUp(fmc);
    tp.startUp(fmc);
}