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


Java DefaultHostRoute类代码示例

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


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

示例1: activate

import org.onosproject.vtnrsc.DefaultHostRoute; //导入依赖的package包/类
@Activate
public void activate() {

    appId = coreService.registerApplication(VTNRSC_APP);

    subnetStore = storageService.<SubnetId, Subnet>consistentMapBuilder()
            .withName(SUBNET)
            .withApplicationId(appId)
            .withPurgeOnUninstall()
            .withSerializer(Serializer.using(Arrays.asList(KryoNamespaces.API),
                                             Subnet.class,
                                             SubnetId.class,
                                             TenantNetworkId.class,
                                             TenantId.class,
                                             HostRoute.class,
                                             DefaultHostRoute.class,
                                             Subnet.Mode.class,
                                             AllocationPool.class,
                                             DefaultAllocationPool.class,
                                             DefaultSubnet.class,
                                             IpAddress.Version.class))
            .build().asJavaMap();

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:SubnetManager.java

示例2: jsonNodeToHostRoutes

import org.onosproject.vtnrsc.DefaultHostRoute; //导入依赖的package包/类
/**
 * Changes hostRoutes JsonNode to a collection of the hostRoutes.
 *
 * @param hostRoutes the hostRoutes json node
 * @return a collection of hostRoutes
 */
public Iterable<HostRoute> jsonNodeToHostRoutes(JsonNode hostRoutes) {
    checkNotNull(hostRoutes, JSON_NOT_NULL);
    ConcurrentMap<Integer, HostRoute> hostRouteMaps = Maps
            .newConcurrentMap();
    Integer i = 0;
    for (JsonNode node : hostRoutes) {
        IpAddress nexthop = IpAddress.valueOf(node.get("nexthop").asText());
        IpPrefix destination = IpPrefix.valueOf(node.get("destination")
                .asText());
        HostRoute hostRoute = new DefaultHostRoute(nexthop, destination);
        hostRouteMaps.putIfAbsent(i, hostRoute);
        i++;
    }
    return Collections.unmodifiableCollection(hostRouteMaps.values());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:SubnetWebResource.java


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