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


Java DefaultNextGroup类代码示例

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


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

示例1: getNextGroup

import org.onosproject.net.behaviour.DefaultNextGroup; //导入依赖的package包/类
@Override
public NextGroup getNextGroup(Integer nextId) {
    if (nextId != 4) {
        byte[] data = new byte[1];
        data[0] = 5;
        return new DefaultNextGroup(data);
    } else {
        return null;
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:FlowObjectiveManagerTest.java

示例2: getNextGroup

import org.onosproject.net.behaviour.DefaultNextGroup; //导入依赖的package包/类
@Override
public NextGroup getNextGroup(Integer nextId) {
    Versioned<byte[]> versionGroup = nextGroups.get(nextId);
    if (versionGroup != null) {
        return new DefaultNextGroup(versionGroup.value());
    }
    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:DistributedFlowObjectiveStore.java

示例3: removeNextGroup

import org.onosproject.net.behaviour.DefaultNextGroup; //导入依赖的package包/类
@Override
public NextGroup removeNextGroup(Integer nextId) {
    Versioned<byte[]> versionGroup = nextGroups.remove(nextId);
    if (versionGroup != null) {
        return new DefaultNextGroup(versionGroup.value());
    }
    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:DistributedFlowObjectiveStore.java

示例4: testFlowObjectiveStore

import org.onosproject.net.behaviour.DefaultNextGroup; //导入依赖的package包/类
@Test
public void testFlowObjectiveStore() {
    NextGroup group2 = new DefaultNextGroup("2".getBytes(Charsets.US_ASCII));
    int group1Id = store.allocateNextId();
    int group2Id = store.allocateNextId();

    NextGroup group1add = store.getNextGroup(group1Id);
    assertThat(group1add, nullValue());

    store.putNextGroup(group2Id, group2);
    NextGroup group2Query = store.getNextGroup(group2Id);
    assertThat(group2Query.data(), is(group2.data()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:14,代码来源:DistributedFlowObjectiveStoreTest.java

示例5: getNextGroup

import org.onosproject.net.behaviour.DefaultNextGroup; //导入依赖的package包/类
@Override
public NextGroup getNextGroup(NetworkId networkId, Integer nextId) {
    ConcurrentMap<Integer, byte[]> nextGroups = getNextGroups(networkId);
    byte[] groupData = nextGroups.get(nextId);
    if (groupData != null) {
        return new DefaultNextGroup(groupData);
    }
    return null;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:10,代码来源:SimpleVirtualFlowObjectiveStore.java

示例6: removeNextGroup

import org.onosproject.net.behaviour.DefaultNextGroup; //导入依赖的package包/类
@Override
public NextGroup removeNextGroup(NetworkId networkId, Integer nextId) {
    ConcurrentMap<Integer, byte[]> nextGroups = getNextGroups(networkId);
    byte[] nextGroup = nextGroups.remove(nextId);
    updateNextGroupsMap(networkId, nextGroups);

    eventQ.add(new VirtualObjectiveEvent(networkId, ObjectiveEvent.Type.REMOVE, nextId));

    return new DefaultNextGroup(nextGroup);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:11,代码来源:SimpleVirtualFlowObjectiveStore.java

示例7: testFlowObjectiveStore

import org.onosproject.net.behaviour.DefaultNextGroup; //导入依赖的package包/类
@Test
public void testFlowObjectiveStore() {
    NextGroup group1 = new DefaultNextGroup("1".getBytes(Charsets.US_ASCII));
    NextGroup group2 = new DefaultNextGroup("2".getBytes(Charsets.US_ASCII));
    NextGroup group3 = new DefaultNextGroup("3".getBytes(Charsets.US_ASCII));
    int group1Id = store.allocateNextId();
    int group2Id = store.allocateNextId();
    int group3Id = store.allocateNextId();

    NextGroup group1add = store.getNextGroup(group1Id);
    assertThat(group1add, nullValue());
    NextGroup dif = store.getNextGroup(3);
    assertThat(dif, is(nullValue()));


    store.putNextGroup(group1Id, group1);
    store.putNextGroup(group2Id, group2);
    NextGroup group2Query = store.getNextGroup(group2Id);
    assertThat(group2Query.data(), is(group2.data()));
    assertTrue(store.getAllGroups().containsKey(group2Id));
    assertTrue(store.getAllGroups().containsKey(group1Id));

    store.removeNextGroup(group2Id);
    assertTrue(store.getAllGroups().containsKey(group1Id));
    assertFalse(store.getAllGroups().containsKey(group2Id));
    store.removeNextGroup(group1Id);
    assertEquals(store.getAllGroups(), Collections.emptyMap());


    store.putNextGroup(group3Id, group3);
    store.removeNextGroup(group2Id);
    NextGroup nullGroup = store.getNextGroup(group2Id);
    assertThat(nullGroup, nullValue());

    assertThat(store.getAllGroups().size(), is(1));
    assertThat(store.getAllGroups(), IsMapContaining.hasKey(group3Id));
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:38,代码来源:DistributedFlowObjectiveStoreTest.java


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