當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。