Package net.floodlightcontroller.core.module

Examples of net.floodlightcontroller.core.module.FloodlightModuleContext


        ArrayList<IStoreClient<String,String>> unsyncStores =
                new ArrayList<IStoreClient<String,String>>();
        ArrayList<Short> nodeIds = new ArrayList<Short>();
        ArrayList<Node> nodes = new ArrayList<Node>();
       
        FloodlightModuleContext fmc = new FloodlightModuleContext();
        ThreadPool tp = new ThreadPool();

        int curPort = 6699;
       
        String keyStorePath = new File(dbFolder.getRoot(),
                                       "keystore.jceks").getAbsolutePath();
        String keyStorePassword = "bootstrapping is fun!";
        CryptoUtil.writeSharedSecret(keyStorePath,
                                     keyStorePassword,
                                     CryptoUtil.secureRandom(16));
       
        // autobootstrap a cluster of 4 nodes
        for (int i = 0; i < 4; i++) {
            SyncManager syncManager = new SyncManager();
            syncManagers.add(syncManager);

            fmc.addService(IThreadPoolService.class, tp);
            fmc.addService(IDebugCounterService.class, new NullDebugCounter());
            String dbPath =
                    new File(dbFolder.getRoot(),
                             "server" + i).getAbsolutePath();
            fmc.addConfigParam(syncManager, "dbPath", dbPath);

            tp.init(fmc);
            syncManager.init(fmc);
            tp.startUp(fmc);
            syncManager.startUp(fmc);
View Full Code Here


        nodeString = mapper.writeValueAsString(nodes);
       
        tp = new ThreadPool();
        syncManager = new SyncManager();
       
        FloodlightModuleContext fmc = new FloodlightModuleContext();
        fmc.addService(IThreadPoolService.class, tp);
        fmc.addService(IDebugCounterService.class, new NullDebugCounter());
       
        fmc.addConfigParam(syncManager, "nodes", nodeString);
        fmc.addConfigParam(syncManager, "thisNode", ""+1);
        fmc.addConfigParam(syncManager, "persistenceEnabled", "false");
        fmc.addConfigParam(syncManager, "authScheme", "CHALLENGE_RESPONSE");
        fmc.addConfigParam(syncManager, "keyStorePath",
                           keyStoreFile.getAbsolutePath());
        fmc.addConfigParam(syncManager, "keyStorePassword", keyStorePassword);
        tp.init(fmc);
        syncManager.init(fmc);

        tp.startUp(fmc);
        syncManager.startUp(fmc);
View Full Code Here

    /**
     * Set up the remote sync manager and prepare for requests
     * @throws Exception
     */
    protected void connect() throws Exception {
        FloodlightModuleContext fmc = new FloodlightModuleContext();
        ThreadPool tp = new ThreadPool();
        syncManager = new RemoteSyncManager();
        fmc.addService(IThreadPoolService.class, tp);
        fmc.addService(ISyncService.class, syncManager);
        fmc.addConfigParam(syncManager, "hostname", settings.hostname);
        fmc.addConfigParam(syncManager, "port",
                           Integer.toString(settings.port));
        if (settings.authScheme != null) {
            fmc.addConfigParam(syncManager, "authScheme",
                               settings.authScheme.toString());
            fmc.addConfigParam(syncManager, "keyStorePath", settings.keyStorePath);
            fmc.addConfigParam(syncManager, "keyStorePassword",
                               settings.keyStorePassword);
        }
        tp.init(fmc);
        syncManager.init(fmc);
        tp.startUp(fmc);
View Full Code Here

   
    RemoteSyncManager remoteSyncManager;

    @Before
    public void setUp() throws Exception {
        FloodlightModuleContext fmc = new FloodlightModuleContext();
        tp = new ThreadPool();

        syncManager = new SyncManager();
        remoteSyncManager = new RemoteSyncManager();

        fmc.addService(IThreadPoolService.class, tp);
        fmc.addService(IDebugCounterService.class, new NullDebugCounter());
        fmc.addConfigParam(syncManager, "persistenceEnabled", "false");
       
        tp.init(fmc);
        syncManager.init(fmc);
        remoteSyncManager.init(fmc);
View Full Code Here

        nodes.add(new Node("localhost", 40103, (short)3, (short)1));
        nodes.add(new Node("localhost", 40104, (short)4, (short)2));
        nodeString = mapper.writeValueAsString(nodes);

        for(int i = 0; i < 4; i++) {
            moduleContexts[i] = new FloodlightModuleContext();
            syncManagers[i] = new SyncManager();
            setupSyncManager(moduleContexts[i], syncManagers[i], nodes.get(i));
        }
    }
View Full Code Here

                                          syncManagers.length + 1);
        FloodlightModuleContext[] fmcs =
                Arrays.copyOf(moduleContexts,
                              moduleContexts.length + 1);
        sms[syncManagers.length] = new SyncManager();
        fmcs[moduleContexts.length] = new FloodlightModuleContext();
        nodeString = mapper.writeValueAsString(nodes);

        setupSyncManager(fmcs[moduleContexts.length],
                         sms[syncManagers.length],
                         nodes.get(syncManagers.length));
View Full Code Here

        tp.startUp(null);
        nodes = new ArrayList<Node>();
        nodes.add(new Node("localhost", 40101, (short)1, (short)1));
        nodeString = mapper.writeValueAsString(nodes);
        SyncManager sm = new SyncManager();
        FloodlightModuleContext fmc = new FloodlightModuleContext();
        setupSyncManager(fmc, sm, nodes.get(0));
        fmc.addService(ISyncService.class, sm);
        SyncTorture st = new SyncTorture();
        //fmc.addConfigParam(st, "iterations", "1");
        st.init(fmc);
        st.startUp(fmc);
        Thread.sleep(10000);
View Full Code Here

        super.setUp();

        mockSyncService = new MockSyncService();

        // Module loading stuff
        FloodlightModuleContext fmc = new FloodlightModuleContext();
        RestApiServer restApi = new RestApiServer();
        deviceService = new MockDeviceManager();
        FlowReconcileManager frm = new FlowReconcileManager();
        MockThreadPoolService tps = new MockThreadPoolService();
        ITopologyService topology = createMock(ITopologyService.class);
        vns = new VirtualNetworkFilter();
        DefaultEntityClassifier entityClassifier = new DefaultEntityClassifier();
        fmc.addService(IRestApiService.class, restApi);
        fmc.addService(IFloodlightProviderService.class, getMockFloodlightProvider());
        fmc.addService(IDeviceService.class, deviceService);
        fmc.addService(IFlowReconcileService.class, frm);
        fmc.addService(IThreadPoolService.class, tps);
        fmc.addService(IEntityClassifierService.class, entityClassifier);
        fmc.addService(ITopologyService.class, topology);
        fmc.addService(ISyncService.class, mockSyncService);
        tps.init(fmc);
        frm.init(fmc);
        deviceService.init(fmc);
        restApi.init(fmc);
        getMockFloodlightProvider().init(fmc);
View Full Code Here

   
    @Before
    public void setUp() throws Exception {
        super.setUp();

        fmc = new FloodlightModuleContext();
        flowReconcileMgr = new FlowReconcileManager();
        threadPool = new MockThreadPoolService();
        counterStore = createMock(ICounterStoreService.class);
       
        fmc.addService(ICounterStoreService.class, counterStore);
View Full Code Here

        // Load the switch map
        Map<Long, IOFSwitch> switches = new HashMap<Long, IOFSwitch>();
        switches.put(dpid, sw);
        mockFloodlightProvider.setSwitches(switches);

        FloodlightModuleContext fmc = new FloodlightModuleContext();
        fmc.addService(IFloodlightProviderService.class,
                mockFloodlightProvider);
        fmc.addService(IFirewallService.class, firewall);
        fmc.addService(IStorageSourceService.class, storageService);
        fmc.addService(IRestApiService.class, restApi);

        restApi.init(fmc);

        firewall.init(fmc);
        firewall.startUp(fmc);
View Full Code Here

TOP

Related Classes of net.floodlightcontroller.core.module.FloodlightModuleContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.