当前位置: 首页>>代码示例>>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;未经允许,请勿转载。