当前位置: 首页>>代码示例>>Java>>正文


Java IOFSwitchDriver类代码示例

本文整理汇总了Java中net.floodlightcontroller.core.IOFSwitchDriver的典型用法代码示例。如果您正苦于以下问题:Java IOFSwitchDriver类的具体用法?Java IOFSwitchDriver怎么用?Java IOFSwitchDriver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IOFSwitchDriver类属于net.floodlightcontroller.core包,在下文中一共展示了IOFSwitchDriver类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addSwitchDriver

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
@Override
public synchronized void addSwitchDriver(String manufacturerDescPrefix,
                                         IOFSwitchDriver driver) {
    if (manufacturerDescPrefix == null) {
        throw new NullPointerException("manufacturerDescrptionPrefix" +
                " must not be null");
    }
    if (driver == null) {
        throw new NullPointerException("driver must not be null");
    }

    IOFSwitchDriver existingDriver = switchBindingMap.get(manufacturerDescPrefix);
    if (existingDriver != null ) {
        throw new IllegalStateException("Failed to add OFSwitch driver for "
                + manufacturerDescPrefix + "already registered");
    }
    switchBindingMap.put(manufacturerDescPrefix, driver);
    switchDescSorted.add(manufacturerDescPrefix);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:20,代码来源:NaiiveSwitchDriverRegistry.java

示例2: addOFSwitchDriver

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
@Override
public void addOFSwitchDriver(String description, IOFSwitchDriver driver) {
    IOFSwitchDriver existingDriver = switchBindingMap.get(description);
    if (existingDriver != null) {
        log.warn("Failed to add OFSwitch driver for {}, " +
                 "already registered", description);
        return;
    }
    switchBindingMap.put(description, driver);

    // Sort so we match the longest string first
    int index = -1;
    for (String desc : switchDescSortedList) {
        if (description.compareTo(desc) > 0) {
            index = switchDescSortedList.indexOf(desc);
            switchDescSortedList.add(index, description);
            break;
        }
    }
    if (index == -1) {  // append to list
        switchDescSortedList.add(description);
    }
}
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:24,代码来源:Controller.java

示例3: init

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
/**
 * Initialize internal data structures
 */
public void init(Map<String, String> configParams) {
    // These data structures are initialized here because other
    // module's startUp() might be called before ours
    this.messageListeners =
            new ConcurrentHashMap<OFType,
                                  ListenerDispatcher<OFType,
                                                     IOFMessageListener>>();
    this.switchListeners = new CopyOnWriteArraySet<IOFSwitchListener>();
    this.haListeners = new CopyOnWriteArraySet<IHAListener>();
    this.switchBindingMap =
            new ConcurrentHashMap<String, IOFSwitchDriver>();
    this.switchDescSortedList = new ArrayList<String>();
    this.activeSwitches = new ConcurrentHashMap<Long, IOFSwitch>();
    this.connectedSwitches = new HashSet<IOFSwitch>();
    this.controllerNodeIPsCache = new HashMap<String, String>();
    this.updates = new LinkedBlockingQueue<IUpdate>();
    this.factory = new BasicFactory();
    this.providerMap = new HashMap<String, List<IInfoProvider>>();
    setConfigParams(configParams);
    this.role = getInitialRole(configParams);
    this.notifiedRole = this.role;
    this.roleChanger = new RoleChanger(this);
    initVendorMessages();
    this.systemStartTime = System.currentTimeMillis();
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:29,代码来源:Controller.java

示例4: addSwitchDriver

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
@Override
public synchronized void addSwitchDriver(@Nonnull String manufacturerDescPrefix,
                                         @Nonnull IOFSwitchDriver driver) {
    Preconditions.checkNotNull(manufacturerDescPrefix, "manufactererDescProfix");
    Preconditions.checkNotNull(driver, "driver");

    IOFSwitchDriver existingDriver = switchBindingMap.get(manufacturerDescPrefix);
    if (existingDriver != null ) {
        throw new IllegalStateException("Failed to add OFSwitch driver for "
                + manufacturerDescPrefix + "already registered");
    }
    switchBindingMap.put(manufacturerDescPrefix, driver);
    switchDescSorted.add(manufacturerDescPrefix);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:15,代码来源:NaiveSwitchDriverRegistry.java

示例5: testSwitchDriverRegistryNoDriver

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
/**
 * Test SwitchDriverRegistry
 * Test fallback to default if no switch driver is registered for a
 * particular prefix
 */
@Test
public void testSwitchDriverRegistryNoDriver() {
    IOFSwitchDriver driver = createMock(IOFSwitchDriver.class);
    IOFSwitch returnedSwitch = null;
    IOFSwitchBackend mockSwitch = createMock(IOFSwitchBackend.class);
    switchManager.addOFSwitchDriver("test switch", driver);

    replay(driver);
    replay(mockSwitch);

    SwitchDescription desc = new SwitchDescription("test switch", "version 0.9", "", "", "");
    reset(driver);
    reset(mockSwitch);
    mockSwitch.setSwitchProperties(desc);
    expectLastCall().once();
    expect(driver.getOFSwitchImpl(desc, factory)).andReturn(mockSwitch).once();
    replay(driver);
    replay(mockSwitch);
    returnedSwitch = switchManager.getOFSwitchInstance(new NullConnection(), desc, factory, DatapathId.of(1));
    assertSame(mockSwitch, returnedSwitch);
    verify(driver);
    verify(mockSwitch);

    desc = new SwitchDescription("Foo Bar test switch", "version 0.9", "", "", "");
    reset(driver);
    reset(mockSwitch);
    replay(driver);
    replay(mockSwitch);
    returnedSwitch = switchManager.getOFSwitchInstance(new NullConnection(), desc,
            OFFactories.getFactory(OFVersion.OF_10), DatapathId.of(1));
    assertNotNull(returnedSwitch);
    assertTrue("Returned switch should be OFSwitch",
               returnedSwitch instanceof OFSwitch);
    assertEquals(desc, returnedSwitch.getSwitchDescription());
    verify(driver);
    verify(mockSwitch);
}
 
开发者ID:rizard,项目名称:fast-failover-demo,代码行数:43,代码来源:OFSwitchManagerTest.java

示例6: init

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
/**
 * Initialize internal data structures
 */
public void init(Map<String, String> configParams) {
    // These data structures are initialized here because other
    // module's startUp() might be called before ours
    this.messageListeners =
            new ConcurrentHashMap<OFType,
                                  ListenerDispatcher<OFType,
                                                     IOFMessageListener>>();
    this.switchListeners = new CopyOnWriteArraySet<IOFSwitchListener>();
    this.haListeners = new CopyOnWriteArraySet<IHAListener>();
    this.switchBindingMap =
            new ConcurrentHashMap<String, IOFSwitchDriver>();
    this.switchDescSortedList = new ArrayList<String>();
    this.activeSwitches = new ConcurrentHashMap<Long, IOFSwitch>();
    this.connectedSwitches = new HashSet<IOFSwitch>();
    this.controllerNodeIPsCache = new HashMap<String, String>();
    this.updates = new LinkedBlockingQueue<IUpdate>();
    this.factory = new BasicFactory();
    this.providerMap = new HashMap<String, List<IInfoProvider>>();
    setConfigParams(configParams);
    this.role = getInitialRole(configParams);
    this.notifiedRole = this.role;
    this.roleChanger = new RoleChanger(this);
    initVendorMessages();

    String option = configParams.get("flushSwitchesOnReconnect");

    if (option != null && option.equalsIgnoreCase("true")) {
        this.setAlwaysClearFlowsOnSwAdd(true);
        log.info("Flush switches on reconnect -- Enabled.");
    } else {
        this.setAlwaysClearFlowsOnSwAdd(false);
        log.info("Flush switches on reconnect -- Disabled");
    }
 }
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:38,代码来源:Controller.java

示例7: addOFSwitchDriver

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
@Override
public void addOFSwitchDriver(String manufacturerDescriptionPrefix,
                              IOFSwitchDriver driver) {
    // do nothing

}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:7,代码来源:MockSwitchManager.java

示例8: NaiveSwitchDriverRegistry

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
public NaiveSwitchDriverRegistry(@Nonnull IOFSwitchManager switchManager) {
    Preconditions.checkNotNull(switchManager, "switchManager must not be null");
    this.switchManager  = switchManager;
    switchBindingMap = new HashMap<String, IOFSwitchDriver>();
    switchDescSorted = new TreeSet<String>(Collections.reverseOrder());
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:7,代码来源:NaiveSwitchDriverRegistry.java

示例9: addOFSwitchDriver

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
@Override
public void addOFSwitchDriver(String manufacturerDescriptionPrefix,
		IOFSwitchDriver driver) {
	this.driverRegistry.addSwitchDriver(manufacturerDescriptionPrefix, driver);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:6,代码来源:OFSwitchManager.java

示例10: addOFSwitchDriver

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
@Override
public void addOFSwitchDriver(String manufacturerDescriptionPrefix,
                              IOFSwitchDriver driver) {
    driverRegistry.addSwitchDriver(manufacturerDescriptionPrefix, driver);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:6,代码来源:Controller.java

示例11: NaiiveSwitchDriverRegistry

import net.floodlightcontroller.core.IOFSwitchDriver; //导入依赖的package包/类
public NaiiveSwitchDriverRegistry() {
    switchBindingMap = new HashMap<String, IOFSwitchDriver>();
    switchDescSorted = new TreeSet<String>(Collections.reverseOrder());
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:5,代码来源:NaiiveSwitchDriverRegistry.java


注:本文中的net.floodlightcontroller.core.IOFSwitchDriver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。