當前位置: 首頁>>代碼示例>>Java>>正文


Java DefaultVirtualNetwork類代碼示例

本文整理匯總了Java中org.onosproject.incubator.net.virtual.DefaultVirtualNetwork的典型用法代碼示例。如果您正苦於以下問題:Java DefaultVirtualNetwork類的具體用法?Java DefaultVirtualNetwork怎麽用?Java DefaultVirtualNetwork使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DefaultVirtualNetwork類屬於org.onosproject.incubator.net.virtual包,在下文中一共展示了DefaultVirtualNetwork類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addNetwork

import org.onosproject.incubator.net.virtual.DefaultVirtualNetwork; //導入依賴的package包/類
@Override
public VirtualNetwork addNetwork(TenantId tenantId) {

    checkState(tenantIdSet.contains(tenantId), "The tenant has not been registered. " + tenantId.id());
    VirtualNetwork virtualNetwork = new DefaultVirtualNetwork(genNetworkId(), tenantId);
    //TODO update both maps in one transaction.
    networkIdVirtualNetworkMap.put(virtualNetwork.id(), virtualNetwork);

    Set<NetworkId> networkIdSet = tenantIdNetworkIdSetMap.get(tenantId);
    if (networkIdSet == null) {
        networkIdSet = new HashSet<>();
    }
    networkIdSet.add(virtualNetwork.id());
    tenantIdNetworkIdSetMap.put(tenantId, networkIdSet);

    return virtualNetwork;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:18,代碼來源:DistributedVirtualNetworkStore.java

示例2: testCreateVirtualDeviceWithNoNetwork

import org.onosproject.incubator.net.virtual.DefaultVirtualNetwork; //導入依賴的package包/類
/**
 * Tests adding a virtual device where no virtual network exists.
 */
@Test(expected = IllegalStateException.class)
public void testCreateVirtualDeviceWithNoNetwork() {
    manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
    VirtualNetwork virtualNetwork = new DefaultVirtualNetwork(NetworkId.NONE, TenantId.tenantId(tenantIdValue1));

    manager.createVirtualDevice(virtualNetwork.id(), DeviceId.deviceId(deviceIdValue1));
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:11,代碼來源:VirtualNetworkManagerTest.java

示例3: decode

import org.onosproject.incubator.net.virtual.DefaultVirtualNetwork; //導入依賴的package包/類
@Override
public VirtualNetwork decode(ObjectNode json, CodecContext context) {
    if (json == null || !json.isObject()) {
        return null;
    }

    NetworkId nId = NetworkId.networkId(Long.parseLong(extractMember(NETWORK_ID, json)));
    TenantId tId = TenantId.tenantId(extractMember(TENANT_ID, json));
    return new DefaultVirtualNetwork(nId, tId);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:11,代碼來源:VirtualNetworkCodec.java

示例4: testCreateVirtualDeviceWithNoNetwork

import org.onosproject.incubator.net.virtual.DefaultVirtualNetwork; //導入依賴的package包/類
/**
 * Tests adding a virtual device where no virtual network exists.
 */
@Test(expected = IllegalStateException.class)
public void testCreateVirtualDeviceWithNoNetwork() {
    manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
    VirtualNetwork virtualNetwork =
            new DefaultVirtualNetwork(NetworkId.NONE,
                                      TenantId.tenantId(tenantIdValue1));

    manager.createVirtualDevice(virtualNetwork.id(), DID1);
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:13,代碼來源:VirtualNetworkManagerTest.java

示例5: testCreateVirtualHostWithNoNetwork

import org.onosproject.incubator.net.virtual.DefaultVirtualNetwork; //導入依賴的package包/類
/**
 * Tests adding a virtual host where no virtual network exists.
 */
@Test(expected = IllegalStateException.class)
public void testCreateVirtualHostWithNoNetwork() {
    manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
    VirtualNetwork virtualNetwork =
            new DefaultVirtualNetwork(NetworkId.NONE, TenantId.tenantId(tenantIdValue1));

    manager.createVirtualHost(virtualNetwork.id(), HID1, null, null, null, null);
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:12,代碼來源:VirtualNetworkManagerTest.java

示例6: network

import org.onosproject.incubator.net.virtual.DefaultVirtualNetwork; //導入依賴的package包/類
private VirtualNetwork network(int networkID, String tenantID) {
    return new DefaultVirtualNetwork(NetworkId.networkId(networkID), TenantId.tenantId(tenantID));
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:4,代碼來源:ComparatorsTest.java


注:本文中的org.onosproject.incubator.net.virtual.DefaultVirtualNetwork類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。